Archived

This topic is now archived and is closed to further replies.

Voxel terrain rendering

This topic is 5141 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I read both flipcode.com articles about this and I feel still way too unclear about that topic. I only understood that I''ve to somehow cast an ray in 2D from my eye position into the terrain and check for the highest pixel of my heightmap hit by my ray. I''d need an very simple explanation/tutorial about this, maybe you could help me out a little bit?

Share this post


Link to post
Share on other sites
Can I proposed a simple algorithm ?

The perspective projection formula are:

Xs = (focale*X)/Z;
Ys = (focale*Y)/Z;
where:
(Xs;Ys) is a screen point
(X;Y;Z) is the ascociated space point
focale is a constant (180 for exemple)

Do a loop on the Z between a little value to a big one (not necessarily linear progression)
Do a loop on the Xs. With that (Z and XS) you can find X.

Now you have the height map coordinate: heightmap(X;Z).
This map give you the Y and you can find Ys. Trace a vertical line between Ys and MaxYs: that give a good effect. You can now easily do a depth buffer that allow you to clip the hiden zones.
This buffer have only MaxXs length. I let you to find how you can do that

!o)

[edited by - Chuck3d on November 14, 2003 3:35:38 PM]

Share this post


Link to post
Share on other sites