Page 1 of 1

camera rotation.. does camera has it's own coordiate system?

Posted: Mon Sep 28, 2009 3:09 am
by J.sean
hi all..

I'm having so much troble with camera rotation..

I put the camera behind my character.. and set the target position with the location of character... so far so good...

but when I want to rotate my camera regardless of the character, the problem comes up... sometimes it's jagging... sometimes go for wrong target..... I just can't understand... haha.. so frustrated.....


when I used DARK GDK, it was so easy to rotate camera along it's own axes... cause it provided camera's rotation with it's own axes... but.. with irrlicht... I can't find sucha function... nor I can't make one...


abyway.... bottom line is... I wanna make this kind of camera.. please check the link..... can you guys give me any clue????

http://pds16.egloos.com/pds/200909/10/5 ... Hiking.zip

Posted: Mon Sep 28, 2009 12:31 pm
by Alpha Omega
So just to clarify.. you are trying to rotate the camera around a center point. You would not use the rotation to do this....Use polar cooridinates for a circle and update the camera position.

Posted: Mon Sep 28, 2009 2:29 pm
by J.sean
yeah... you're right... I tried to use rotate function in vector.. and it didn't work as I wanted...

could you give me a little bit more hint please?? what kind of function should I use?? and.. what type?? vector? matrix??


ah... and you know.. the position of camera is fine.. once I put this on the back of character, it sticks there......

but the target of camera's problem... I think it uses absolute coordinate system.. (I mean absolute position).. it would be much easier if it used camera's own coordinate system, just like the position of camera...

Posted: Mon Sep 28, 2009 2:33 pm
by Alpha Omega
Ok so how did you fix the camera position? If you set it as a child of the character than any position or rotation changes will change RELATIVE to the parent. I still dont know what the problem is could you please clarify?

Posted: Mon Sep 28, 2009 3:59 pm
by J.sean
oh..

yeah.. the position of the camera is relative to its parent..

but target of camera is not relative to its parent...

it uses absolute position..

for example..... if the position of camera is (0, 0, 0), it means the position of it's parent... but if the position of target is (0, 0, 0), it means actually (0, 0, 0) of the world.. not relative to it's parent..

I don't understand why the position of target is using absolute coordinates.. not relative coordinates of its parent....

Re: camera rotation.. does camera has it's own coordiate sys

Posted: Mon Sep 28, 2009 8:19 pm
by Alpha Omega
I don't understand why the position of target is using absolute coordinates.. not relative coordinates of its parent....
getTarget() must be absolute because it defines a distinct area in 3 dimensional space. If it did not use absolute cooridinates then it would not function properly as in objects could be in the in different locations but have the same cooridinates.

Posted: Tue Sep 29, 2009 11:03 am
by J.sean
hmmm... yeah... thanks for reply.. I appreiate...

ugh.. but still can't make a camera like the link up there...

how can I rotate the camera that is child to character properly...??

it's killing me...

haha~ can anyone answer please?? ^^