|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.sdsc.mbt.image.TileRenderer
A fairly direct port of Brian Paul's tile rendering library, found at http://www.mesa3d.org/brianp/TR.html. I've java-fied it, but the functionality is the same.
| Constructor Summary | |
TileRenderer()
Creates a new TileRender object |
|
| Method Summary | |
void |
beginTile(javax.media.opengl.GL gl)
Begins rendering a tile. |
boolean |
endTile(javax.media.opengl.GL gl)
Must be called after rendering the scene |
int |
getParam(int param)
Gets the parameters of this TileRender object |
void |
setImageBuffer(int format,
int type,
java.nio.Buffer image)
Sets the buffer in which to store the final image |
void |
setImageSize(int width,
int height)
Sets the desired size of the final image |
void |
setRowOrder(int order)
Sets the order of row traversal |
void |
setTileBuffer(int format,
int type,
java.nio.Buffer image)
Specify a buffer the tiles to be copied to. |
void |
setTileSize(int width,
int height,
int border)
Sets the size of the tiles to use in rendering. |
void |
trFrustum(double left,
double right,
double bottom,
double top,
double zNear,
double zFar)
Sets the perspective projection frustrum. |
void |
trOrtho(double left,
double right,
double bottom,
double top,
double zNear,
double zFar)
Sets the context to use an orthographic projection. |
void |
trPerspective(double fovy,
double aspect,
double zNear,
double zFar)
Convenient way to specify a perspective projection |
void |
trRasterPos3f(float x,
float y,
float z,
javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu)
Tile rendering causes problems with using glRasterPos3f, so you should use this replacement instead |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TileRenderer()
| Method Detail |
public void setTileSize(int width,
int height,
int border)
width - The width of the tiles. Must not be larger than the GL
contextheight - The height of the tiles. Must not be larger than the
GL contextborder - The width of the borders on each tile. This is needed
to avoid artifacts when rendering lines or points with
thickness > 1.
public void setTileBuffer(int format,
int type,
java.nio.Buffer image)
format - Interpreted as in glReadPixelstype - Interpreted as in glReadPixelsimage - The buffer itself. Must be large enough to contain a
tile, minus any borders
public void setImageSize(int width,
int height)
width - The width of the final imageheight - The height of the final image
public void setImageBuffer(int format,
int type,
java.nio.Buffer image)
format - Interpreted as in glReadPixelstype - Interpreted as in glReadPixelsimage - the buffer itself, must be large enough to hold the
final imagepublic int getParam(int param)
param - The parameter that is to be retrieved
public void setRowOrder(int order)
order - The row traversal order, must be
eitherTR_TOP_TO_BOTTOM or TR_BOTTOM_TO_TOP
public void trOrtho(double left,
double right,
double bottom,
double top,
double zNear,
double zFar)
left - As in glOrthoright - As in glOrthobottom - As in glOrthotop - As in glOrthozNear - As in glOrthozFar - As in glOrtho
public void trFrustum(double left,
double right,
double bottom,
double top,
double zNear,
double zFar)
left - As in glFrustrumright - As in glFrustrumbottom - As in glFrustrumtop - As in glFrustrumzNear - As in glFrustrumzFar - As in glFrustrum
public void trPerspective(double fovy,
double aspect,
double zNear,
double zFar)
fovy - As in gluPerspectiveaspect - As in gluPerspectivezNear - As in gluPerspectivezFar - As in gluPerspectivepublic void beginTile(javax.media.opengl.GL gl)
gl - The gl contextpublic boolean endTile(javax.media.opengl.GL gl)
gl - the gl context
public void trRasterPos3f(float x,
float y,
float z,
javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu)
x - As in glRasterPos3fy - As in glRasterPos3fz - As in glRasterPos3fgl - The gl contextglu - A GLU object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||