Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Calculating normals...
Index -> General Discussion
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Homer_simpson




PostPosted: 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
Sponsor
sponsor
Asok




PostPosted: Mon Jul 21, 2003 8:21 pm   Post subject: (No subject)

use a calculator perhaps?

Very Happy
Catalyst




PostPosted: Mon Jul 21, 2003 11:24 pm   Post subject: (No subject)

http://www.gamedev.net/reference/articles/article1682.asp

this should explain it all (well per-polygon lighting)
PaddyLong




PostPosted: 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 Razz depends how much work you wanna do Razz even though it looks like they are using exactly what I explained hehe
Display posts from previous:   
   Index -> General Discussion
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: