FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Strange behavior of object and lamp during rotation

2 posters

Go down

Strange behavior of object and lamp during rotation Empty Strange behavior of object and lamp during rotation

Post  meteors Sat Nov 15, 2008 6:11 am

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
meteors
meteors

Posts : 241
Join date : 2008-11-08
Location : Sunny Florida

Back to top Go down

Strange behavior of object and lamp during rotation Empty Re: Strange behavior of object and lamp during rotation

Post  sio2interactive Sat Nov 15, 2008 4:04 pm

Please take a look at tutorial08 for how to use lighting in SIO2.
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Strange behavior of object and lamp during rotation Empty Re: Strange behavior of object and lamp during rotation

Post  meteors Sun Nov 16, 2008 5:06 am

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
meteors
meteors

Posts : 241
Join date : 2008-11-08
Location : Sunny Florida

Back to top Go down

Strange behavior of object and lamp during rotation Empty Re: Strange behavior of object and lamp during rotation

Post  sio2interactive Sun Nov 16, 2008 3:18 pm

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...
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Strange behavior of object and lamp during rotation Empty Re: Strange behavior of object and lamp during rotation

Post  meteors Sun Nov 16, 2008 3:22 pm

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 )
}
meteors
meteors

Posts : 241
Join date : 2008-11-08
Location : Sunny Florida

Back to top Go down

Strange behavior of object and lamp during rotation Empty Re: Strange behavior of object and lamp during rotation

Post  meteors Sun Nov 16, 2008 5:21 pm

Ok, the answer to this problem is that I wasn't exporting normals =/


Thanks!!!
-joshua
meteors
meteors

Posts : 241
Join date : 2008-11-08
Location : Sunny Florida

Back to top Go down

Strange behavior of object and lamp during rotation Empty Re: Strange behavior of object and lamp during rotation

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum