Crossfire JXClient, Trunk
Package Functions | Package Attributes | Static Package Attributes | Private Member Functions | List of all members
Model3D Class Reference
Collaboration diagram for Model3D:
Collaboration graph

Package Functions

void add (int p1, int p2)
 
int addVert (float x, float y, float z)
 
void compress ()
 
void findBB ()
 
 Model3D ()
 
 Model3D (InputStream is) throws IOException, FileFormatException
 
void paint (Graphics g)
 
void transform ()
 

Package Attributes

int con []
 
Matrix3D mat
 
int maxcon
 
int maxvert
 
int ncon
 
int nvert
 
boolean transformed
 
int tvert []
 
float vert []
 
float xmax
 
float xmin
 
float ymax
 
float ymin
 
float zmax
 
float zmin
 

Static Package Attributes

static Color gr []
 

Private Member Functions

void quickSort (int a[], int left, int right)
 
void swap (int a[], int i, int j)
 

Detailed Description

The representation of a 3D model

Definition at line 62 of file ThreeD.java.

Constructor & Destructor Documentation

◆ Model3D() [1/2]

Model3D.Model3D ( )
package

Definition at line 73 of file ThreeD.java.

References mat, Matrix3D.xrot(), and Matrix3D.yrot().

Here is the call graph for this function:

◆ Model3D() [2/2]

Model3D.Model3D ( InputStream  is) throws IOException, FileFormatException
package

Create a 3D model by parsing an input stream

Definition at line 80 of file ThreeD.java.

References add(), and addVert().

Here is the call graph for this function:

Member Function Documentation

◆ add()

void Model3D.add ( int  p1,
int  p2 
)
package

Add a line from vertex p1 to vertex p2

Definition at line 173 of file ThreeD.java.

References con, maxcon, ncon, nvert, and t.

Referenced by Model3D().

Here is the caller graph for this function:

◆ addVert()

int Model3D.addVert ( float  x,
float  y,
float  z 
)
package

Add a vertex to this model

Definition at line 152 of file ThreeD.java.

References maxvert, nvert, and vert.

Referenced by Model3D().

Here is the caller graph for this function:

◆ compress()

void Model3D.compress ( )
package

eliminate duplicate lines

Definition at line 272 of file ThreeD.java.

References con, ncon, and quickSort().

Referenced by ThreeD.run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findBB()

void Model3D.findBB ( )
package

Find the bounding box of this model

Definition at line 334 of file ThreeD.java.

References nvert, and vert.

Referenced by ThreeD.run().

Here is the caller graph for this function:

◆ paint()

void Model3D.paint ( Graphics  g)
package

Paint this model to a graphics context. It uses the matrix associated with this model to map from model space to screen space. The next version of the browser should have double buffering, which will make this much nicer

Definition at line 294 of file ThreeD.java.

References con, gr, ncon, nvert, transform(), tvert, and vert.

Referenced by ThreeD.paint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ quickSort()

void Model3D.quickSort ( int  a[],
int  left,
int  right 
)
private

Definition at line 212 of file ThreeD.java.

References a, and swap().

Referenced by compress().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swap()

void Model3D.swap ( int  a[],
int  i,
int  j 
)
private

Definition at line 264 of file ThreeD.java.

References a.

Referenced by quickSort().

Here is the caller graph for this function:

◆ transform()

void Model3D.transform ( )
package

Transform all the points in this model

Definition at line 199 of file ThreeD.java.

References mat, nvert, Matrix3D.transform(), transformed, tvert, and vert.

Referenced by paint().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ con

int Model3D.con[]
package

Definition at line 67 of file ThreeD.java.

Referenced by add(), compress(), and paint().

◆ gr

Color Model3D.gr[]
staticpackage

Definition at line 288 of file ThreeD.java.

Referenced by paint().

◆ mat

Matrix3D Model3D.mat
package

Definition at line 70 of file ThreeD.java.

Referenced by Model3D(), ThreeD.paint(), and transform().

◆ maxcon

int Model3D.maxcon
package

Definition at line 68 of file ThreeD.java.

Referenced by add().

◆ maxvert

int Model3D.maxvert
package

Definition at line 66 of file ThreeD.java.

Referenced by addVert().

◆ ncon

int Model3D.ncon
package

Definition at line 68 of file ThreeD.java.

Referenced by add(), compress(), and paint().

◆ nvert

int Model3D.nvert
package

Definition at line 66 of file ThreeD.java.

Referenced by add(), addVert(), findBB(), paint(), and transform().

◆ transformed

boolean Model3D.transformed
package

Definition at line 69 of file ThreeD.java.

Referenced by ThreeD.paint(), and transform().

◆ tvert

int Model3D.tvert[]
package

Definition at line 65 of file ThreeD.java.

Referenced by paint(), and transform().

◆ vert

float Model3D.vert[]
package

Definition at line 64 of file ThreeD.java.

Referenced by addVert(), findBB(), paint(), and transform().

◆ xmax

float Model3D.xmax
package

Definition at line 71 of file ThreeD.java.

Referenced by ThreeD.paint(), and ThreeD.run().

◆ xmin

float Model3D.xmin
package

Definition at line 71 of file ThreeD.java.

Referenced by ThreeD.paint(), and ThreeD.run().

◆ ymax

float Model3D.ymax
package

Definition at line 71 of file ThreeD.java.

Referenced by ThreeD.paint(), and ThreeD.run().

◆ ymin

float Model3D.ymin
package

Definition at line 71 of file ThreeD.java.

Referenced by ThreeD.paint(), and ThreeD.run().

◆ zmax

float Model3D.zmax
package

Definition at line 71 of file ThreeD.java.

Referenced by ThreeD.paint(), and ThreeD.run().

◆ zmin

float Model3D.zmin
package

Definition at line 71 of file ThreeD.java.

Referenced by ThreeD.paint(), and ThreeD.run().


The documentation for this class was generated from the following file: