[Solved] Can One Create Extremely Slow Animation Speed?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
peacerosetx
Posts: 51
Joined: Fri Jan 11, 2008 3:21 am
Location: Fort Worth, Texas

[Solved] Can One Create Extremely Slow Animation Speed?

Post by peacerosetx »

Greeting All,

I am doing animated frames--similar to a PowerPoint presentation. I load the textures into an array. The problem is that I need to make each frame stay on the screen long enough for the person to read what each screen says. There are only 15 screens for each unit. I would like each screen to stay for 1-2 seconds.

I have looked at splash screens, but this would not allow the animation effect to allow one to see the sun object animate slowly moving across the screen. I have looked at ->setAnimationSpeed(), but no matter what I change it to--even "1," it has no effect. The screens still go by so quickly you don't even see them

I have looked at a post where if one's project is not framerate dependent one can change the timer. I am not certain how one distinguishes a project as "framerate dependent or not." However, I have not found a way to do this, and am not sure this is the direction to go to change the animations so that they are slow.

I have used both a billboard to show my animations and an AnimatedMeshSceneNode. Below is the code used for the billboard and the AnimatedMeshSceneNode. Any help in the right direction would be appreciated. Thank you.


This is code with the billboard looks better with the 2d

Code: Select all

 scene::ISceneNodeAnimator*  ScreenAnimator = m_pSceneManager->createTextureAnimator(adventureOneTexture, 1, false); 
	m_pIrrNode    = m_pSceneManager->addBillboardSceneNode(NULL, irr::core::dimension2d<f32>(500, 500));


  // Set material properties
  m_pIrrNode->setMaterialFlag(irr::video::EMF_LIGHTING, false);     
  m_pIrrNode->setMaterialType(irr::video::EMT_TRANSPARENT_ALPHA_CHANNEL );
 
  m_pIrrNode->addAnimator(ScreenAnimator);



ScreenAnimator->drop();


This is the code with the AnimatedMeshSceneNode

Code: Select all

scene::ISceneNodeAnimator*  ScreenAnimator = m_pSceneManager->createTextureAnimator(adventureOneTexture, 1, false); 
//"../../LevelMesh/Godsirr050AllGoldLighting002.b3d");
cubeMeshScreenTwo = m_pSceneManager->addAnimatedMeshSceneNode(m_pSceneManager->getMesh("../../HealMesh/3DWorldHealMesh002.b3d"));
cubeMeshScreenTwo->setPosition(core::vector3df(100,70,2));
  // Set material properties

 //  // Set material properties
cubeMeshScreenTwo->setMaterialFlag(irr::video::EMF_LIGHTING, false);     
cubeMeshScreenTwo->setMaterialType(irr::video::EMT_TRANSPARENT_ALPHA_CHANNEL );
 cubeMeshScreenTwo->setPosition(core::vector3df(100,70,2));  

//int speed = 1;
 //cubeMeshScreenTwo->setFrameLoop(1,15);
 //cubeMeshScreenTwo->setAnimationSpeed(speed/3000);
cubeMeshScreenTwo->setAnimationSpeed(1);
cubeMeshScreenTwo->addAnimator(ScreenAnimator); 

ScreenAnimator->drop();
Peace.

:shock:
Last edited by peacerosetx on Fri Mar 13, 2009 5:22 pm, edited 1 time in total.
___Trusting in the Lord
Strong99
Admin
Posts: 687
Joined: Fri Mar 31, 2006 7:06 pm
Location: Netherlands
Contact:

Post by Strong99 »

uuhh, the timeperframe is in ms I thought? so you would need something like this 10000 ms (10 sec per frame) instead 1 ms for slow animation
peacerosetx
Posts: 51
Joined: Fri Jan 11, 2008 3:21 am
Location: Fort Worth, Texas

Post by peacerosetx »

@strong99 Thank you. I tried 10000, even 100000 and it has no effect. The screens still go by so fast you can't see them. Is there something else that I need to set initially? I am not sure what to do? :roll:
___Trusting in the Lord
Strong99
Admin
Posts: 687
Joined: Fri Mar 31, 2006 7:06 pm
Location: Netherlands
Contact:

Post by Strong99 »

do you see the textures moving or just black/white?

a screenshot would maybe usefull here
peacerosetx
Posts: 51
Joined: Fri Jan 11, 2008 3:21 am
Location: Fort Worth, Texas

Post by peacerosetx »

@strong99

I re-did all of the screens so that they would only be pure colors red, yellow or blue. I *do* see the blue frame when it begins--very very briefly, but then the image quickly shifts to the red screen which is the last screen . I am not sure how screen shots could help unless I could animate it somehow with a youTube presentation.

However, maybe it is in the loading of the textures so I have included this code below. Thank you.

Code: Select all

  // load textures
 irr::core::array<irr::video::ITexture*> adventureOneTexture;

//these are for the series to introduce the first issue of



//adventureOneTexture.push_back(m_pDriver->getTexture(t));
adventureOneTexture.push_back(m_pDriver->getTexture("../../media/adventureOneImage1T.jpg"));
adventureOneTexture.push_back(m_pDriver->getTexture("../../media/adventureOneImage2T.jpg"));
adventureOneTexture.push_back(m_pDriver->getTexture("../../media/adventureOneImage3T.jpg"));
adventureOneTexture.push_back(m_pDriver->getTexture("../../media/adventureOneImage4T.jpg"));
adventureOneTexture.push_back(m_pDriver->getTexture("../../media/adventureOneImage5T.jpg"));
adventureOneTexture.push_back(m_pDriver->getTexture("../../media/adventureOneImage6T.jpg")); 
adventureOneTexture.push_back(m_pDriver->getTexture("../../media/adventureOneImage7T.jpg"));
adventureOneTexture.push_back(m_pDriver->getTexture("../../media/adventureOneImage8T.jpg"));
adventureOneTexture.push_back(m_pDriver->getTexture("../../media/adventureOneImage9T.jpg"));
adventureOneTexture.push_back(m_pDriver->getTexture("../../media/adventureOneImage10T.jpg"));


//**** ANALYSIS ONE ****this is for the insert of the first userAnalysis 

//this is sunny
if(number == 1)
{
adventureOneTexture.push_back(m_pDriver->getTexture("../../media/adventureOneImage11T.jpg"));
adventureOneTexture.push_back(m_pDriver->getTexture("../../media/adventureOneImage12T.jpg"));
adventureOneTexture.push_back(m_pDriver->getTexture("../../media/adventureOneImage13T.jpg"));
adventureOneTexture.push_back(m_pDriver->getTexture("../../media/adventureOneImage14T.jpg"));
adventureOneTexture.push_back(m_pDriver->getTexture("../../media/adventureOneImage15T.jpg"));
}



___Trusting in the Lord
Strong99
Admin
Posts: 687
Joined: Fri Mar 31, 2006 7:06 pm
Location: Netherlands
Contact:

Post by Strong99 »

:( don't see any differences with my test version,

which irrlicht version are you using?
peacerosetx
Posts: 51
Joined: Fri Jan 11, 2008 3:21 am
Location: Fort Worth, Texas

Post by peacerosetx »

when you say:
don't see any differences with my test version,
does this mean that you tried it and you were able to see the animation moving when you setAnimationSpeed(10000);?

I am using the version release just prior to this last one. I believe it is
Irrlicht version 1.4.2.

I am using the Burning Software Renderer if that might make a difference, I'll try now with DX8. Thank you for your test.

Do I need to set the frameLoop?
___Trusting in the Lord
Strong99
Admin
Posts: 687
Joined: Fri Mar 31, 2006 7:06 pm
Location: Netherlands
Contact:

Post by Strong99 »

Yeh I tryed to get the same result

1.4.2 : :lol: tried with 1.5 and 1.6 svn :)

frameLoop only loops the animation instead of stopping after the last texture.
peacerosetx
Posts: 51
Joined: Fri Jan 11, 2008 3:21 am
Location: Fort Worth, Texas

Post by peacerosetx »

So when you say "you tried," what you're saying is that you are able to have it animate correctly, that is it animates at a very slow rate, is that correct? Forgive me for the clarification I am just confused. If you are able to get it to slow down, may I ask, how are you loading the textures with an i++, or through an array?

Maybe it is the array that is the issue, maybe it cannot slow the speed(I know this might be stretching it) :)

You tried it with the cubeMeshScreenTwo, correct? That is the one where I can set the speed, as opposed to the Billboard code.
___Trusting in the Lord
Strong99
Admin
Posts: 687
Joined: Fri Mar 31, 2006 7:06 pm
Location: Netherlands
Contact:

Post by Strong99 »

Tried also in 1.4.2 now, i just added this to line 168 of heloworld tutorial and works

Code: Select all

irr::core::array<irr::video::ITexture*> textureList;
		textureList.push_back(driver->getTexture("../../media/006shot.jpg"));
		textureList.push_back(driver->getTexture("../../media/007shot.jpg"));
		textureList.push_back(driver->getTexture("../../media/008shot.jpg"));
		textureList.push_back(driver->getTexture("../../media/009shot.jpg"));
		textureList.push_back(driver->getTexture("../../media/010shot.jpg"));
		textureList.push_back(driver->getTexture("../../media/011shot.jpg"));

		irr::scene::ISceneNodeAnimator* anim = smgr->createTextureAnimator(textureList, 8000, false); 
		node->addAnimator(anim);
		anim->drop();
[edit]
you alter the animation from scenenode instead texture animator ?
peacerosetx
Posts: 51
Joined: Fri Jan 11, 2008 3:21 am
Location: Fort Worth, Texas

Post by peacerosetx »

@strong99 You have literally brought me to tears..you have done such a great job!!! :cry:

If you look at your code:
smgr->createTextureAnimator(textureList, 8000, true);
and then look at my code

Code: Select all

cubeMeshScreenTwo->setAnimationSpeed(1); 
You'll notice that we were setting the speeds in different places. I changed the speed to where you did in the "->createTextureAnimator" and it works perfectly...I am *so* happy you have no idea. :D

Please keep track of our project to get a download if you want...

For now our gift to you is our quote:
"Be truly glad. There is wonderful joy ahead!"

- I Peter 1:6

Peace, and Thank You!
___Trusting in the Lord
Post Reply