Convert spline to mesh help required.
Blitz3D Forums/Blitz3D Programming/Convert spline to mesh help required.
| ||
I'm trying to program a track editor and have got a nice editor going that can define anchor points which define the shape of a bezier spline thingy which forms a continuous loop for a race track. So. I have generated a array or x,y and z coords derived from my spline shape. What is the best way to turn them into a mesh. I've tried a few things but have got myself into a right pickle and can't quit figure it out. Please help. Code snippets would be very helpful. Thanks. |
| ||
If you just want a flat track it's very simple: Pseudo codeish thingie: Create an empty mesh For every anchor point Position a dummy pivot and align it to the anchor point TFormPoint -1,0,0,dummy pivot,0 Add a vertex at TformedX,Y,Z TFormPoint 1,0,0,dummy pivot,0 Add a vertex at TformedX,Y,Z If anchor point>first add triangles between previous anchor point vertices and this anchor points vertices else if anchor point = last add triangles between the first anchor point vertices and this anchor points vertices end if Next anchor pointThat's it :) |
| ||
Thanks Fredborg. I'll let you know how I get on. |
| ||
speakin gof splines - does anyone know how to extrude a spline into a full 3d object? |