Author Topic: Object translation  (Read 2527 times)

Offline david24

  • byte
  • *
  • Posts: 8
    • View Profile
Object translation
« on: October 23, 2012, 01:55:11 pm »
Hi guys,

wanted to ask how can i make 5(for example) scattered objects to translate all together by translating a 6th object alone, but so that if i'll translate one of the first 5 objects the other will stay at they're position??..

i know i can use the translate() method and work it out but i am searching for sort like using the setTranslationMatrix() method, but if i am using it, all the objects are collapsing to the same point. i need them to stay relatively apart from the 6th object.
Also all the objects are loaded with the Loader class and drawn on 0,0,0  and translated pragmatically .

thank you in advanced :))

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Object translation
« Reply #1 on: October 23, 2012, 03:06:31 pm »
Make the 5 objects children of the 6th one and give them translations relative to 6.

Offline david24

  • byte
  • *
  • Posts: 8
    • View Profile
Re: Object translation
« Reply #2 on: October 23, 2012, 03:30:52 pm »
thank you!!! 
it did the trick, need now only to adjust translations.

Offline david24

  • byte
  • *
  • Posts: 8
    • View Profile
Re: Object translation
« Reply #3 on: October 23, 2012, 03:49:40 pm »
Hmm...i got a thing here..
It works great, but it seems to me adding a parent is inverting my axis.

why do you think it happened?

Offline david24

  • byte
  • *
  • Posts: 8
    • View Profile
Re: Object translation
« Reply #4 on: October 23, 2012, 05:02:19 pm »
I have added a parent to a parent( i needed to ), and it inverted it again..so now it is as it were..