# Normals

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

## Recommended Posts

Hi, have a question :

How do i calculate normals for a plane ?

##### Share on other sites

Given a plane with the vertices A, B, C, D, you can calculate the normal by taking any two connection vectors between those vertices, like AB and AC. You normalize those vectors, take the cross product, and thats your normal (which you probably want to normalize again, I can't remember for sure if this product is of uniform length). Also note that the choice and ordering of vectors in the cross-product equation are not totally arbitrary, as you might get the normal in the wrong direction. In that case, instead of e.g. AB x AC you switch to AC x AB. I'd recommend to try it out until someone gets around to put those things into definitie place (I always have a hard time remembering the theories behind that math stuff...

EDIT: Since you posted in graphics theory, you did mean a plane with 4 vertices and not a mathematical plane given the equation f(x) = a*x + b*x + c*x + d; right?

Edited by Juliean

##### Share on other sites

Hi, i,m meaning a plane with 4 vertices, yes.

I need the normals for correct lighting.

Edited by the incredible smoker

##### Share on other sites

Those are called quads, not planes...

Ah, those damn math terms, gets me all the time. Though I'm pretty sure I remember having heard the term "plane" being used what is actually called a quad (in the context of graphics & programming), so twice the confusion! Seems I was right though due to OP, I quess good luck that I misread the term ;)

##### Share on other sites

You don't need to normalize the vectors before the cross product, the cross product will result in a vector in the normal direction of the plane anyway.

##### Share on other sites

Hi, thanks for all the help, let me make it simpler, maybe i understand it to then ?

Ok : i only rotate the plane/quad on 1 axis, else my collision detection algorithm does not work.

Maybe you guys can give now a simpler solution for me ?

Edited by the incredible smoker

##### Share on other sites

Ok : i only rotate the plane/quad on 1 axis, else my collision detection algorithm does not work.

So you mean that the quad is locked around a certain axis, so that it only rotates around that very axis? In that case, wouldn't that axis already be the normal? Unless I don't understand your setup.

##### Share on other sites

Yeah, i only use pitch or yaw or roll or whatever its called, no combination of these.

( not that i realy use rotation, i do place the vertices in the right spot ofcourse )

I cannot figure out the collision detection otherwise, but thats not the problem now.

Edited by the incredible smoker

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 9
• ### Forum Statistics

• Total Topics
634082
• Total Posts
3015401
×