Hi,
I noticed something funny.
When rotating an object around its axis, if I setup a value of 45 it rotates 90 degrees, if I set 90 it rotates 180 and if I set 180 it rotates a full 360 degrees.
The documentation of setRotation() says:
"rotation: New rotation of the node in degrees.
So, am I doing something wrong or do we have 180 degree circles in Irrlicht??
180 degree circles ??
-
- Posts: 219
- Joined: Fri Feb 19, 2010 4:03 pm
- Location: Estonia
180 degree circles ??
Last edited by xirtamatrix on Thu Nov 18, 2010 7:55 pm, edited 1 time in total.
to live, is natural; to die, is not!
-
- Posts: 22
- Joined: Tue Nov 09, 2010 7:03 pm
- Location: ohiio
I'm new, 99% of my knowledgle is rotation 1% is fine dining
Post your code for the rotations.
Only after disaster can we be resurrected.
-
- Posts: 219
- Joined: Fri Feb 19, 2010 4:03 pm
- Location: Estonia
ok, sorry, normal nodes actually rotate correctly.
The said behaviour is only in the case when node is ELT_DIRECTIONAL and rotation is being applied to "direction". Still, I dont see why a directional light should be completing a full-circle in 180 degrees.
Can anyone just test it and confirm please?
No special code required, just do node->setRotation() on a directional light.
The said behaviour is only in the case when node is ELT_DIRECTIONAL and rotation is being applied to "direction". Still, I dont see why a directional light should be completing a full-circle in 180 degrees.
Can anyone just test it and confirm please?
No special code required, just do node->setRotation() on a directional light.
to live, is natural; to die, is not!
-
- Posts: 194
- Joined: Thu Mar 18, 2010 3:31 am
- Contact:
I haven't been able to figure out exactly how Irrlicht handles directional lights. I think when you set rotation, you're actually setting a directional vector. Like 'light->setRotation(0,0,1)' would be pointing down the Z axis. Or it could be that you're actually setting rotation. I dunno.
It might help if we could see how you are rotating it, posting your code wouldn't hurt anyway. We could see it fresh and maybe notice something new.
It might help if we could see how you are rotating it, posting your code wouldn't hurt anyway. We could see it fresh and maybe notice something new.
LazerBlade
When your mind is racing, make sure it's not racing in a circle.
3d game engine: http://sites.google.com/site/lazerbladegames/home/ray3d
lazerBlade blog: http://lazerbladegames.blogspot.com/
When your mind is racing, make sure it's not racing in a circle.
3d game engine: http://sites.google.com/site/lazerbladegames/home/ray3d
lazerBlade blog: http://lazerbladegames.blogspot.com/
-
- Posts: 219
- Joined: Fri Feb 19, 2010 4:03 pm
- Location: Estonia
The docs mention the following:lazerblade wrote: I think when you set rotation, you're actually setting a directional vector. Like 'light->setRotation(0,0,1)' would be pointing down the Z axis.
If the light type is directional or spot, the direction of the light source is defined by the rotation of the scene node (assuming (0,0,1) as the local direction of the light).
So what does the 1 in (0,0,1) stand for? Is it a directional vector or is it an angle in degrees?
If its a directional vector, does it mean 1 would be pointing to positive Z and -1 to negeative Z? That dont seem to be the case.
Can anyone with experience of it please explain?
There really isn't anything to show but ok, I could scribble down a few lines right here:lazerblade wrote:It might help if we could see how you are rotating it, posting your code wouldn't hurt anyway.
Code: Select all
ILightSceneNode *sun = smgr->addLightSceneNode(0, .....);
sun->setLightType(ELT_DIRECTIONAL);
//now rotate the light
Code: Select all
sun->setRotation(vector3df(0,45,0)); //rotate on Y axis
//rotate again
Code: Select all
sun->setRotation(vector3df(0,90,0)); //rotate on Y axis
and so on...
to live, is natural; to die, is not!
-
- Posts: 219
- Joined: Fri Feb 19, 2010 4:03 pm
- Location: Estonia
Thats all well, but it doesn't explain why does the light rotate 90 degree with a value of 45 and 180 degree with a value of 90 and 360 degree with a value of 180.hybrid wrote:And rotation of the node is applied to that vector in order to get the actual light direction.
It appears the value provided is getting doubled-up somehwere. I'd look at the SceneLightNode later and see if I find something.
to live, is natural; to die, is not!