# Something cool

So a while back i was working on making my own curves algorithm.
However it got delayed anyways i got a bit of time to work on it.
I just wanted to show off the initial results with a picture.

This isn’t a Nurbs surface like in some of my other pics, or a rework of other surface code to c# its my own creation.

A second degree oolynominal artificial spline blended surface.

This was generated by a 9x9 control point set.
All the control points actually intersect the surface as well.
The outputed surface is about 50x50 vertices.

3 Likes

Looks really nice, its for generating terrain right? Does it look good with different LOD? If you got a pic with texture it would be nice to see.

You could use it for terrain as is certainly as the control points intersect the surface. The control points take vectors so it’s not limited to just a height map.

For example this is the control net that creates this surface the control net is a 9x9 grid. Basically this would be a height map but it will create the surface to follow the control net in x,y and z. So i could make the bumps bend out and around into space.

``````   controlArray = new Vector4[]
{
new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f),
new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,.1f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f),
new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f),
new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,.06f,1f), new Vector4(0f,0f,-.05f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f),
new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,.15f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f),
new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,.0f,.1f,1f), new Vector4(0f,0f,.1f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f),
new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f),
new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f),
new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f), new Vector4(0f,0f,0f,1f)
};
``````

It still needs a lot of work though before i start making odd stuff like donuts and toruses.

1 Like

I might put up the code on github it’s really just a couple classes at the moment.

Is the sphere also created with your patch surface?

I’m wondering if the patches have regularity requirements in the number of control handles or how the controls tesselate out into the final mesh?

The spheres are a different algorithm, that one cpu side tessellates cubes into spheres, to take the old style cubemap textures. I made that so i could see skyboxes as sky spheres.

The curve and surface is pretty simple atm didn’t get to far into it yet.

Right now i think the minimum control points are 5 x 5 the surface size can be whatever. The control points lie on the surface in the curve though im not even sure were they are after the surface is made. tbh i didn’t even check that yet.

The red points in the curve are the control points, the few points that are way outside the curves are artificially generated temporary controls. The initial curves are non contiguous so their opposites are generated and the curve is blended. End points are handled with special cases.

I haven’t gotten to far into it like how im going to handle adjoining surfaces.
I figure if nothing else this will work for terrain and simple modeling.

I haven’t gotten to far into it like how im going to handle adjoining surfaces.

Have fun with that. If there isn’t a cylindrical nature to the join then adjoining surfaces is a nightmare. Surface joining sucks to do.

I figure if nothing else this will work for terrain and simple modeling.

Definitely seems like it’d work as a base for vector-field terrain (like Halo Wars 1). The curve patches would be enough for most areas and the higher resolution vector deltas could be confined to patches within the curve mesh where the local detail became important.

I think both can be handled fairly easy.
When i get the time ill clean it up and post it.