Calculating augmented reality "local gravity". Bad idea?

norbykov
Posts: 1
Joined: Thu Jun 17, 2010 10:50 am

Calculating augmented reality "local gravity". Bad idea?

Post by norbykov »

Hi guys!

First of all, I'm a noob, don't bite my head off if I ask something stupid. But I'd rather ask something stupid than die not knowing the answer :)))

It may be more of a mathematical question... I use Bullet through osgBullet with an augmented reality game, and instead of using force, I'd like to change the gravity direction according to the marker position. The marker controls the movement of both a plane and a ball, and if I use the default downward gravity, the ball falls on the ground, and stays there no matter where I move the marker. I tried to move the ball outside the marker's control, but the augmented reality system uses such messed up coordinates that I can't even get the ball to fall on the plane, it's all over the place. So, I was thinking maybe I could calculate the gravity force based on the marker's rotation. The problem was illustrated by another guy with the same problem (in flash, but the basics are the same), like you can see in the attached image. What I need is the force pointing at the same direction globally even when the marker is rotated.
My first question would be: is this a bad idea? If not, is there a way to calculate the gravity (or force) this way?
My other question would be: is there a way to make gravity affect the position of the ball based not on it's position inside a node, but it's "global" position. I still need to move the ball with the marker, but it needs to roll in the direction of the marker rotation.

Thanks for your time, and if you could help, I'd really appriciate it.
You do not have the required permissions to view the files attached to this post.