Relative Motion in Ogre3d

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
DigitalGhost
Halfling
Posts: 62
Joined: Mon Feb 07, 2005 9:47 pm
Contact:

Relative Motion in Ogre3d

Post by DigitalGhost » Mon Feb 07, 2005 9:51 pm

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?
0 x

User avatar
PeterNewman
Greenskin
Posts: 128
Joined: Mon Jun 21, 2004 2:34 am
Location: Victoria, Australia
Contact:

Post by PeterNewman » Tue Feb 08, 2005 12:00 am

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).
0 x

User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 1
Contact:

Post by Kencho » Tue Feb 08, 2005 12:16 am

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)
0 x
Image

DigitalGhost
Halfling
Posts: 62
Joined: Mon Feb 07, 2005 9:47 pm
Contact:

Post by DigitalGhost » Mon Feb 14, 2005 8:59 pm

Got it, thanks =)
0 x

Post Reply