3D lighting + 3D Verlet Integration physics [Source]

Post your Construct-made creations!

Post » Fri Dec 31, 2010 5:54 pm

for lighting I used two edges of the cube as vectors per face found the cross product to get a 3rd vector that gave me the normal of the cubes face, and then found the dot product of that normal vector and an unchanging "light direction vector" (specified with the variables 'Lx' 'Ly' and 'Lz') that belong to the object L (L is just an object i use to store variables, because its faster to write L than global('etc') all the time), anyways, i find the dot product using the components of the two vectors, then i find the norm of those vectors with distance formula sqrt(x^2+y^2+z^2), the norm of the light is precomputed in the variable ('Ln'). with the norms and the dot product i can get the angle between the vectors that they form in their unique plane, by dividing the dot product by the product of the two norms, and then finding the arccosine of that value. the lighting from therein is just setting the filter of the face to a scaled value of that angle difference. R=G=B=('Anglebetween'/180)*255
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Fri Dec 31, 2010 6:19 pm

I understood completely though I don't know where I'll be using it for.

Still, thanks for explaining :)
B
9
S
3
G
3
Posts: 366
Reputation: 2,301

Post » Mon Jan 10, 2011 6:06 pm

What everyone else said. Beyond impressive! I won't go ahead and pretend that I do understand those events though... :wink:
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Mon Jan 10, 2011 10:13 pm

[quote="PixelRebirth":3ofq8uaf]What everyone else said. Beyond impressive! I won't go ahead and pretend that I do understand those events though... [/quote:3ofq8uaf]

nobody actually understood those events :wink:
btw I talking about the explanation about the lighting systems quazi gave, felt like clarifying :)
B
9
S
3
G
3
Posts: 366
Reputation: 2,301

Post » Tue Jan 11, 2011 2:55 pm

WTF Quazi, you gotta stop doing this. You're making us all look bad. Go finnish up a game or something else productive, and stop making me feel like a 4 year old.

The worst part is: You're good at the graphics-part as well.
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Sun May 22, 2011 12:07 am

I just stumbled upon this wonderful work of brilliance! :)
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sun May 22, 2011 10:59 am

You Sir, Are a genius.
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Sun May 22, 2011 9:01 pm

I didn't comment on this back then? You don't want to know what I thought back then as 99% was curse words! Still the same now. I can repeat one word though - "awesome"!
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Previous

Return to Your Creations

Who is online

Users browsing this forum: No registered users and 2 guests