Tag Info

New answers tagged

2

glRotatef and glTranslatef are old functions meant for use with the fixed-function pipeline, so they don't work with opengl 4 shaders. Instead you need to create a matrix, send it to your shader, and multiply your vertices by it when setting gl_Position. The exact process will probably be covered in one of the following tutorials on that site, so I'd ...


0

Generally, whether you rotate around "local Y" or "world Y" depends on the order you apply the rotations. If you're "free flying", then your variable ry no longer has a specific meaning, because all the moves are cumulative. You can keep a matrix, and apply successive rotations and translations to it to fly around. After a long while, there can be ...


0

Quaternion.LookRotation(forward, up) has a nifty property: it rotates z+ exactly to forward it rotates y+ as close as possible to up (given the constraint on z+) (You might not be used to up, since it silently defaults to (0, 1, 0) if you leave this parameter out) What we want here (and this comes up pretty often) is the reverse: we want y+ controlled ...


2

You're in luck. I did a full translation of Randy Gaul's 2D physics engine into C# and XNA. He hasn't really explained things well for beginners like me. For your answer, you should just multiply the cross product with the inverse of the inertia of the body. This is from my translation: angularVelocity += inverseInertia * Vector2D.Cross(contactVector, ...


3

Whatever collision be, angular momentum is conserved. ie Iw = constant with the coefficient of restitution (in translation, i dont know if its said the same in rotation) u define, and with the moment of inertia, you should be able to figure it out. And i think this would similar to collisions in 1D, since only one axis is used :) Goodluck :)


3

There are a couple ways. This way shows how you can do it at runtime by grabbing out all the vertices to build the BoundingBox around the model. The first answer on this page is super old but the basic idea applies to use a custom processor for your model in the content pipeline so you can compute the BoundingBox and store it in the Tag property of the ...



Top 50 recent answers are included