rotation problems

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
hell_bird
Posts: 18
Joined: Mon Nov 03, 2003 12:30 pm

rotation problems

Post by hell_bird »

I want a weapon to look in the sa´me direction as the camera... but i do not use a FPS-camera... is it possible to get the rotation of the camera?

if not: is it possible to rotate an object first around the x and z axis and then around the y?


i really need help. Is there another way to do this?
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

Yeah, it's possible to rotate the scene-node that the weapon is on.

Also, you can attach that scene node to the camera's node.


virtual IAnimatedMeshSceneNode* irr::scene::ISceneManager::addAnimatedMeshSceneNode ( IAnimatedMesh * mesh,
ISceneNode * parent = 0,
s32 id = -1,
const core::vector3df & position = core::vector3df(0, 0, 0),
const core::vector3df & rotation = core::vector3df(0, 0, 0),
const core::vector3df & scale = core::vector3df(1.0f, 1.0f, 1.0f)
) [pure virtual]


Specify the parent as the camera when you create it.
Crud, how do I do this again?
hell_bird
Posts: 18
Joined: Mon Nov 03, 2003 12:30 pm

Post by hell_bird »

it does not work: the weapon has the same position as the camera but not the same rotation

if i use camera->getRotation i get 0 ( i have v 4.1 ! )
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post by [dx/x]=HUNT3R »

It's probably just another bug in the FPS camera. The getPosition, setPosition, setTarget, and getTarget are all messed up too. I think that getTarget might do a getPosition though...
hell_bird
Posts: 18
Joined: Mon Nov 03, 2003 12:30 pm

Post by hell_bird »

i do not use a FPS-camera
:(
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post by [dx/x]=HUNT3R »

Yep my bad... I should read better. Well maybe the FPS's camera problems are coming from the base camera class if the other cameras have problems too...
Post Reply