forked from iTzDyms/PiscinePHP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Cyril HERON
committed
Jan 13, 2015
1 parent
236d0c3
commit f7a7a05
Showing
8 changed files
with
86 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<- Render ---------------------------------------------------------------------- | ||
The Render class print 2D to screen, it can be used after the camera tranformations occured. | ||
|
||
new Render( $width, $height, $filename ); | ||
|
||
All fiels are reauiered, any other use is undefined. | ||
|
||
The class has 3 const for different renderisation mode: VERTEX, EDGE and RESTERIZE. | ||
The Class provides the following methods : | ||
|
||
void renderVertex( $screenVertex ) : print $screenVertex in the image contained. | ||
|
||
void renderSegment( Vertex $origin, Vertex $end ) : print a segment in the image contained going from origin to end. | ||
|
||
void renderRasterize( Triangle $triangle ) : render the rasterization of a triangle. | ||
|
||
void renderTriangle( Triangle $triangle, $mode ) : Render a triangle depending on mode choosen. | ||
|
||
void renderMesh( $mesh ) : Render a mesh depending on the mide choosen. | ||
|
||
void develop() : develop the image in the field specified when render was created. | ||
|
||
---------------------------------------------------------------------- Render -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<- Triangle ---------------------------------------------------------------------- | ||
The Triangle class handles the representation of a triangle. | ||
|
||
An instance can be created using 3 vertex: | ||
new Triangle( $A, $B, $C ); | ||
|
||
All fields are reauiered, any other use is undefined. | ||
|
||
The class provides the following methods : | ||
|
||
Vertex getA() : return a clone of $A; | ||
|
||
Vertex getB() : return a clone of $B; | ||
|
||
Vertex getC() : return a clone of $C; | ||
|
||
Bool getVisibility() : return true if the triangle is visible, this is only relevant for transformed triangle. | ||
|
||
void setVisibility( $val ) : set visiblity of the triangle. | ||
|
||
Vector getNormal() : return the normal vector of $this. | ||
|
||
Vertex getCentroid() : return the centroid point of $this. | ||
|
||
Number area() : return the area of a triangle. | ||
|
||
Color get_point_color( Vertex $p ) : return the color of a point ina triangle. | ||
---------------------------------------------------------------------- Triangle -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters