Equation of a plane and normals + Decals

Member
Posts: 509
Joined: 2002.05
Post: #1
In my uDev entry I have decided to make roads a separate object on top of the height-map terrain. Right now I have a road that is in the correct X and Z position but the Y position is a constant 15. What I want to do while loading is take each vertex and keep their X and Z location but using the planes normal, find the Y location so the point is on the plane. How would I do this?

Also, once I get that fixed, should I add something like .02 to the roads height to make sure it is drawn instead of the terrain, or is their a better way to do that so the road is always drawn slightly above the terrain (I don't want them to merge together far away, which is what I am afraid might happen).
Quote this message in a reply
Simon Schoelly
Unregistered
 
Post: #2
Sounds like the same question I asked in the createmacgames forum: http://www.createmacgames.org/forum/viewtopic.php?t=161
Quote this message in a reply
Member
Posts: 509
Joined: 2002.05
Post: #3
Thanks! From belthaczar's post I have came up with this code

EDIT : Code removed because it was wrong, I will fix it now
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Rendering a reflection about an arbitrary plane TomorrowPlusX 3 4,486 Jan 14, 2008 07:51 AM
Last Post: TomorrowPlusX
  Decals on terrain, objects etc. IBethune 3 3,040 May 11, 2007 07:44 AM
Last Post: TomorrowPlusX
  pls help ....am in desperate need of code (illuminating equation) shru_ani 2 2,180 Oct 30, 2006 04:32 PM
Last Post: Najdorf
  Math: mirroring a view frustum about a plane TomorrowPlusX 1 3,120 Aug 19, 2006 03:30 PM
Last Post: Jones
  Drawing an Infinite Plane unknown 3 2,900 May 5, 2006 12:54 PM
Last Post: Zekaric