www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: david24 on October 23, 2012, 01:55:11 pm

Title: Object translation
Post by: david24 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 :))
Title: Re: Object translation
Post by: EgonOlsen on October 23, 2012, 03:06:31 pm
Make the 5 objects children of the 6th one and give them translations relative to 6.
Title: Re: Object translation
Post by: david24 on October 23, 2012, 03:30:52 pm
thank you!!! 
it did the trick, need now only to adjust translations.
Title: Re: Object translation
Post by: david24 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?
Title: Re: Object translation
Post by: david24 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..