3D race track from image

Blitz3D Forums/Blitz3D Programming/3D race track from image

Can anyone offer some code or assistance creating a function that will take a heightmap and create a mesh from it, given parameters to specify how far along the X and Z axis each pixel represents. and a height scale. I need it to create vertices for non black pixels only, so I dont have a terrain looking track. Any advice help or code would be vey much appreciated. thanks.

I would simply lock the texture then run a loop (x,y) and readpixelfast the heightmap.

If a pixel is not black then create a quad by adding verts and tris to a mesh, the position of which you can take directly from the loop variables.

thanks.. i was overcomplicating the idea by tring to create a vert for each pixel, then I couldnt figure out an algo to determine vertex orders.. thanks much

I dont know if this has been sorted but isnt there a limit to the number of polies a surface can have (65535 or summat).

Yes, there is a DirectX 7 limit of 65535 vertices per surface.

http://blitzbasic.com/codearcs/codearcs.php?code=465