Hi,
can somebody give me a simple answer, please?
Is it possible to have a mesh with animation state(s) and sound(s) for this animation state?
I.e. when I start the animation, it plays the sound as well?
Thank you very much.
Mesh with animations state and sound
-
kubatp
- Gnome
- Posts: 368
- Joined: Tue Jan 06, 2009 1:12 pm
- x 43
- tod
- Troll
- Posts: 1394
- Joined: Wed Aug 02, 2006 9:41 am
- Location: Bucharest
- x 94
- Contact:
Re: Mesh with animations state and sound
Ogre is a Graphics Rendering Engine, it doesn't do sounds. And besides, when you start the animation, why don't you play your sound also?
- Faranwath
- Halfling
- Posts: 93
- Joined: Mon Jul 09, 2012 2:19 pm
- Location: Cuba
- x 7
Re: Mesh with animations state and sound
Not out of the box, but, as tod said, you could simply play the sound right after starting the animation.kubatp wrote:Is it possible to have a mesh with animation state(s) and sound(s) for this animation state?
I.e. when I start the animation, it plays the sound as well?
Code: Select all
// ...
// code for starting the animation
// ...
play_sound("my_sound.mp3");
-
kubatp
- Gnome
- Posts: 368
- Joined: Tue Jan 06, 2009 1:12 pm
- x 43
Re: Mesh with animations state and sound
Hi,
thank you for reply. There are number of reasons:
thank you for reply. There are number of reasons:
- The sound has a latency when I play it separately.
- It is a "waste" to have the sound as long as the animation when you just want to add sound (for example) for "march step".
- When you have looping animation, you have to be careful to correctly reset both together.
- You need to sync these things in code. It is much cleaner to have animation which already includes sound and the work can be done purely by 3D modeller.
- Faranwath
- Halfling
- Posts: 93
- Joined: Mon Jul 09, 2012 2:19 pm
- Location: Cuba
- x 7
Re: Mesh with animations state and sound
Are you streaming it? That should prove faster.kubatp wrote:The sound has a latency when I play it separately.
You have a point. But even so, this can be abstracted.kubatp wrote:You need to sync these things in code. It is much cleaner to have animation which already includes sound and the work can be done purely by 3D modeller.
Quoting tod once more, Ogre is only concerned with graphics.kubatp wrote:From your replies I suppose there is no solution for this except of using 3rd party library, correct?
- Klaim
- Old One
- Posts: 2565
- Joined: Sun Sep 11, 2005 1:04 am
- Location: Paris, France
- x 56
- Contact:
Re: Mesh with animations state and sound
For steps and other sounds triggered by, for example, collision and related to animations, one way to do it is to have tag points on the skeleton, which in some cases (when playing some animations for example) you "check" (whatever that mean) to trigger the sound.
Ogre can only give you the tag points, the rest you'll have to do yourself. Also, some of these triggers, if related to collisions, might be implemented using the physics engine instead or your implementation of collision system.
Ogre can only give you the tag points, the rest you'll have to do yourself. Also, some of these triggers, if related to collisions, might be implemented using the physics engine instead or your implementation of collision system.
-
kubatp
- Gnome
- Posts: 368
- Joined: Tue Jan 06, 2009 1:12 pm
- x 43
Re: Mesh with animations state and sound
Thank you very much for your replies and opinions.
I understand from your replies that I have to find a solution how to sync animations and sounds on my own.
Happy coding:)
I understand from your replies that I have to find a solution how to sync animations and sounds on my own.
Happy coding:)