Page 1 of 2

camera rotation problem

Posted: Sun Nov 04, 2007 10:28 am
by kkray
i want to use png-texture with transparent and semi-transparent zone for billboard and cube nodes?
if i use only:
video::ITexture *frame0=driver->getTexture("media/car.png");
billboard->setColor(video::SColor(255,255,255,255),video::SColor(255,255,255,255));
billboard->setMaterialFlag(video::EMF_LIGHTING, false);
billboard->setMaterialTexture(0,frame0);

then trasparent zone drawed by black color =(

what can i do for solve this "problem" ?

Posted: Sun Nov 04, 2007 10:43 am
by hybrid
You have to change the material type to EMT_TRANSPARENT_ALPHA_CHANNEL

Posted: Sun Nov 04, 2007 11:11 am
by kkray
thanks!!

maybe you now, how i can rotate (not animate) camera around it self (if player in game bend his head on side)?

i use this code:
scene::ICameraSceneNode *camera = smgr->addCameraSceneNode(smgr->getRootSceneNode(),core::vector3df(100,100,100),core::vector3df(0,0,0),-1);
camera->setRotation(core::vector3df(45,45,45));

but result of last string working is equal to result of this string working:
camera->setRotation(core::vector3df(0,0,0));

why?

Posted: Mon Nov 05, 2007 9:01 am
by WarShattrith
Same thing for me !

Posted: Mon Nov 05, 2007 9:49 am
by hybrid
Because camera has separate rotation and lookat target. You have to change the looking direction of the camera. Read the API and check the tutorials.

Posted: Mon Nov 05, 2007 5:32 pm
by kkray
thanks!

Posted: Mon Nov 05, 2007 9:40 pm
by sepi
Hi irr-comunity,I have same kind of problem.
I try to flip camera, but then I flip it, my mouse become inverted. In my opinion it is not right, because if camera is like my eys and if I stand on my head my left side is still on my left and my rightside on my right.

Here is code:

Code: Select all

scene::ICameraSceneNode* camera = 
		smgr->addCameraSceneNodeFPS();
camera->setUpVector(core::vector3df(0,-1,0));

Posted: Sat Nov 10, 2007 6:01 pm
by christianclavet
Hi. Sepi.

I've asked for this some time ago. But the mouse controller is not oriented with the UPVector of the camera.

That is a feature that will need to be implemented. For some things it's good that the mouse is not totally following the axis of the camera (head tilt) But if you would like to walk in a ceiling or walls, there need to be a new camera controller that support this (remapping the X-Y mouse coordinate plane into the X,Y,Z of the world.)

At the moment, if you really want to do this, you will have to use the standard camera and create your own controller.

I know that Bitplane is working on camera controller but don't know if we will able to do this. Since my current skills for C++ and math are not good enough, I'm still waiting.

Posted: Sat Nov 17, 2007 7:12 am
by kornwaretm
i'm not sure, i'm experiencing the same problem with u. first time in irrlicht i'm confused with the coordinate system, because i can rotate the camera all the way. and in my case i use blender to export my models and when loaded. i got to rotate the camera in order to make my model in the correct perspective. when i use the FPS camera i realize that what i did is wrong because when move i got wrong direction to move. so try not to transform the camera but rotate the model. hope this help :oops:

Posted: Sat Nov 17, 2007 9:08 pm
by christianclavet
Yes, I tought about that idea. Rotate the environnement instead of the player. It should work. But you will have to build(parent) you scene based on a specific node and rotate that node (so all objects will positionned exacltly the same)

Irrlicht has a global coordinate system. Software like Blender can use multiples coordinate system.

Global - X,Y,Z for the entire world
(Depending on the system, for Lightwave for example, X is for the horizontal axis, Y is for the vertical axis and Z is for the depth axis)

Local - X,Y,Z aligned on the current object(node) aligment.
Quick and simple example: Camera is "parented" to a box and looking 45 degree. The box is rotated 45 degree, so in local axis the camera is at 45 degree but for the global axis it's 90 degree.

Not sure IRRlicht as function to convert for a coordinate system to another.

Posted: Sat Nov 17, 2007 11:48 pm
by hybrid
Irrlicht also uses relative positions for child scene nodes.

Posted: Tue Nov 20, 2007 9:30 am
by kornwaretm
relative position? did u mean if i transform(rot,scale,trans) the node before attach to parent will not affect the parent?

Posted: Sat Nov 24, 2007 9:49 pm
by humbrol

Code: Select all

188 C:\irrlicht\main.cpp 'class irr::scene::ISceneNode' has no member named 'setUpVector' 
when i run

Code: Select all

cam->setUpVector(core::vector3df(0,-1,0));

Posted: Sun Nov 25, 2007 1:16 am
by vitek
188 C:\irrlicht\main.cpp 'class irr::scene::ISceneNode' has no member named 'setUpVector'
That is because the type of cam is ISceneNode*, but it needs to be ICameraSceneNode*. The code posted by sepi is more like what you need.
relative position? did u mean if i transform(rot,scale,trans) the node before attach to parent will not affect the parent?
The position of the child never has any effect on the parent. The position of the parent will affect the position of the child though. It doesn't matter when you change the position though, the effect is the same. The position of the child is always relative to the parent.

Travis

Posted: Sun Nov 25, 2007 1:40 am
by humbrol
do you have a link, not pulling sepi up under authors on search