Re: How to change the 3D visual angel? [message #59685] |
Mon, 07 April 2008 11:11  |
rtowler
Messages: 28 Registered: June 2006
|
Junior Member |
|
|
On Apr 5, 7:53 am, FOX <20thfox...@gmail.com> wrote:
> I use IDLgrVolume to plot volume data
> but there is something wrong with the visual angel, no matter how i
> rotate the model, the angel it's not good. i want to output the volume
> as xvolume or ivolume's default visualization.
> anything more than model rotate?
Yes, the dark angel of IDL object graphics is at work here ;)
This is a simple case of understanding OpenGL transformations which,
because we expect things to move on the screen as they do in life,
aren't intuitive. This is why I wrote an object graphics camera class
which you should take a look at:
http://www.acoustics.washington.edu/~towler/RHTgrCamera.html
For simplicities sake, I recommend starting with camera__define.zip
located at the bottom of the page. Using my camera class you'll be
able to manipulate your volume more intuitively. If you wish to
ultimately view the volume in iTools (I couldn't really tell from your
email), you can modify the camera code to output the transformation
matrix used to create the view you are interested in and then apply
that to your model before passing it to the iTool.
-Rick
|
|
|
|
Re: How to change the 3D visual angel? [message #59709 is a reply to message #59707] |
Sat, 05 April 2008 09:54   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
FOX writes:
> sorry about the mistake~~english is really a problem,but to find the
> chinese IDL resource even worse
> i mean the visual angle. i'm not using iTools,just the IDLgrVolume
> object
> i want to overlook the cube, but the view point always be the center
> of the view
Well, yes, object graphics can be pretty low-level and
setting up the viewport and the rotation necessary to
see something can be a problem. We have the same problem
with surfaces, for example. Perhaps you can learn something
about how it is done by examining the code in a program
like Simple_Surface:
http://www.dfanning.com/programs/simple_surface.pro
There the surface rotations for the surface model look
like this:
; Rotate the surface model to the standard surface view.
thisModel->Rotate,[1,0,0], -90 ; To get the Z-axis vertical.
thisModel->Rotate,[0,1,0], 30 ; Rotate it slightly to the right.
thisModel->Rotate,[1,0,0], 30 ; Rotate it down slightly.
Note that the viewport has been previously set-up to put
the center of rotation in the center of the window. If it
is somewhere else, you will have to translate the object to the center,
perform the rotation, and translate it back to where you want it.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
|
|
|