3D race track from image

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

RifRaf(Posted 2004) [#1]
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.


Shambler(Posted 2004) [#2]
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.


RifRaf(Posted 2004) [#3]
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


*(Posted 2004) [#4]
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).


Shambler(Posted 2004) [#5]
Yes, there is a DirectX 7 limit of 65535 vertices per surface.


Physt(Posted 2004) [#6]
http://blitzbasic.com/codearcs/codearcs.php?code=465