camera target

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
VC

camera target

Post by VC »

Hi,

I have recently come back to an old Irrlicht project i mest up a while back, ive progressed a little and cleared my errors...

my problem now is that i have a camerascenenode which has a parent animatedmeshscenenode...i dont understand this fixing the target thing addCameraSceneNode because it quite literally fixes my target...i mean, when i rotate my animated mesh scene node the camera's position rotates around the mesh but its view is fixed on the point i set it at...

is something wrong? or do i need to work out the target based on the mesh's rotation somehow (*shrugs*) everytime the mesh rotates?

an please dont mention the fpscamera because we dont like each other :D
blayde
Posts: 45
Joined: Fri Jul 16, 2004 12:49 pm
Contact:

Post by blayde »

i find it hard to understand what you said, maybe i need a coffee ;)

your saying that the cameras position relative to it's parent model is correct : if you move the model the camera position changes as expected. but the camare is always looking at a certain point, no matter its' location ?

if that is the case then my guess is; yes you will have to add code to handle that. the easiest way would be to have "camera rotation = model rotation" every time the model moves. and i wouldn't use set target if it's possible.

i dont know how the model is getting moved though, if it's automatic through irr' then keymaps are likely involved. if so hunt them down in the api to find out what you need to change / access.
Guest

Post by Guest »

yeah that is how it is...the camera rotates around the model but remains lookin in a set direction...I think i have to use the target because its a param in the addcamera function :( an the model is moving because i dont some code to rotate it when i right clicked. :cry:
blayde
Posts: 45
Joined: Fri Jul 16, 2004 12:49 pm
Contact:

Post by blayde »

try setting the target argument to 0
as long as you set the rotation and position ok then logic says that should be fine.

i don't have my code handy atm though, so i can't give you more info, sorry.
Guest

Post by Guest »

Well id say you have to update the look at target of the cameraSceneNode, best way is to figure out what the IANimatedMeshSceneNode is facing and use that.
Post Reply