PDA

View Full Version : Does somebody use Cosmo3D & Optimizer ?



zming
01-27-2001, 06:17 AM
How can I finish some rotation in one step?
in my program if I do like list below:
...
m_pTransform->setRotation(0.0f, 0.1f, 0.0f, CS_DEG2RAD(angle1));
m_pTransform->setRotation(1.0f, 0.1f, 0.0f, CS_DEG2RAD(angle2));

m_pDrawAction->apply(m_pRoot);
...

the result is only the sectond rotation.
Anybody can tell me how to do it ?
Thanks.

Leyder Dylan
01-28-2001, 03:21 AM
If you try this ?

**************
m_pTransform->setRotation(0.0f, 0.1f, 0.0f, CS_DEG2RAD(angle1));

m_pDrawAction->apply(m_pRoot);

m_pTransform->setRotation(1.0f, 0.1f, 0.0f, CS_DEG2RAD(angle2));

m_pDrawAction->apply(m_pRoot);
******************

Or you can make a loop with the angle value in a board.

for (i = 0; i < 2; i ++)
{
m_pTransform->setRotation(0.0f, 0.1f, 0.0f, CS_DEG2RAD(tab(i)));

m_pDrawAction->apply(m_pRoot);
}

Coconut
01-29-2001, 08:42 AM
zming,

There are several ways to do what you want, one of these is:

csRotation rot1(0.0f, 0.1f, 0.0f, CS_DEG2RAD(angle1)), rot2(1.0f, 0.1f, 0.0f, CS_DEG2RAD(angle12));

rot1.mult(rot2, rot1); //rot2 * rot1
m_pTransform->setRotation(rot1);
m_pDrawAction->apply(m_pRoot);

Let me know if it works.