Skip to main content
gamedev.net
🔒 Locked

Planes

Started by ShlomiSteinberg May 3, 2003 at 1:50 PM 13 replies 800+ views
Original Post
ShlomiSteinberg
ShlomiSteinberg
I''ve asked this question ones but I didn''t get any good answer. I have a plane - a triangle, and I know the coordinates of it''s vertices. How do I found the Y (Height) of any given x,z on this plane? Sorry for my English. Thanks.
Member of the Shove Pouya Off A Cliff club, SPOAC. (If you wish to join, add this line to your signature.)Member of "Un-Ban nes8bit" association, UNA (to join put this in your sig)
JuNC
JuNC
Extract the plane equation:

ax + by + cz + d = 0

Rearrange:

y = (- d - ax - cz) / b

To get the plane eqn:

(v1,v2,v3 is triangle verts)

e1 = v2 - v1
e2 = v3 - v1

normal = normalize( cross(e1,e2) )

where cross takes two vectors and returns the cross product, normalize takes a vector and returns the normalized (unit) version.

then in the above equation:

a = normal.x
b = normal.y
c = normal.z
d = -dot(normal,v1)

blizzard999
blizzard999
quote:
Original post by JuNC
...
normal = normalize( cross(e1,e2) )
...
a = normal.x
b = normal.y
c = normal.z
d = -dot(normal,v1)




Right! However you dont need do normalize the normal if you dont need the ''normal'' explicitly (ie.: light).

So, given 3 points P0, P1, P2
simply
vector3 normal = (P2-P0)^(P1-P0) = (a, b, c)
and float d = - normal * P0

-> y = -(a*x + c*z + d)/b




Daivuk
Daivuk
guys, dont talk so complicated. If he ask this question, its probably he dont know VECTOR ALGEBRA.

What you want to do is to find intersection point between a plane and a line?
blizzard999
blizzard999
quote:
Original post by Daivuk
guys, dont talk so complicated.



If someone find this math complicated...leave 3D graphics...it''s better! I''ve studied these topics at school when I was 14...(a lot of time ago... )

quote:

What you want to do is to find intersection point between a plane and a line?


No!


Daivuk
Daivuk
14 ?!!!!!!!?
Damn, where did you go at school??
Me I learned it at 19 at college.
long time ago too
ShlomiSteinberg
ShlomiSteinberg
quote:
Original post by Daivuk
guys, dont talk so complicated. If he ask this question, its probably he dont know VECTOR ALGEBRA.

What you want to do is to find intersection point between a plane and a line?



I understood what he was saying and I have already done something similiar. My mistake was using "-" instead of "+" so I have solved my problem.
Thank you.
Member of the Shove Pouya Off A Cliff club, SPOAC. (If you wish to join, add this line to your signature.)Member of "Un-Ban nes8bit" association, UNA (to join put this in your sig)
ShlomiSteinberg
ShlomiSteinberg
quote:
Original post by blizzard999

If someone find this math complicated...leave 3D graphics...it''s better! I''ve studied these topics at school when I was 14...(a lot of time ago... )





I have studied it at the age of 13 by myself. :D
Member of the Shove Pouya Off A Cliff club, SPOAC. (If you wish to join, add this line to your signature.)Member of "Un-Ban nes8bit" association, UNA (to join put this in your sig)
blizzard999
blizzard999
quote:

I have studied it at the age of 13 by myself. :D



I was obliged of course...at 13 I had other things in my head

Seriously...geometry is a lot simpler than linear algebra or other ''math topics''
Daivuk
Daivuk
Where are you from guys?
In your country you study linear algebra at 13 - 14 years old!!!
I''m from quebec(canada), and I studied this only in "cegep" we call here. (college, after high school).
At level 12 of school I have learned linear algebra....18years old. me I was 19...
I thinked that my country was good for school, but now... lol
ShlomiSteinberg
ShlomiSteinberg
I''m from Israel but in our school we learn this at the 11th class or 12th class (I don''t know I''m in 9th class )
Member of the Shove Pouya Off A Cliff club, SPOAC. (If you wish to join, add this line to your signature.)Member of "Un-Ban nes8bit" association, UNA (to join put this in your sig)
blizzard999
blizzard999
quote:
Where are you from guys?


From Italy.
Although I've studied in a 'standard' public school ('high school' I presume) the course was advanced for us (I had to re-study the matter during the summer ...
I'm sure that linear algebra, analitic geometry and fundamental of computer science is too much in one year for 14 years old guys...but in that year I started to appreciate (a little) math and geometry.
So dont think this is a standard in Italy...


[edited by - blizzard999 on May 5, 2003 5:40:58 AM]
Mihail121
Mihail121
Better believe Blizzard.I''m from Bulgaria and the guys here are crazy too.When i was at 16(i think) they gaves us to learn basics of NUCLEAR physiks and chemistry stuff(like electrolit disossiation) that is learn in college normally.I don''t wanna talk for the math.Maybe they shoudn''t give so much to learn to kids.It''s brain busting

The PAIN is coming...this summer!!!In cinemas everywhere.
Daivuk
Daivuk
oh, so I''m normal. hehe
I learned it at 12th
ok, like you.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.