# Getting normal of a plane

## Recommended Posts

Hello everyone!

First post! I have been playing around with bablyon (you can guess, I am not a pro graphics programmer) and the first issue I bumped into is: is there a simple way to get the normal of a surface?

If not, I was thinking on using the following to calculate the normal of a plane.

`P---Q|   |R---T`

Take (P-T) × (Q-R). Basically have the cross product of the plane's diagonals.

Is it at all a good solution? Is there a better or simpler way to do this?

Thanks

##### Share on other sites

Welcome You are right. Just do the following:

`var v1v2 = Q.subtract(P);var v2v3 = T.subtract(Q);var normal = BABYLON.Vector3.Cross(v1v2, v2v3);`
##### Share on other sites

• 5 months later...

So I have exact four corner points of plane mesh.  (Not just any point on plane mesh . But real corner points) . Assume P,Q,R,T

Resulting normal from both of follow code block A  and code block B   is different. Why is it so ?

CODE BLOCK A :

`var v1v2 = P.subtract(T);var v2v3 = Q.subtract(R);var normal = BABYLON.Vector3.Cross(v1v2, v2v3);`

CODE BLOCK B :

`var v1v2 = Q.subtract(P);var v2v3 = T.subtract(R);var normal = BABYLON.Vector3.Cross(v1v2, v2v3);`

In case of BLOCK B I get normal = (0,0,0)

Am I being dumb here ?

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible. ×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.