Calculating normals...
Author |
Message |
Homer_simpson
|
Posted: Mon Jul 21, 2003 7:59 pm Post subject: 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?! |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Asok
|
Posted: Mon Jul 21, 2003 8:21 pm Post subject: (No subject) |
|
|
use a calculator perhaps?
|
|
|
|
|
|
Catalyst
|
|
|
|
|
PaddyLong
|
Posted: Tue Jul 22, 2003 2:52 am Post subject: (No subject) |
|
|
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 depends how much work you wanna do even though it looks like they are using exactly what I explained hehe |
|
|
|
|
|
|
|