|
-
Jul 16th, 2001, 08:38 AM
#1
Thread Starter
New Member
Conversion of 2D map to 3D
I need help with developing an algorithm for converting a 2D topographical map into a 3D surface. I want to use VB for doing that
Can anyone help me with it?
-
Jul 17th, 2001, 08:25 AM
#2
Retired VBF Adm1nistrator
Well you would need to store the height of each pixel somewhere/somehow. Probably the easiest way would just to have a seperate textfile/binary file that contains a list of values that are the heights of each pixel.
What is normally done however (eg. Voxel) is that there would be a second picture, and the colour of each pixel would decide the height of the pixel.
Then when you put the two pictures together, one picture for the colour of the terrain, and the other for the height, you get the 3D co-ordinates. So then all you have to do is plot it.
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jul 17th, 2001, 08:34 AM
#3
transcendental analytic
Do you need a voxel engine?
In case you just need an isometric projection, you nest loop trough each dimension and plot the pixel for each value at sum of each dimensions screen projections as 2d vectors. A simple elegant and fast projection would be x+y,x-y-z.
In case you need perspective, I've got a voxel engine laying around on my hdd.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 17th, 2001, 02:56 PM
#4
Frenzied Member
Hey, wouldn't it be cool to use that algorythm to detect if a point is inside a polygon so that a voxel engine supports polygon-based models?
-
Jul 17th, 2001, 04:41 PM
#5
transcendental analytic
Really? The hard part comes when voxel rendering has to be rendered at the same time as the polygons. I'm not even sure if there's hardware that supports that, although I think there is because i've seen games with polygons and voxel landscape.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 17th, 2001, 07:16 PM
#6
PowerPoster
Well voxelspace-accelerator cards are too expensive (and rare) but like in DeltaForce you can render voxels and polygons together. I'm not sure but I think they directly access the ZBuffer so the card cares about this problem...
-
Jul 20th, 2001, 06:55 PM
#7
Frenzied Member
If you're using true voxel, you won't need to draw polygons that way
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|