nl.kun.Engine3D
Class TSphere3D

java.lang.Object
  |
  +--nl.kun.Engine3D.TVector3D
        |
        +--nl.kun.Engine3D.TCoordSys3D
              |
              +--nl.kun.Engine3D.TEntity3D
                    |
                    +--nl.kun.Engine3D.TSphere3D

public class TSphere3D
extends TEntity3D

This object is inherited from TEntity3D. It contains a 3D model for a sphere. At the moment the projection is just a flat circle with the radius and position projected correctly. TODO: make the sphere phong shaded


Field Summary
 double Radius
          The radius of the spere
 
Fields inherited from class nl.kun.Engine3D.TEntity3D
color, GlobalCords, ParentGlobalCords, Vissible
 
Fields inherited from class nl.kun.Engine3D.TCoordSys3D
Xaxis, Yaxis, Zaxis
 
Fields inherited from class nl.kun.Engine3D.TVector3D
DBSCIENTIFIC, DBSTANDARD, x, y, z
 
Constructor Summary
TSphere3D()
          Empty constructor.
TSphere3D(double _x, double _y, double _z, double _R, java.awt.Color _cl)
          Constructor
TSphere3D(TSphere3D _Sphere)
          Copy constructor.
TSphere3D(TVector3D _p, double _R, java.awt.Color _cl)
          Constructor
 
Method Summary
 double Depth(TCamera3D _cam)
          This routine prerenders the objects and calculates the distances from the object to the camera (depth).
 void Draw(TCamera3D _cam, Viewport _viewport)
          Draws the vissible parts of this object onto the viewport, as if it where projecting itself on a camera.
 TSphere3D Sphere3D(double _x, double _y, double _z, double _R)
          A constructor like routine.
 TSphere3D Sphere3D(TVector3D _p, double _R)
          A constructor like routine.
 
Methods inherited from class nl.kun.Engine3D.TEntity3D
InheritGlobalCords, Rotate, Translate, Translate, Vector3D, Vector3D
 
Methods inherited from class nl.kun.Engine3D.TCoordSys3D
CoordSys3D, CoordSys3D, CoordSys3D, Global2Local, Global2Local, Global2Local, Local2Global, Local2Global, Local2Global, toString
 
Methods inherited from class nl.kun.Engine3D.TVector3D
Angle, Double2String, Double2String, Modulus, Modulus, Negate, Negate, Normalize, Normalize, NulVec, StdXaxis, StdYaxis, StdZaxis, String2Double, VAdd, VCrossProduct, VCrossProduct, VDotProduct, Vector3D, VPerpendicular, VPerpendicular, VScalarProduct, VScalarProduct, VScalarProduct, VSubstract, VSubstract
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Radius

public double Radius
The radius of the spere
Constructor Detail

TSphere3D

public TSphere3D(double _x,
                 double _y,
                 double _z,
                 double _R,
                 java.awt.Color _cl)
Constructor
Parameters:
_x - The x component of the center of the sphere
_y - The y component of the center of the sphere
_z - The z component of the center of the sphere
_R - The radius of the sphere
_cl - The color of the sphere

TSphere3D

public TSphere3D(TVector3D _p,
                 double _R,
                 java.awt.Color _cl)
Constructor
Parameters:
_p - The center of the sphere
_R - The radius of the sphere
_cl - The color of the sphere

TSphere3D

public TSphere3D(TSphere3D _Sphere)
Copy constructor.
Parameters:
_Sphere - Object that needs to be copied to this object

TSphere3D

public TSphere3D()
Empty constructor. Constructs a black sphere at (0,0,0) with radius 1.
Method Detail

Sphere3D

public TSphere3D Sphere3D(double _x,
                          double _y,
                          double _z,
                          double _R)
A constructor like routine. Changes the variables of the sphere.
Parameters:
_x - The x component of the center of the sphere
_y - The y component of the center of the sphere
_z - The z component of the center of the sphere
_R - The radius of the sphere

Sphere3D

public TSphere3D Sphere3D(TVector3D _p,
                          double _R)
A constructor like routine. Changes the variables of the sphere.
Parameters:
_p - The center of the sphere
_R - The radius of the sphere

Draw

public void Draw(TCamera3D _cam,
                 Viewport _viewport)
Description copied from class: TEntity3D
Draws the vissible parts of this object onto the viewport, as if it where projecting itself on a camera.
Overrides:
Draw in class TEntity3D
Tags copied from class: TEntity3D
Parameters:
_cam - The camera.
_Viewport - Viewport object. This viewport object handles clipping and transformation of real world coordinates to screen coordinates. It does the real drawing on the screen.
See Also:
TCamera3D, Viewport

Depth

public double Depth(TCamera3D _cam)
Description copied from class: TEntity3D
This routine prerenders the objects and calculates the distances from the object to the camera (depth). If more than one 3D object is inside this object, it returns the average depth. This depth can be used by a a parent TEntityList3D object to sort all TEntity3D's according to depth.
Overrides:
Depth in class TEntity3D
Tags copied from class: TEntity3D
Parameters:
_cam - The camera.