Page 1 of 1

Relative Motion in Ogre3d

Posted: Mon Feb 07, 2005 9:51 pm
by DigitalGhost
Hey, I am new to ogre3d and I was wondering the easiest way to pull this off:

I want to make a very simple fighting game similar to Soul Caliber II. So, I want to have two models, and both of them move relative to the other one. So, if you hit left, your avatar will circle the enemy and vice versa.

It's possible to do this one-way by making one object the child of the other. The problem is that do to this both ways (IE, both avatars move relative ot ecah othre) would make circular children.

What's the easiest way to handle this?

Posted: Tue Feb 08, 2005 12:00 am
by PeterNewman
I'm guessing your going to have to do a bit of maths. Make each node the child of a common parent (or the root), and when your user hits left, get the vector from the other players character to the players character, rotate the vector appropriately, then use that as your movement (target).

Posted: Tue Feb 08, 2005 12:16 am
by Kencho
What about doing what it's supposed to do? Side step. Just move some units "in the direction of the camera" (towards the camera or not). As you move and update the position of the camera, the movement will be kind of circular (actually you'll move backwards slowly, but fixing that is as simple as advancing some units)

Posted: Mon Feb 14, 2005 8:59 pm
by DigitalGhost
Got it, thanks =)