Quad Height Thingy

Started by
2 comments, last by AdmiralBinary 21 years, 11 months ago
Just a quick (and simple, I hope) question: Given four vertices and an x/y coordinate somewhere inside them, what would it take to figure out the altitude at that point? --------------- #define TRUE 0 #define FALSE 1 //MUAHAHAHAHAAAA!
Advertisement
I'm not very sure, but first, get the normal of the plane the quad is on and then normalize it. Then do the dot product between the normal and vector between the Point and one of the four vertices of the quad.
( N=normal, P=Point, V=One of the four vertices) Altitude = dotp( N , P-V ).

[edited by - Strange Monkey on May 4, 2002 10:13:30 AM]
François DagenaisDagenais.f@videotron.ca
I''m not sure that StrangeMonkey''s method works, but here is what I''d do (I hope it''s not the same thing he said): find the normal of the quad:

Normal = (A, B, C)

and plug it into the plane equation

Ax + By + Cz + D = 0

plug a (x,y,z) triple that''s part of the plane (any of the four vertices) to find D

D = -Ax - By - Cz

Then isolate y

Altitude = y = (-Ax - Cz - D) / B

It should be pretty fast (you don''t have to normalize anything), but I''m sure there is room for improvement.

Cédric
Wassup !!!... wow Tim you got some replies, finally.
At the moment, when you move... you kinda appear "jump" to the nearest poly, kinda not good looking..

I know this, because If it wasnt for my ideas he wouldnt have this obstacle

--------------------------------

Lead Design, Lead Artist
WhitespaceUnlimited
Where have I been ?

This topic is closed to new replies.

Advertisement