|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.sdsc.mbt.viewers.GLViewerImpl.VirtualSphere2
Implements a Virtual Sphere algorithm for 3D rotation using a 2D input device. This can be used for manipulating objects or (by reversing the rotation) as part of a camera control/rotation behavior.
Idea based upon the paper "A Study in Interactive 3-D Rotation Using 2-D Control Devices" by Michael Chen, S. Joy Mountford and Abigail Sellen published in the ACM Siggraph '88 proceedings (Volume 22, Number 4, August 1988).
edu.sdsc.vis.viewers.GeometryViewer
Constructor Summary | |
VirtualSphere2()
Utility constructor creates a virtual sphere controller using default x,y screen coordinates as the center and default r as the radius of the controller's bounding circle. |
|
VirtualSphere2(int x,
int y,
int r)
Primary constructor creates a virtual sphere controller using the specified x,y screen coordinate as the center and r as the radius of the controller's bounding circle. |
Method Summary | |
void |
compute(int px,
int py,
int qx,
int qy,
double[] rotation)
Determine the axis and angle (in radians) of rotation from two screen coordinates and relative to the virtual sphere cue circle. |
void |
getCircle(int[] circle)
Get the parameters for the screen-space constraining 2D circle as {x,y,r}. |
int |
getRadius()
|
void |
pointOnUnitSphere(int px,
int py,
double[] v)
Project a 2D point on a circle to a 3D point on the +z hemisphere of a unit sphere. |
void |
setCircle(int[] circle)
Set the parameters for the screen-space constraining 2D circle as {x,y,r}. |
void |
setCircle(int x,
int y,
int r)
Set the parameters for the screen-space constraining 2D circle. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public VirtualSphere2(int x, int y, int r)
x
- Screen x-coordinate for rotation circle.y
- Screen y-coordinate for rotation circle.r
- Screen radius for rotation circle.public VirtualSphere2()
Method Detail |
public int getRadius()
public void setCircle(int x, int y, int r)
x
- Screen x-coordinate for rotation circle.y
- Screen y-coordinate for rotation circle.r
- Screen radius for rotation circle.public void setCircle(int[] circle)
circle
- Screen {x,y,radius} for rotation circle.public void getCircle(int[] circle)
circle
- Screen {x,y,radius} for rotation circle.public void compute(int px, int py, int qx, int qy, double[] rotation)
px
- Screen start point, x-coordinate.py
- Screen start point, y-coordinate.qx
- Screen end point, x-coordinate.qy
- Screen end point, y-coordinate.rotation
- Rotation vector {angle,x,y,z} result.public void pointOnUnitSphere(int px, int py, double[] v)
px
- Screen x-coordinate.py
- Screen y-coordinate.v
- 3D rotation vector {angle,x,y,z} result.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |