rotation doesn't stop
Posted: Thu Dec 14, 2006 1:04 am
here is main loop:
while(Device->run() && driver)
if (Device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(150,50,50,50));
pv = node->getPosition();
pv1 = node3->getPosition();
pv2 = node8->getPosition();
pv3 = node5->getPosition();
pv4 = node6->getPosition();
pv10 = node10->getPosition();
// упраление NODE
RealControl();
cr = node6->getPosition();
x4=cr.X;
z4=cr.Y;
y4=cr.Z;
if (z10 > 0)
a = -1;
else
if (z10 < 0)
a = 1;
else a=0;
cosfi11=(x4)/sqrt((x4)*(x4) + (z4)*(z4));
cosfi21=(x10)/sqrt((x10)*(x10) + (z10)*(z10));
deltafi1 =cosfi11-cosfi21;
if (deltafi1>0)
OmegY = a * DeltOmeg;
else
if (deltafi1=0)
OmegY=0;
else
if (deltafi1<0)
OmegY=0;
smgr->drawAll();
env->drawAll();
// draw irrlicht engine logo
driver->draw2DImage(irrLogo,
core::position2d<s32>(10, driver->getScreenSize().Height - 50),
core::rect<s32>(0,0,108-20,460-429));
driver->endScene();
core::stringw str = L"FPS: ";
str += driver->getFPS();
fpstext->setText(str.c_str());
}
Device->drop();
return 0;
http://photofile.ru/photo/salomon777/23 ... 845356.jpg
x20,z10 are given earlier |red point|
black lines start position
yellow - at the end
here i try to make rotation around axe Y.
the problem is that object doesn't stop at the end and continue moving /as i understand from watch window x4,y4,z4 don't change -> cosfi1 doesn't change -> deltafi1 doesn't change ->program doesn't work/
how make them to change? how can i get information about node position?
while(Device->run() && driver)
if (Device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(150,50,50,50));
pv = node->getPosition();
pv1 = node3->getPosition();
pv2 = node8->getPosition();
pv3 = node5->getPosition();
pv4 = node6->getPosition();
pv10 = node10->getPosition();
// упраление NODE
RealControl();
cr = node6->getPosition();
x4=cr.X;
z4=cr.Y;
y4=cr.Z;
if (z10 > 0)
a = -1;
else
if (z10 < 0)
a = 1;
else a=0;
cosfi11=(x4)/sqrt((x4)*(x4) + (z4)*(z4));
cosfi21=(x10)/sqrt((x10)*(x10) + (z10)*(z10));
deltafi1 =cosfi11-cosfi21;
if (deltafi1>0)
OmegY = a * DeltOmeg;
else
if (deltafi1=0)
OmegY=0;
else
if (deltafi1<0)
OmegY=0;
smgr->drawAll();
env->drawAll();
// draw irrlicht engine logo
driver->draw2DImage(irrLogo,
core::position2d<s32>(10, driver->getScreenSize().Height - 50),
core::rect<s32>(0,0,108-20,460-429));
driver->endScene();
core::stringw str = L"FPS: ";
str += driver->getFPS();
fpstext->setText(str.c_str());
}
Device->drop();
return 0;
http://photofile.ru/photo/salomon777/23 ... 845356.jpg
x20,z10 are given earlier |red point|
black lines start position
yellow - at the end
here i try to make rotation around axe Y.
the problem is that object doesn't stop at the end and continue moving /as i understand from watch window x4,y4,z4 don't change -> cosfi1 doesn't change -> deltafi1 doesn't change ->program doesn't work/
how make them to change? how can i get information about node position?