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 pauldb]

Hi,
excellent book and framework.

I'm playing with some code based on the TargetDecorating example. This uses a
Multishape along with AffineGroups for slide, rotation and lift.
After dragging my object, I would like to know its final position. Is it a
case of getting the TransformGroup of the individual AffineGroups and working
it out from each of the transforms - OR - is there something simpler that I
can use?
I guess I would like a method doing the reverse of initActuation(Tuple4d t)
and giving me back the vector/point of each of the AffineGroups mentioned above.

Maybe I'm being lazy but I didn't want to miss anything more obvious.
Thanks,
-Paul
import-bot (20211) [Avatar] Offline
#2
Re: TargetDecorating - position after drag
[Originally posted by author]

Page 240 of the book discusses spatial transforms. You can use
getLocalToVworld(), which is a method on java 3D nodes. With the transform in
hand you can transform the origin and vector directions in the local space to
world coordinates. Using the j3dui.control.mappers.Mapper.toTargetSpace()
utility you can compute the transform from any local space to any other local
space.

--jon
import-bot (20211) [Avatar] Offline
#3
Re: TargetDecorating - position after drag
[Originally posted by pauldb]

Thanks for such a rapid response - when someone is struggling with a problem,
that is very much appreciated.

Please forgive my naivity but I've simply done the localToVworld on the target
object rather than on the individual AffineGroups. Doesn't this transform give
me the position/orientation of my object directly? Or am I missing something.

Best wishes,
-Paul
import-bot (20211) [Avatar] Offline
#4
Re: TargetDecorating - position after drag
[Originally posted by author]

I'm not sure I understand what the problem is. If you want the position of
the target in the world you call Node.getLocalToVworld() on the node
representing the reference space for the target object. If the target object
is a leaf node then that is the node you use. If the target is compound then
you have to figure out which node that comprises the target represents what
you consider the local reference space. perhaps that node is above, at, or
below the chain of nodes in the affine group or groups. In any case, as far
as java 3d is concerned, a node is a node and it is up to you to call
getLocalToVworld() on what you consider to be the "target" node.

--jon
import-bot (20211) [Avatar] Offline
#5
Re: TargetDecorating - position after drag
[Originally posted by pauldb]

Yes, apologies for the confusion.
I was getting lost in AffineGroups and Actuators when I had a reference to my
target node all along.
LocalToVworld then gives me the transform that I need.

Many thanks,
-Paul