Basic Camera Without Target
-
- Posts: 4
- Joined: Fri Jun 03, 2011 8:07 pm
Basic Camera Without Target
I have searched around for basic camera without target, but no simple solution found.
I have a camerascenenode added.
Now I want to be able to change the camera position, without camera changing angle...
Is cos sin and similar calculations really needed to rotate camera and move locally???
If so, how?
I have a camerascenenode added.
Now I want to be able to change the camera position, without camera changing angle...
Is cos sin and similar calculations really needed to rotate camera and move locally???
If so, how?
-
- Posts: 20
- Joined: Sun Jan 04, 2009 2:47 pm
- Location: Brazil
-
- Posts: 4
- Joined: Fri Jun 03, 2011 8:07 pm
-
- Posts: 20
- Joined: Sun Jan 04, 2009 2:47 pm
- Location: Brazil
If you know where the camera is supposed to look at, then you know the target. Whatever is changing the camera position can also change its target.
If the camera is translating because its parent is translating, then you can use its parent's transformation to set the target vector.
I can't imagine a scenario where you wouldn't be able to change the target.
If the camera is translating because its parent is translating, then you can use its parent's transformation to set the target vector.
I can't imagine a scenario where you wouldn't be able to change the target.
Obey.
-
- Posts: 4
- Joined: Fri Jun 03, 2011 8:07 pm
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
-
- Posts: 4
- Joined: Fri Jun 03, 2011 8:07 pm
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
So I assume you want to be spoon-fed code (why do any trouble yourself when you can just wait until someone else spoon-feeds you?), while we hold your hand explaining every line character by character right?IrrlichtUserNumber1 wrote:Very helpful post...
That makes it so clear!
As stated before: Your position gets updated, if you want your target to stay at a constant relative offset from your position you just move your target with the same vector as your position was moved with
If that's still too hard, please don't get an attitude towards us and do your homework
you can also try
and
each frame or when the camera moves.
Code: Select all
camera->bindTargetAndRotation(true);
Code: Select all
camera->setRotation(startingAngle);
-
- Posts: 363
- Joined: Thu Dec 16, 2010 8:50 pm
- Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..
That doesn't solve the problem. You will still need to update target properly to get proper transform for the camera.Xaryl wrote:you can also try
andCode: Select all
camera->bindTargetAndRotation(true);
each frame or when the camera moves.Code: Select all
camera->setRotation(startingAngle);
I think OP is thinking of the irrlicht camera as a higher level camera like those in maya, blender etc. The fact of the matter is irrlicht provides an _easier_ abstraction to backends like opengl and d3d. In those environments there isn't a "camera", you have to define a viewspace, using those three essential vectors, up right and at/lookat/forward.
OP, getting the results you want is a simple matter using techniques described to you already. You can also look at the FPS and maya camera animator source files to see how those do it.
ent1ty wrote: success is a matter of concentration and desire
at a cost measure in computer resourcesButler Lampson wrote: all problems in Computer Science can be solved by another level of indirection
No offence, maybe I am just too sleepy, but that almost feels like a troll post.
However, I will give you the benefit of the doubt and respond.
Of course, if I am wrong, please explain a little more, I sincerely would like to know my mistakes.
However, I will give you the benefit of the doubt and respond.
Isn't that the point of binding rotation and target?ChaiRuiPeng wrote:You will still need to update target properly to get proper transform for the camera.
Of course, if I am wrong, please explain a little more, I sincerely would like to know my mistakes.
I am not really sure how that is inferred from...ChaiRuiPeng wrote:I think OP is thinking of the irrlicht camera as a higher level camera like those in maya, blender etc.
andIrrlichtUserNumber1 wrote:Now I want to be able to change the camera position, without camera changing angle...
IrrlichtUserNumber1 wrote:I just want the camera to start at 90 degrees or 0.
Then when I move camera up or left the camera should still look straight ahead.
That call binds rotation to target, but not target to rotation. Yeah, it's incorrectly named.
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
-
- Posts: 2
- Joined: Sat Jun 04, 2011 2:05 pm
Radikalizm...
Sorry I am not at the level of excellence that you obviously must be, referring to yourself as "we".
It is not a matter of being spoon feed code, I wrote this post because I could not solve the problem I had or did not fully understand the answers.
I have searched around the forum and web like I wrote and the reason I posted replies was because I did not get any response that solved my problem or any link to where it was solved.
I have tried binding target and rotation and I am then able to control rotation of camera, but my problem is that when camera position changes camera rotates to keep looking at target.
I wanted some tips if the need to settarget each time camera moved was the way to go or if I was missing something.
There is a reason why I am posting in beginners thread.
Hope you can just ignore my incompetence.
Great to be regarded as a troll, when needing some help.
But also thanks to those who actually gave me some useful advice.
Sorry I am not at the level of excellence that you obviously must be, referring to yourself as "we".
It is not a matter of being spoon feed code, I wrote this post because I could not solve the problem I had or did not fully understand the answers.
I have searched around the forum and web like I wrote and the reason I posted replies was because I did not get any response that solved my problem or any link to where it was solved.
I have tried binding target and rotation and I am then able to control rotation of camera, but my problem is that when camera position changes camera rotates to keep looking at target.
I wanted some tips if the need to settarget each time camera moved was the way to go or if I was missing something.
There is a reason why I am posting in beginners thread.
Hope you can just ignore my incompetence.
Great to be regarded as a troll, when needing some help.
But also thanks to those who actually gave me some useful advice.
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
It is not a matter of you being a beginner or a matter of not being familiar with all the concepts, everyone is a beginner at some point
It is however a matter of you being given a clear answer to your problem twice which you just completely ignored after which you gave a snappy and arrogant reply
If you do not understand the advice given to you, then don't wait around and get an attitude until someone simplifies it for you, I would have gladly helped you out more if you would have said "Ok, and how would I go about updating my target based on that position transformation then exactly?", that is a valid and good question, ignoring any help you have been given and becoming arrogant however is not going to get you any further
It is however a matter of you being given a clear answer to your problem twice which you just completely ignored after which you gave a snappy and arrogant reply
If you do not understand the advice given to you, then don't wait around and get an attitude until someone simplifies it for you, I would have gladly helped you out more if you would have said "Ok, and how would I go about updating my target based on that position transformation then exactly?", that is a valid and good question, ignoring any help you have been given and becoming arrogant however is not going to get you any further
-
- Posts: 363
- Joined: Thu Dec 16, 2010 8:50 pm
- Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..
@Xaryl
That does not solve the problem because it is ROTATION. NOT TRANSLATION. IIRC the at target is in global coords, so it is not enough to simply use bind target to rotation.
Again, I highly suggest OP looking at the source for some of the other cameras like maya and FPS camera. I don't know why you would think this is a troll post, if you haven't noticed we don't really tolerate that kind of stuff here.
That does not solve the problem because it is ROTATION. NOT TRANSLATION. IIRC the at target is in global coords, so it is not enough to simply use bind target to rotation.
Again, I highly suggest OP looking at the source for some of the other cameras like maya and FPS camera. I don't know why you would think this is a troll post, if you haven't noticed we don't really tolerate that kind of stuff here.
ent1ty wrote: success is a matter of concentration and desire
at a cost measure in computer resourcesButler Lampson wrote: all problems in Computer Science can be solved by another level of indirection