Aviatrix3D
2.1.0

org.j3d.aviatrix3d.rendering
Interface CustomRenderable

All Superinterfaces:
java.lang.Comparable, 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 rendering of Cullable with the rendering callbacks of ComponentRenderable.

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 rendering information to generate a set of custom instructions that are passed back at rendering time, then later passed back during the rendering phase.

Assumable Preconditions

Implementor Requirements

Implementor Guidelines

Version:
$Revision: 2.2 $
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(RenderableInstructions output, javax.vecmath.Matrix4f vworldTx, javax.vecmath.Matrix4f viewTransform, javax.vecmath.Vector4f[] frustumPlanes, float angularRes)
          This node is being subjected to rendering, so process the provided data and return the instructions to the rendering system.
 void render(javax.media.opengl.GL gl, java.lang.Object externalData)
          Render object now using the pre-given set of custom rendering details.
 
Methods inherited from interface org.j3d.aviatrix3d.rendering.Renderable
equals
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

hasTransparency

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

boolean processCull(RenderableInstructions output,
                    javax.vecmath.Matrix4f vworldTx,
                    javax.vecmath.Matrix4f viewTransform,
                    javax.vecmath.Vector4f[] frustumPlanes,
                    float angularRes)
This node is being subjected to rendering, so process the provided data and return the instructions to the rendering system. If additional rendering instructions will be needed at the point that the render(GL, 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 rendering 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

void render(javax.media.opengl.GL gl,
            java.lang.Object externalData)
Render object now using the pre-given set of custom rendering details.

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

Aviatrix3D
2.1.0

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