Solved

using local translations to move to a point in global space

Posted on 1998-09-11
2
157 Views
Last Modified: 2012-05-04
I have a figure that I need to slide to a point.  The problem is this figure slides in its local corsys.  So the point in world coordinates may be (4,-7) away but I need to slide the device (2,8) in its coordinates.  My question is how do I find that local translation?  All this is done in 4x4 matrices.  I guess it has to do with get the destination point into the devices coordinate system, which I am also not sure how to do.  Below is a diagram that might help
 
 y  
10
09    
08   x
07  /
06  p
05   \
04    y
03                    
02                  
01                  X goal poin
00                  
  1 2 3 4 5 6 7 8 9 10 x


So you can see that in world all I need to do is slide p 8 in X and -5 in Y.  But I need to use p local coordinates and slide it in x or y.  So it should be something like 7 in y and 2 in x.  All the values I am working with are in 4x4 matrices.

Thanks
0
Comment
Question by:micah
2 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1112475
What do you know about yhe relationship between world coordinates and device coordinates?
0
 
LVL 10

Accepted Solution

by:
Jacco earned 100 total points
ID: 1112476
Transformations are always reversible

If everything is right you have one matrix to convert from local coords to world coords [W]. (The inverse of the matrix converts back).

Seeing that you use 4x4 matrices means you are working in 3D right?

[ 1 0 0 tx ] [x]   [ x + tx ]
[ 0 1 0 ty ] [y] = [ y + ty ]
[ 0 0 1 tz ] [z]   [ z + tz ]
[ 0 0 0 1  ] [1]   [   1    ]

This is the translation matrix [T]

If you want to convert your local vars to world vars and then translate you can use

       [x]
[M][T] [y]
       [z]
       [1]

(You understand how to multiply matrices?)

The other way around would be first translating the converting:

      [x]
[T][M][y]
      [z]
      [1]

You can also multiply the matrixes and use the new matrix as the conversion from model to world.

Regards Jacco


0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Making an image transparent 7 316
Video GIF 4 80
CorelDraw x7 requiring Adobe to print accurately?? 3 117
Pinnacle Studio 19 5 16
Keep your audience engaged and get the most out of your next presentation with these quick Prezi tips.
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
In this tutorial viewers will learn how to create blended and gradiated shapes in Illustrator using the blend tool Draw two shapes, one of them in a different color: Select both and create a blend by going to Object > Blend > Make: Blends can also b…
In this second Micro Tutorial in the series,  viewers will learn more basic shortcuts and functions of Illustrator. In this tutorial you will learn about the eyedropper tool, zoom , ellipses and more.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now