Aviatrix3D 1.0

org.j3d.aviatrix3d
Interface CustomRenderable

All Superinterfaces:
Renderable

public interface CustomRenderable
extends Renderable

Marker interface for all leaf objects that wish to implement custom rendering capabilities beyond just the basic GL callbacks, combining the custom culling of Cullable with the rendering callbacks of RenderableComponent.

This interface is used by programmers that require fairly complex implementation logic at the point of rendering. An example of this is volume rendering that requires a set of viewpoint-specific cutting planes to be generated every frame. This is not achievable using the standard renderable interfaces as they have no way of determining the current viewpoint and transformation stack during the rendering process. This is made worse by a node that could have multiple parents, thus multiple transformation paths to it within a single cull traversal. A developer uses this class to take the given culling information to generate a set of custom instructions that are passed back at culling time, then later passed back during the rendering phase.

Assumable Preconditions

Implementor Requirements

Implementor Guidelines

Version:
$Revision: 1.3 $
Author:
Justin Couch

Method Summary
 boolean hasTransparency()
          Check to see if this renderable object has anything that could be interpreted as an alpha value.
 boolean processCull(CullInstructions output, javax.vecmath.Matrix4f vworldTx, javax.vecmath.Matrix4f viewTransform, javax.vecmath.Vector4f[] frustumPlanes, float angularRes)
          This node is being subjected to culling, so process the provided data and return the instructions to the culling system.
 void render(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu, java.lang.Object externalData)
          Render object now using the pre-given set of custom rendering details.
 

Method Detail

hasTransparency

public boolean hasTransparency()
Check to see if this renderable object has anything that could be interpreted as an alpha value. For example a Raster with RGBA values or vertex geometry with 4-component colours for the vertices. Transparency information is needed for depth sorting during rendering.


processCull

public boolean processCull(CullInstructions output,
                           javax.vecmath.Matrix4f vworldTx,
                           javax.vecmath.Matrix4f viewTransform,
                           javax.vecmath.Vector4f[] frustumPlanes,
                           float angularRes)
This node is being subjected to culling, so process the provided data and return the instructions to the culling system. If additional rendering instructions will be needed at the point that the render(GL, GLU, Object) method is called, then formulate that now, and hand it back as part of the query mechanism.

The culler will not make use of the children or numChildren variables as part of the culling system. Only the return value of this method is used to determine if this object should be placed into the queue for sorting and rendering.

Parameters:
output - Fill in the cull information here
vworldTx - The transformation from the root of the scene to this node according to the current traversal path
viewTransform - The transformation from the root of the scene graph to the active viewpoint
frustumPlanes - Listing of frustum planes in the order: right, left, bottom, top, far, near
angularRes - Angular resolution of the screen, or 0 if not calculable from the available data.
Returns:
true if this should be rendered, false otherwise

render

public void render(net.java.games.jogl.GL gl,
                   net.java.games.jogl.GLU glu,
                   java.lang.Object externalData)
Render object now using the pre-given set of custom rendering details.

Parameters:
gl - The GL context to render with
glu - The GL utility context to render with
externalData - Some implementation-specific external data to aid in the rendering that was generated in the processCull method.

Aviatrix3D 1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2005 j3d.org