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

This forum is currently in read-only mode.
  • Another random programming test. 3D physics using verlet integration, and 3D lighting using vectors cross products to find normals and vector dot products to find angular differences.

    Controls are mouse click and mouse wheel to manipulate.

    <img src="http://dl.dropbox.com/u/1010927/verlet%20cube.png">

    http://dl.dropbox.com/u/1010927/Verlet%20Cube.cap

    sometimes the normals flip because my physics implementation doesn't iterate for increased stability/accuracy

  • Dude... seriously. Very cool!

  • Brilliant!

  • man, how can you come up with such stuff so quickly? brilliant!

    some questions though-

    I too know quite a bit about vectors but still have no idea about how to use them for lighting, any articles for help??

    Meanwhile i'll search for verlet integration

  • seriously impressive

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Very impressive.

    Might I suggest you try turning this into a plugin once you have the dev system setup.

  • seriously impressive

    Indeed, frame rate is pretty much constant, even at 8x multisampling.

  • Doing something like this with events as a finger exercise - I bow deep to your wit.

  • HOLY (BEEP) ON A (BEEP) SANDVICH

    This is freaking awesome! The things you can do with Construct are absolutely incredible! Man...

  • 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

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

    Still, thanks for explaining

  • What everyone else said. Beyond impressive! I won't go ahead and pretend that I do understand those events though...

  • What everyone else said. Beyond impressive! I won't go ahead and pretend that I do understand those events though...

    nobody actually understood those events

    btw I talking about the explanation about the lighting systems quazi gave, felt like clarifying

  • 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.

  • I just stumbled upon this wonderful work of brilliance!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)