octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Implementing view


From: John Swensen
Subject: Re: Implementing view
Date: Mon, 8 Nov 2010 13:11:06 -0500

On Nov 8, 2010, at 12:50 PM, Jordi Gutiérrez Hermoso wrote:

> 2010/11/8 logari81 <address@hidden>:
> 
>> Hi, have you seen the following matlab documentation?
>> 
>> http://www.mathworks.com/help/techdoc/ref/viewmtx.html
>> 
>> it seems quite complete.
> 
> Yes, but they only describe in broad strokes how T is built. I'm
> trying to reverse engineer it based on what people tell me that Matlab
> does. Or do you understand why the transformation matrix includes
> translations? That page doesn't explain it.
> 
>> If I 've understood right, the only feature
>> missing in the actual view implementation in octave is the possibility
>> of returning the transformation matrix T. Is this correct?
> 
> It was also missing the ability to specify views by direction vectors
> instead of azimuth and elevation, but that was quite easy to
> implement.
> 
> - Jordi G. H.

I can give you a rough answer of what is going on.  I think you are expecting 
to see the inverse of the transformation matrix.  This has to do with how rigid 
body transforms can be view in two ways: (1) transforms points or (2) 
transforms frames.  The interesting thing is that the Matlab documentation says 
that the transform matrix specifies how point are transformed, but it is clear 
that specifying the azimuth and elevation is really transforming the position 
and orientation of the camera.  As such, the inverse of the transform will give 
the position and orientation of the camera with respect to the identity 
orientation where the camera would be located at the origin with the camera 
frame axes aligned with the plot axes.

>> view(0,90)
>> xx = view; inv(xx)
ans =

    1.0000         0         0    0.5000
         0    1.0000         0    0.5000
         0         0   -1.0000    9.1603
         0         0         0    1.0000

>> view(90,0)
>> xx = view; inv(xx)
ans =

         0         0   -1.0000    9.1603
    1.0000         0         0    0.5000
         0    1.0000         0    0.5000
         0         0         0    1.0000

>> view(90,90)
>> xx = view; inv(xx)
ans =

         0   -1.0000         0    0.5000
    1.0000         0         0    0.5000
         0         0   -1.0000    9.1603
         0         0         0    1.0000


John Swensen


reply via email to

[Prev in Thread] Current Thread [Next in Thread]