#### Archived

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

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

## Recommended Posts

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!

##### Share on other sites
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]

##### Share on other sites
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

##### Share on other sites
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

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

WhitespaceUnlimited

• ### Forum Statistics

• Total Topics
628642
• Total Posts
2983985

• 10
• 18
• 20
• 13
• 9