
-----------------------------------
Homer_simpson
Mon Jul 21, 2003 7:59 pm

Calculating normals...
-----------------------------------
well since the site doesn't have a math section and this isn't a spam i'm gonna post it here...
now the question is how do i caculate the light normals for a triangle without using sine and cosine?!

-----------------------------------
Asok
Mon Jul 21, 2003 8:21 pm


-----------------------------------
use a calculator perhaps?

 :D

-----------------------------------
Catalyst
Mon Jul 21, 2003 11:24 pm


-----------------------------------
http://www.gamedev.net/reference/articles/article1682.asp

this should explain it all (well per-polygon lighting)

-----------------------------------
PaddyLong
Tue Jul 22, 2003 2:52 am


-----------------------------------
dunno if this will help, but the cross product will give you a vector that is perpendicular to the two vectors you're doing it with

to use the cross product do this...

get two direction vectors for your plane (take three points that land on it, then just subtract x, y and z values to give you two direction vectors)

then when you have your two direction vectors.. let's say (i1, j1, k1) and (i2, j2, k2)

do this (it's kinda funny... but works)

write out the vectors twice each like this...
i1 j1 k1 i1 j1 k1
i2 j2 k2 i2 j2 k2

then you multiply j1 by k2 and subtract k1 * j2 from it... this is the i for your normal vector
they go like this..
i = j1k2 - k1j2
j = k1i2 - i1k2
k = i1j2 - j1i2

if you didn't catch it, the reason you write out the vectors (when you're doing it by hand or whatever) is to use for a guide for what to multiply .. and just remember multipolications going \ are positive and multiplications going / are negative


or use the link Catalyst gave :P  depends how much work you wanna do :P  even though it looks like they are using exactly what I explained hehe
