If something seems wrong or incomplete, please enter a comment at the bottom of this page.
- source - main - QA - jsgraphics module
class jsgraphics::Ogl- top - revision - Static functionsGetBooleanboolean GetBoolean( pname )
arguments:
- GLenum pname
return value:
value of a selected parameter.
OpenGL API:
glGetBooleanv
GetIntegerinteger | Array GetInteger( pname [, count] )
arguments:
- GLenum pname
- integer count: is the number of expected values. If count is defined, the function will returns an array of values, else it returns a single value.
return value:
A value or an array of values of a selected parameter.
OpenGL API:
glGetIntegerv
GetDoublereal | Array GetDouble( pname [, count] )
arguments:
- GLenum pname
- integer count: is the number of expected values. If count is defined, the function will returns an array of values, else a single value.
return value:
A single value or an Array of values of the selected parameter.
OpenGL API:
glGetDoublev
Accumvoid Accum( op, value )
arguments:
- GLenum op
- real value
OpenGL API:
glAccum
AlphaFuncvoid AlphaFunc( func, ref )
arguments:
- GLenum op
- real ref
OpenGL API:
glAlphaFunc
Flushvoid Flush()
OpenGL API:
glFlush
Finishvoid Finish()
OpenGL API:
glFinish
Fogvoid Fog( pname, params )
arguments:
- GLenum pname
- value params: is either a number or an array of numbers.
OpenGL API:
glFogi, glFogf, glFogfv
Hintvoid Hint( target, mode )
arguments:
- GLenum target
- GLenum mode
OpenGL API:
glHint
Vertexvoid Vertex( x, y [, z] )
arguments:
- real x
- real y
- real z
OpenGL API:
glVertex3d, glVertex2d
Colorvoid Color( red, green, blue [, alpha] )
arguments:
- real red
- real green
- real blue
- real alpha
OpenGL API:
glColor4d, glColor3d
Normalvoid Normal( nx, ny, nz )
arguments:
- real nx
- real ny
- real nz
OpenGL API:
glNormal3d
TexCoordvoid TexCoord( s [, t [, r]] )
arguments:
- real s
- real t
- real r
OpenGL API:
glTexCoord1d, glTexCoord2d, glTexCoord3d
TexParametervoid TexParameter( target, pname, params )
arguments:
- GLenum target
- GLenum pname
- value params: is either a number or an array of numbers.
OpenGL API:
glTexParameteri, glTexParameterf, glTexParameterfv
TexEnvvoid TexEnv( target, pname, params )
arguments:
- GLenum target
- GLenum pname
- value params: is either a number or an array of numbers.
OpenGL API:
glTexEnvi, glTexEnvf, glTexEnvfv
LightModelvoid LightModel( pname, params )
arguments:
- GLenum pname
- value params: is either a number or an array of numbers.
OpenGL API:
glLightModeli, glLightModelf, glLightModelfv
Lightvoid Light( light, pname, params )
arguments:
- GLenum light
- GLenum pname
- value params: is either a number or an array of numbers.
OpenGL API:
glLighti, glLightf, glLightfv
Materialvoid Material( face, pname, params )
arguments:
- GLenum face
- GLenum pname
- value params: is either a number or an array of numbers.
OpenGL API:
glMateriali, glMaterialf, glMaterialfv
Enablevoid Enable( cap )
arguments:
- GLenum cap
OpenGL API:
glEnable
Disablevoid Disable( cap )
arguments:
- GLenum cap
OpenGL API:
glDisable
PointSizevoid PointSize( size )
arguments:
- real size
OpenGL API:
glPointSize
LineWidthvoid LineWidth( width )
arguments:
- real width
OpenGL API:
glLineWidth
ShadeModelvoid ShadeModel( mode )
arguments:
- GLenum mode
OpenGL API:
glShadeModel
BlendFuncvoid BlendFunc( fFactor, dFactor )
arguments:
- GLenum fFactor
- GLenum dFactor
OpenGL API:
glBlendFunc
DepthFuncvoid DepthFunc( func )
arguments:
- GLenum func
OpenGL API:
glDepthFunc
DepthRangevoid DepthRange( zNear, zFar )
arguments:
- real zNear
- real zFar
OpenGL API:
glDepthRange
CullFacevoid CullFace( mode )
arguments:
- GLenum mode
OpenGL API:
glCullFace
FrontFacevoid FrontFace( mode )
arguments:
- GLenum mode
OpenGL API:
glFrontFace
ClearStencilvoid ClearStencil( s )
arguments:
- integer s
OpenGL API:
glClearStencil
ClearDepthvoid ClearDepth( depth )
arguments:
- real depth
OpenGL API:
glClearDepth
ClearColorvoid ClearColor( red, green, blue, alpha )
arguments:
- real red
- real green
- real blue
- real alpha
OpenGL API:
glClearColor
ClearAccumvoid ClearAccum( red, green, blue, alpha )
arguments:
- real red
- real green
- real blue
- real alpha
OpenGL API:
glClearAccum
Clearvoid Clear( mask )
arguments:
- GLbitfield mask
OpenGL API:
glClear
ClipPlanevoid ClipPlane( plane, equation )
arguments:
- GLenum plane
- Array equation: array of real
OpenGL API:
glClipPlane
Viewportvoid Viewport( x, y, width, height )
arguments:
- integer x
- integer y
- integer width
- integer height
OpenGL API:
glViewport
Frustumvoid Frustum( left, right, bottom, top, zNear, zFar )
arguments:
- real left
- real right
- real bottom
- real top
- real zNear
- real zFar
OpenGL API:
glFrustum
Orthovoid Ortho( left, right, bottom, top, zNear, zFar )
arguments:
- real left
- real right
- real bottom
- real top
- real zNear
- real zFar
OpenGL API:
glOrtho
Perspectivevoid Perspective( fovy, zNear, zFar )
Set up a perspective projection matrix.
arguments:
- real fovy
- real zNear
- real zFar
note:
This is not an OpenGL API function.
OpenGL API:
glGetIntegerv, glFrustum
MatrixModevoid MatrixMode( mode )
arguments:
- GLenum mode
OpenGL API:
glMatrixMode
LoadIdentityvoid LoadIdentity()
OpenGL API:
glLoadIdentity
PushMatrixvoid PushMatrix()
OpenGL API:
glPushMatrix
PopMatrixvoid PopMatrix()
OpenGL API:
glPopMatrix
LoadMatrixvoid LoadMatrix( matrix )
arguments:
- value matrix: either a matrix object or an Array
OpenGL API:
glLoadMatrixf
Rotatevoid Rotate( angle, x, y, z )
arguments:
- real angle
- real x
- real y
- real z
OpenGL API:
glRotated
Translatevoid Translate( x, y [, z = 0] )
arguments:
- real x
- real y
- real z
OpenGL API:
glTranslated
Scalevoid Scale( x, y [, z = 1] )
arguments:
- real x
- real y
- real z
OpenGL API:
glScaled
NewListinteger NewList()
Returns a new display-list.
OpenGL API:
glNewList
DeleteListvoid DeleteList( list )
Deletes a display-list.
arguments:
- integer list
OpenGL API:
glDeleteLists
EndListvoid EndList()
OpenGL API:
glEndList
CallListvoid CallList( lists )
Calls one or more display-list.
arguments:
- value lists: is a single list name or an Array of list name.
OpenGL API:
glCallList, glCallLists
Beginvoid Begin( mode )
arguments:
- GLenum mode
OpenGL API:
glBegin
Endvoid End()
OpenGL API:
glEnd
PushAttribvoid PushAttrib( mask )
arguments:
- GLbitfield mask
OpenGL API:
glPushAttrib
PopAttribvoid PopAttrib()
OpenGL API:
glPopAttrib
GenTextureinteger GenTexture()
Returns a new texture name.
OpenGL API:
glGenTextures
BindTexturevoid BindTexture( target, texture )
arguments:
- GLenum target
- integer texture
OpenGL API:
glBindTexture
DeleteTexturevoid DeleteTexture( texture )
Deletes the given texture.
arguments:
- integer texture
OpenGL API:
glDeleteTextures
CopyTexImage2Dvoid CopyTexImage2D( level, internalFormat, x, y, width, height, [ border ] )
arguments:
- integer level
- integer internalFormat
- integer x
- integer y
- integer width
- integer height
- integer border
note:
The target is always a GL_TEXTURE_2D
OpenGL API:
glCopyTexImage2D
GenBufferinteger GenBuffer()
Returns a new buffer.
OpenGL API:
glGenBuffersARB
BindBuffervoid BindBuffer( target, buffer )
arguments:
- GLenum target
- integer buffer
OpenGL API:
glBindBufferARB
PointParametervoid PointParameter( pname, params )
arguments:
- GLenum pname
- value params: is a real or an Array of real.
OpenGL API:
glPointParameterf, glPointParameterfv
ActiveTexturevoid ActiveTexture( texture )
arguments:
- GLenum texture
OpenGL API:
glActiveTextureARB
ClientActiveTexturevoid ClientActiveTexture( texture )
arguments:
- GLenum texture
OpenGL API:
glClientActiveTextureARB
MultiTexCoordvoid MultiTexCoord( target, s [, t [, r]] )
arguments:
- GLenum target
- real s
- real t
- real r
OpenGL API:
glMultiTexCoord1d, glMultiTexCoord2d, glMultiTexCoord3d
LoadTrimeshvoid LoadTrimesh( trimesh )
DrawTrimeshvoid DrawTrimesh()
OpenGL API:
glVertexPointer
DefineTextureImagevoid DefineTextureImage( target, [internalformat], texture )
arguments:
- GLenum target
- integer internalformat: is the internal PixelFormat. If undefined, the function will use the format of texture.
- value texture: either a Texture object or an image object.
note:
This is not an OpenGL API function.
OpenGL API:
glPixelStorei, glTexImage2D
RenderToImageimage RenderToImage()
Returns the current contain of the viewport.
arguments:
- GLenum target
- integer internalformat: is the internal PixelFormat. If undefined, the function will use the format of texture.
- value texture: either a Texture object or an image object.
return value:
An image object.
note:
This is not an OpenGL API function.
OpenGL API:
glGenTextures, glBindTexture, glGetIntegerv, glCopyTexImage2D, glGetTexLevelParameteriv, glGetTexImage, glDeleteTextures
Static propertieserrorinteger error
OpenGL API:
glGetError
Native Interface- NIMatrix44Read
the current OpenGL matrix. See MatrixMode() to specifiy which matrix stack is the target forsubsequent matrix operations.
more informationOpenGL API Documentation
class jsgraphics::Transformation- top - revision - constructorconstructor( [initToIdentity] )
Creates a new Transformation object. If initToIdentity is given and true, the transformation is initialized to identity. Else the transformation is not initialized.
Clearthis Clear()
Reset the current transformation (set to identity).
ClearRotationthis ClearRotation()
Clear the rotation part of the current transformation.
ClearTranslationthis ClearTranslation()
Clear the translation part of the current transformation.
Loadthis Load( matrix )
Load a 4x4 matrix as the current transformation.
arguments:
- value matrix: an Array or an object that supports NIMatrix44Read native interface.
LoadRotationthis LoadRotation( matrix )
Load the rotation part of another matrix to the current matrix.
arguments:
- value matrix: an Array or an object that supports NIMatrix44Read native interface.
LoadTranslationthis LoadTranslation( matrix )
Load the translation part of another matrix to the current matrix.
arguments:
- value matrix: an Array or an object that supports NIMatrix44Read native interface.
Translationthis Translation( x, y, z )
Sets the translation part of the current transformation.
arguments:
- real x
- real y
- real z
Translatethis Translate( x, y, z )
Apply a translation to the current ransformation.
arguments:
- real x
- real y
- real z
RotationFromQuaternionthis RotationFromQuaternion( w, x, y, z )
Sets the rotation part from a quaternion.
arguments:
- real w
- real x
- real y
- real z
TaitBryanRotationthis TaitBryanRotation( roll, pitch, yaw )
Sets the Tait-Bryan rotation.
arguments:
- real roll
- real pitch
- real yaw
Rotationthis Rotation( angle, x, y, z )
Sets the rotation part of the current transformation.
arguments:
- real angle in degres
- real x
- real y
- real z
Rotatethis Rotate( angle, x, y, z )
Apply a rotation to the current ransformation.
arguments:
- real angle in degres
- real x
- real y
- real z
RotationXthis RotationX( angle )
Set the rotation around the X axis.
arguments:
- real angle in degres
RotationYthis RotationY( angle )
Set the rotation around the Y axis.
arguments:
- real angle in degres
RotationZthis RotationZ( angle )
Set the rotation around the Z axis.
arguments:
- real angle in degres
LookAtthis LookAt( x, y, z )
unavailable: need to be fixed.
arguments:
- real x
- real y
- real z
RotateToVectorthis RotateToVector( x, y, z )
Apply the (0,0,1)-(x,y,z) angle to the current transformation.
Invertthis Invert()
invert the current transformation.
Productthis Product( newTransformation )
Apply a newTransformation to the current transformation.
this = this . new
arguments:
- value newTransformation: an Array or an object that supports NIMatrix44Read native interface.
ReverseProductthis ReverseProduct( otherTransformation )
Apply the current transformation to the otherTransformation and stores the result to the current transformation.
this = new . this
arguments:
- value otherTransformation: an Array or an object that supports NIMatrix44Read native interface.
TransformVectorvoid TransformVector( vector )
Transforms the 3D or 4D vector by the current transformation.
arguments:
- Array vector
PropertiesN operatorreal N operator
Get or set a element of the current transformation matrix.
example:
var t = new Transformation();
t.Clear();
t[3] = 1;
t[7] = 2;
t[11] = 3; Native Interface- NIMatrix44Read
The current transformation matrix.
- top - main -
|