Author Topic: How to properly scale AnimatedGroup?  (Read 1386 times)

Offline Dark_Mark

  • byte
  • *
  • Posts: 3
  • S Rank Hunter
    • View Profile
    • darkmarkzx.deviantart.com
How to properly scale AnimatedGroup?
« on: July 26, 2012, 08:44:26 pm »
Hi. I have a simple scene like the one mentioned in the Advanced Example and I've added the popular ninja model in .bones format. Everything works well, but if I scale the model like this:
Code: [Select]
animatedGroup.getRoot().setScale(0.2f);The model itself becomes very dark :( However, when I do it like this:
Code: [Select]
for (Animated3D o : animatedGroup)
{
o.setScale(0.2f);
}
the model is properly lit, but the katana's position is wrong. So here's my question: what is the proper way of scaling an animated .bones model?

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: How to properly scale AnimatedGroup?
« Reply #1 on: July 26, 2012, 09:37:08 pm »
Quote
Code: [Select]
animatedGroup.getRoot().setScale(0.2f);
root is a dummy object, just to easily move and rotate all Animated3D's easily. it's not meant for this

Quote
Code: [Select]
for (Animated3D o : animatedGroup) {
o.setScale(0.2f);
}
this should be the correct way. but sword is misplaced as you said. I don't know what causes it yet, I will think about it.

do you really need scaling objects on the fly? what about scaling them when loading?

Offline Dark_Mark

  • byte
  • *
  • Posts: 3
  • S Rank Hunter
    • View Profile
    • darkmarkzx.deviantart.com
Re: How to properly scale AnimatedGroup?
« Reply #2 on: July 26, 2012, 09:59:48 pm »
do you really need scaling objects on the fly? what about scaling them when loading?
I know it can be done via BonesImporter.importOgre and BonesImporter.importCollada, but is there an easy way to accomplish the same for .bones files as well?

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: How to properly scale AnimatedGroup?
« Reply #3 on: July 26, 2012, 10:05:30 pm »
you can use either those methods or the provided scripts in scripts folder. indeed the scripts use those methods behind the scenes. quite easy IMHO unless you need real time scaing.


Offline Dark_Mark

  • byte
  • *
  • Posts: 3
  • S Rank Hunter
    • View Profile
    • darkmarkzx.deviantart.com
Re: How to properly scale AnimatedGroup?
« Reply #4 on: July 26, 2012, 10:09:53 pm »
OK, thanks.