The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by asutosh]

hello,
Section 13.1 of your book describes spatial tranforms. We know that if parent
transformgroup is moved all the objects attached to its child tranformgroup(s)
will also move. I want to do something which is exactly opposite of above. i
want to move an object attached with parent transformgroup when its child
transforgroup is moved. how do i do this? Actually, i am trying to locate a
particular object which is lying on a geographical map of a region. when i
press the center button i want to move the map in such a manner that the
object appears just at center of the screen. The position of object relative
to map should not change. Transformgroup of object is child of map's
transformgroup.

Thanks in advance.....
import-bot (20211) [Avatar] Offline
#2
Re: Moving parent transformgroup object using child transformgroup
[Originally posted by author]

(I'm not sure if I understood the first part of your question, but here
goes....) Seems that you'll have to search up along the parent links until you
find the desired parent, and then move that parent rather than just the child.

If what you are trying to do is recenter the map on one of its child objects,
then why not get the world position of the child target object, and then
translate the parent map object accordingly (add the vector from the target
object position to the map display center to the map object's position).

Good luck
--jon

> hello,
> Section 13.1 of your book describes spatial tranforms. We know that if parent
> transformgroup is moved all the objects attached to its child tranformgroup(s)
> will also move. I want to do something which is exactly opposite of above. i
> want to move an object attached with parent transformgroup when its child
> transforgroup is moved. how do i do this? Actually, i am trying to locate a
> particular object which is lying on a geographical map of a region. when i
> press the center button i want to move the map in such a manner that the
> object appears just at center of the screen. The position of object relative
> to map should not change. Transformgroup of object is child of map's
> transformgroup.
>
> Thanks in advance.....