All Packages  This Package  Class Hierarchy  Class Search  Index

Class com.hermetica.util3d.trackball
java.lang.Object
   |
   +----com.hermetica.util3d.trackball

  Summary

public class  trackball
     extends java.lang.Object
{
          // Constructors 2
     public trackball();
     public trackball(float);

          // Methods 6
     public float[] addQuats(float[], float[]);
     public float[] axisToQuat(float[], float);
     public float[][] buildMatrix(float[]);
     public float[] buildQuaternion(float, float, float, float);
     public float projectToSphere(float, float, float);
     public float[] renormalizeQuat(float[]);
}




  Constructors

· trackball

Summary  |  Top

   public trackball() 

Constructor



· trackball

Summary  |  Top
   public trackball(float size) 

Constructor with trackball size. The default is 0.8



  Methods

· buildQuaternion

Summary  |  Top
   public float[] buildQuaternion(float p1x, 
                                  float p1y, 
                                  float p2x, 
                                  float p2y) 

Calculates a quaternion representing the trackball



· axisToQuat

Summary  |  Top
   public float[] axisToQuat(float[] a, 
                             float phi) 

Given an axis and angle, compute the quaternion



· projectToSphere

Summary  |  Top
   public float projectToSphere(float r, 
                                float x, 
                                float y) 

Project an x, y pair onto a sphere of radius r OR a hyperbolic sheet if we are away from the centre of the sphere.



· addQuats

Summary  |  Top
   public float[] addQuats(float[] q1, 
                           float[] q2) 

Given two rotations, e1 and e2, expressed as quaternion rotations, figure out the equivalent single rotation and return it. This routine also normalizes the result every RENORMCOUNT times it is called to keep error from creeping in. NOTE: This routine is written so that q1 or q2 may be the same as dest ( or each other ).



· renormalizeQuat

Summary  |  Top
   public float[] renormalizeQuat(float[] q) 

Quaternions always obey: a^2 + b^2 + c^2 + d^2 = 1.0. If they don't add up to 1.0, dividing them by their magnitude will renormalize them.



· buildMatrix

Summary  |  Top
   public float[][] buildMatrix(float[] q) 

Builds a rotation matrix from a given quaternion



All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7