Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Animating the same Actor multiple times  (Read 889 times)
indigo21
Community Member
*
Posts: 4


« on: September 15, 2009, 07:41:30 PM »

I understand that you can render the same Actor object mutiple times each frame by setting its transformations before each render call. Can anyone tell me how to use the same actor to render an actor multiple times but with their own position in the animation sequence?

For example, say I am rendering several soldiers walking, I wouldn't want them all using the walking animation at the same time. I'd want them out of sync. Thank you.
Logged
Shargot
Customers
Community Member
*****
Posts: 166


WWW
« Reply #1 on: September 16, 2009, 03:22:41 AM »

try TVactor.render(true) - this update animation for fierst and for other TVactor.render(false) - this not update animation
Logged

" width="130" height="45" border="0
Hypnotron
Customers
Community Member
*****
Posts: 1043


« Reply #2 on: September 16, 2009, 05:10:10 AM »

You can't easily use a single TVActor resource instance for multiple players/npcs.  Best way is to use duplicate actors as in newActor = oldActor.Duplicate(); 

I tried doing what you're talking about years ago and the simple answer is it's totally impractical and your performance will decrease because you'll end up doing 2x the number of actor.Update() to get the animation back to where it was for a particular npc/player the previous frame.  Trying to save and restore bone matrices each frame for each npc/player that is sharing a TVActor is going to be extremely slow as well (plus i never got it working properly).  I had a long talk about this with Sylvain a couple of years ago so I understand the issue.

If you're doing what i think you're doing and you still want to at least keep the programming interface the same as with your mesh class, you can just do all the actor.Duplicate() underneath the hood in an array within your tvactor wrapper class and when you "share" a new reference, grab a duplicate and associate the duplicate's array index with the npc/player object that is using it.

Logged
indigo21
Community Member
*
Posts: 4


« Reply #3 on: September 16, 2009, 05:45:04 AM »

 Smiley Thank you for that answer! You understood perfectly despite my poor explaination. I ended up doing exactly what you said and I'm happy you've confirmed that it's a normal thing to do. Personally I don't think a 3D engine should retain translation data within it's mesh objects as such but TV3D is the first 3D engine that has worked for me so I am not complaining one bit. It's really fantastic. It's also nice to know someone else went through the same dilemma.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks