ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperLicht
forum topic indicator Camera rotation
person icon
zexx
Registered User
Quote
2010-09-16 20:17:20

Hi, it's me again :)

Setting the camera target is great when you wish to track an object, but what if you wish a dumb horizontal / vertical rotation? I tried setting the camera Rot vector, with no result.

Is there a function to simply rotate camera, so that target is repositioned automatically?

Or is there a general vector function that rotates one Vect3D around another Vect3D (that serves as a center)?

person icon
niko
Moderator
Quote
2010-09-17 11:45:47

Vect3D has several functions for getting a direction from a rotation.
You also could simply set the rotation into a matrix (setRotationDegrees()) and transform a vector (like 0,0,1) with it.

Another way would be to use your own camera matrix, if you want to go low level: Simply derive your own class from the CameraScene node and override the render() function, or modify the camera in your scene to change it's render function to be this:


MySceneNode.prototype.render = function(renderer)
{
// call base function
Camera.prototype.render.call(this, renderer);

// set your own render projection
renderer.setProjection(yourProjectionMatrix);
renderer.setView(yourViewMatrix);
}


person icon
zexx
Registered User
Quote
2010-10-09 09:30:26

Thanks for the code. I'll probably rotate a vector.

It's a bit misleading that Camera.Rot has no effect whatsoever. Setting it produces no changes in the camera node.


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |