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 |
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.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 |
Radius
public double Radius
- The radius of the spere
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.
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.