Strange behavior of object and lamp during rotation
2 posters
Strange behavior of object and lamp during rotation
Greetings,
I love SIO2 by the way.
I have adapted Tutorial2, and have exported materials and also a lamp into the scene. Strangely, when the object is rotated in templateScreenTouchMove(), the model goes dark when rotated 180 degrees. It seems to be maybe a matrix problem.
Whats the best way to deal with this?
Thanks!! Kind regards,
-joshua
I love SIO2 by the way.
I have adapted Tutorial2, and have exported materials and also a lamp into the scene. Strangely, when the object is rotated in templateScreenTouchMove(), the model goes dark when rotated 180 degrees. It seems to be maybe a matrix problem.
Whats the best way to deal with this?
Thanks!! Kind regards,
-joshua
meteors- Posts : 241
Join date : 2008-11-08
Location : Sunny Florida
Re: Strange behavior of object and lamp during rotation
Please take a look at tutorial08 for how to use lighting in SIO2.
Re: Strange behavior of object and lamp during rotation
Hey :-)
If you replace the code in Tutorial02 with this:
// Enable GL_LIGTHING and setup the necessary
// state variables to render our objects with
// lights & materials applied.
sio2LampEnableLight();
{
sio2ResourceRender( sio2->_SIO2resource,
sio2->_SIO2window,
sio2->_SIO2camera );
SIO2object *_SIO2object = sio2ResourceGetObject( sio2->_SIO2resource,
"object/Sphere" );
_SIO2object->rot->z += 1.0f;
sio2ObjectBindMatrix( _SIO2object );
}
// Turn OFF the lights.
sio2LampResetLight();
You will see the problem I am talking about.
Thanks!!!!
-joshua
If you replace the code in Tutorial02 with this:
// Enable GL_LIGTHING and setup the necessary
// state variables to render our objects with
// lights & materials applied.
sio2LampEnableLight();
{
sio2ResourceRender( sio2->_SIO2resource,
sio2->_SIO2window,
sio2->_SIO2camera );
SIO2object *_SIO2object = sio2ResourceGetObject( sio2->_SIO2resource,
"object/Sphere" );
_SIO2object->rot->z += 1.0f;
sio2ObjectBindMatrix( _SIO2object );
}
// Turn OFF the lights.
sio2LampResetLight();
You will see the problem I am talking about.
Thanks!!!!
-joshua
meteors- Posts : 241
Join date : 2008-11-08
Location : Sunny Florida
Re: Strange behavior of object and lamp during rotation
But there is no light exported in tutorial02... What you are seeing is default lighting value of GL when lighting is ON... make sure you export some lights...
Re: Strange behavior of object and lamp during rotation
I did.
If you put this lamp in the scene you will see what I mean:
lamp( "lamp/Lamp")
{
pos( 4.076 1.005 5.904 )
dir( 0 0 -1 )
col( 1 1 1 )
nrg( 0.5 )
dst( 30.0 )
fov( 75 )
sblend( 0.15 )
att1( 0 )
att2( 1 )
}
If you put this lamp in the scene you will see what I mean:
lamp( "lamp/Lamp")
{
pos( 4.076 1.005 5.904 )
dir( 0 0 -1 )
col( 1 1 1 )
nrg( 0.5 )
dst( 30.0 )
fov( 75 )
sblend( 0.15 )
att1( 0 )
att2( 1 )
}
meteors- Posts : 241
Join date : 2008-11-08
Location : Sunny Florida
Re: Strange behavior of object and lamp during rotation
Ok, the answer to this problem is that I wasn't exporting normals =/
Thanks!!!
-joshua
Thanks!!!
-joshua
meteors- Posts : 241
Join date : 2008-11-08
Location : Sunny Florida
Similar topics
» New Object, Material, Camera, Lamp File Format
» Rotation of rolling object is zero.
» Lamp Support
» Quite strange question - how to exit sio manually?
» SIO2Widget area - getting some strange results..
» Rotation of rolling object is zero.
» Lamp Support
» Quite strange question - how to exit sio manually?
» SIO2Widget area - getting some strange results..
Permissions in this forum:
You cannot reply to topics in this forum