accelerometer (How can I make them work just the oposite?)
2 posters
accelerometer (How can I make them work just the oposite?)
Can someone show me the code so that the Accelerometer works more like a steering wheel? (I'm using Tutorial 09)
Thank you.
Thank you.
sgmitch- Posts : 5
Join date : 2008-12-15
Re: accelerometer (How can I make them work just the oposite?)
Examine tutorial05.
Use the accelerometer values to change global rotation variables, and/or set the rotation of individual objects. Don't forget to call sio2BindMatrix on modified objects.
Best,
-joshua
Use the accelerometer values to change global rotation variables, and/or set the rotation of individual objects. Don't forget to call sio2BindMatrix on modified objects.
Best,
-joshua
meteors- Posts : 241
Join date : 2008-11-08
Location : Sunny Florida
Re: accelerometer (How can I make them work just the oposite?)
Thanks for your response... Here's what I've done so far.
(this is code from Tutorial 09... I simply changed the 2 ">'s") This has caused my rotation to change but it's jerky. I think the problem is with the camera updating it's position... I have NOOOO idea how to fix this.
code from Template.MM
if( object )
{
// Calculate our smooth Z rotation based on
// the delta time of the application.
if( ROTZ_DIR < 0 )
{
SMOOTH_Z -= 1.0f * sio2->_SIO2window->d_time;
ROTZ += SMOOTH_Z;
}
else if( ROTZ_DIR > 0 )
{
SMOOTH_Z -= 1.0f * sio2->_SIO2window->d_time;
ROTZ -= SMOOTH_Z;
}
// If we are below 0 just reset every movements.
if( SMOOTH_Z < 0.0f )
{
SMOOTH_Z = 0.0f;
ROTZ_DIR = 0;
}
(this is code from Tutorial 09... I simply changed the 2 ">'s") This has caused my rotation to change but it's jerky. I think the problem is with the camera updating it's position... I have NOOOO idea how to fix this.
code from Template.MM
if( object )
{
// Calculate our smooth Z rotation based on
// the delta time of the application.
if( ROTZ_DIR < 0 )
{
SMOOTH_Z -= 1.0f * sio2->_SIO2window->d_time;
ROTZ += SMOOTH_Z;
}
else if( ROTZ_DIR > 0 )
{
SMOOTH_Z -= 1.0f * sio2->_SIO2window->d_time;
ROTZ -= SMOOTH_Z;
}
// If we are below 0 just reset every movements.
if( SMOOTH_Z < 0.0f )
{
SMOOTH_Z = 0.0f;
ROTZ_DIR = 0;
}
sgmitch- Posts : 5
Join date : 2008-12-15
Re: accelerometer (How can I make them work just the oposite?)
so has anyone alter the code so that the accelerometer in tutorial 09's? I'm not very good at altering code so I could use some help. Thanks a lot!
sgmitch- Posts : 5
Join date : 2008-12-15
Re: accelerometer (How can I make them work just the oposite?)
forget it... I figured it out.. I didn't change the ROTZ -= tmp to ==
sgmitch- Posts : 5
Join date : 2008-12-15
Similar topics
» Accelerometer Example
» Accelerometer measurements
» Use accelerometer in Simulator
» accelerometer helping tool
» Ipo is not work,why?
» Accelerometer measurements
» Use accelerometer in Simulator
» accelerometer helping tool
» Ipo is not work,why?
Permissions in this forum:
You cannot reply to topics in this forum
|
|