Negative gravity to fall? Demos have pos?

Jun 27, 2007 at 3:17 AM
Hello,

As seen in my previous threads, I have been enjoying this engine!. The odd thing is, your demos work great, so I must be doing something wrong. The first and foremost thing is I must set the Y gravity to a negative number for things to fall. This makes sense to me as I want things to fall down (-Y). I thought at first perhaps your demos were set to have a -Y going up for some reason, but it doesn't seem so, and the gravity is always a positive number for Y for them. Is this right? Or am I missing something? Thanks!
Coordinator
Jun 28, 2007 at 7:12 PM
Yes, +y is down.

I chose to do it that way as that is how most screen coordinates work that I've come accross. Even XNA has +y going down.

I know it's different than the physics text books, but it made more sense to keep things the same as XNA. Also, even though the variable is called "gravity" it's a vector so it's really just a constant force in some direction.. not necassarily down.

Coordinator
Jun 28, 2007 at 7:24 PM
Come to think of it, x and y in the physics engine are somewhat arbitrary. They only take on a sense of up/down and left/right when you map them to some "real" coordinate system like the screen, or a plane in a 3D rendered world....
Jul 1, 2007 at 4:44 PM
Ok, I see the confusion. I am hooking your engine up to 3D graphics, where +Y is up by default (unless you set the projection matrices different, etc). I wasn't thinking in terms of 2D and screen coords.