Imagination PowerVR SDK Blog

Terrain Cursor


#1

Has anybody used FreeWorld3D (FreeWorld3D.org)?





It is a program with potential. Anyway the author uses a “cursor” that rolls over the terrain as you move it. The cursor is comprised of two circles, an inner-outer pair. The two circles follow the contour of the terrain pretty good.





I was wondering if anybody could tell me how the author accomplished this?





I wanted to include an image here, but I don’t know how (sorry).





Thanks in advance for your help,





Jerry



#2

There are many ways to do it … of the top of my head one would be to use projective texture mapping and another to have a hovering subdivided quad, manually updated on each frame to follow the ground shape.


#3

Warmi,





I thought about the texture approach too, but the “cursor” does not look like one.





And the “hovering quad” is basically the strategy I am employing now. However, sometimes the terrain is above the item I am rendering.





Basically I am looking for a surefire way of rendering vector data over topology. From what I observed with the “cursor” it seems to match exactly.






#4

http://freeworld3d.org/vegetation.gif





If you are talking about this circle then it is clearly s subdivided set of lines which is pretty much the same approach as with the hovering quad.



#5

That’s it.





And it does look like subdivided lines. Place the cursor farther back in that image where the slope is really varied, and it hugs the terrain pretty good.





When I was looking at it, the divisions are not necessarily are 1-to-1 match. Yet the cursor is never hidden by the terrain.



#6

That’s because they probably calculate exact slope ( and height) of the terrain at each end of line segment and adjust accordingly.


Given enough segments and a reasonable offset from the ground , you should never see clipping.