Class VolumeRayCast
- java.lang.Object
-
- gov.nih.mipav.view.renderer.WildMagic.Render.VolumeObject
-
- gov.nih.mipav.view.renderer.WildMagic.Render.VolumeRayCast
-
public class VolumeRayCast extends VolumeObject
- Author:
- alexa
-
-
Field Summary
Fields Modifier and Type Field Description private WildMagic.LibFoundation.Mathematics.Vector3fbackBottomLeftprivate intbackBottomLeftIndexprivate WildMagic.LibFoundation.Mathematics.Vector3fbackBottomRightprivate intbackBottomRightIndexprivate java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>backFaceprivate WildMagic.LibFoundation.Mathematics.Vector3fbackTopLeftprivate intbackTopLeftIndexprivate WildMagic.LibFoundation.Mathematics.Vector3fbackTopRightprivate intbackTopRightIndexprivate java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>bottomFaceprivate WildMagic.LibFoundation.Mathematics.Vector3fcenterBoxprivate boolean[]clippedPointsprivate WildMagic.LibFoundation.Mathematics.Vector3f[]cornerPointsprivate WildMagic.LibFoundation.Mathematics.Vector3ffrontBottomLeftprivate intfrontBottomLeftIndexprivate WildMagic.LibFoundation.Mathematics.Vector3ffrontBottomRightprivate intfrontBottomRightIndexprivate java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>frontFaceprivate WildMagic.LibFoundation.Mathematics.Vector3ffrontTopLeftprivate intfrontTopLeftIndexprivate WildMagic.LibFoundation.Mathematics.Vector3ffrontTopRightprivate intfrontTopRightIndexprivate VolumeImage[]hyperStackprivate WildMagic.LibGraphics.Rendering.TexturehyperstackColormapprivate WildMagic.LibFoundation.Mathematics.Matrix4fkWorldInvprivate java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>leftFaceprivate floatm_fMaxNormalized volume extents:private WildMagic.LibFoundation.Mathematics.Plane3fm_kCullPlaneprivate WildMagic.LibGraphics.Rendering.MaterialStatem_kMaterialMaterial properties for Volume Surface (and Composite Surface) modeprivate WildMagic.LibGraphics.SceneGraph.TriMeshm_kMeshVolume proxy-geometry (cube)private WildMagic.LibGraphics.Rendering.Rendererm_kRendererprivate VolumeShaderEffectMultiPassm_kVolumeShaderEffectVolumeShaderEffect applied to proxy-geometry:private WildMagic.LibGraphics.Effects.ShaderEffectm_spkVertexColor3ShaderVertex-color shader effect used for the polylines and the first-pass rendering of the proxy-geometry:private intnumPointsprivate floatplaneConstantprivate int[]reorderedListprivate java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>rightFaceprivate WildMagic.LibFoundation.Mathematics.Vector3f[]rotatedPointsprivate java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>topFace-
Fields inherited from class gov.nih.mipav.view.renderer.WildMagic.Render.VolumeObject
m_bDisplay, m_bPickable, m_bTransparent, m_fVolumeDiv, m_fVolumeMult, m_fX, m_fY, m_fZ, m_kAlpha, m_kAlphaTransparency, m_kCull, m_kDeleteList, m_kLightShader, m_kLocalScale, m_kPolygonOffset, m_kResolutions, m_kScene, m_kTranslate, m_kVolumeImageA, m_kVolumeImageB, m_kVolumeScale, m_kVolumeTrans, m_kWireframe, m_kZBuffer, m_kZBufferTransparency
-
-
Constructor Summary
Constructors Constructor Description VolumeRayCast(VolumeImage kImageA, VolumeImage kImageB)Creates a new VolumeRayCast object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private WildMagic.LibGraphics.SceneGraph.TriMeshBox(int iXBound, int iYBound, int iZBound)Called by CreateBox.private voidcheckMeshPoints()Check that the currently loaded proxy geometry is the default cube, if it is not reload it onto the GPU.voidCheckViewIntersection(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller)The volume data is rendered with a fragment (pixel) shader on the GPU.voidCMPMode()Display the volume in Composite mode.private voidcomputeIntersections()Compute the cube-plane intersection.private voidCreateBox()Called by CreateScene.voidCreateScene()Called by the init() function.private voidcullBackBottomLeft()Creates a re-mapping of the cube corners so the back bottom left corner is at position 0 in the reorderedList.private voidcullBackBottomRight()Creates a re-mapping of the cube corners so the back bottom right corner is at position 0 in the reorderedList.private voidcullBackTopLeft()Creates a re-mapping of the cube corners so the back top left corner is at position 0 in the reorderedList.private voidcullBackTopRight()Creates a re-mapping of the cube corners so the back top right corner is at position 0 in the reorderedList.private voidcullFrontBottomLeft()Creates a re-mapping of the cube corners so the front bottom left corner is at position 0 in the reorderedList.private voidcullFrontBottomRight()Creates a re-mapping of the cube corners so the front bottom right corner is at position 0 in the reorderedList.private voidcullFrontTopLeft()Creates a re-mapping of the cube corners so the front top left corner is at position 0 in the reorderedList.private voidcullFrontTopRight()Creates a re-mapping of the cube corners so the front top right corner is at position 0 in the reorderedList.private voidcullPoints(float[] clippedDistance)1.voiddispose(WildMagic.LibGraphics.Rendering.Renderer kRenderer)delete local memory.voidDRRMode()Display the volume in DDR mode.private voidfillBox(WildMagic.LibGraphics.SceneGraph.IndexBuffer pkIB)Generates the triangle -index array connectivity for the default cube, stores the index array in the input IndexBuffer.private voidfillBox(WildMagic.LibGraphics.SceneGraph.VertexBuffer pkVB)Fills in the values for the default cube.floatgetABBlend()VolumeClipEffectGetClipEffect()Return current clipping state.booleanGetGradientMagnitude()booleangetImageOn(int which)WildMagic.LibGraphics.Rendering.MaterialStateGetMaterialState()Called from the JPanelDisplay dialog.WildMagic.LibGraphics.SceneGraph.TriMeshgetMesh()VolumeShaderEffectMultiPassGetShaderEffect()Returns the VolumeShaderEffect.WildMagic.LibFoundation.Mathematics.Vector3fGetTranslate()Returns the translation vector.WildMagic.LibFoundation.Mathematics.Matrix4fGetWorld()voidMIPMode()Display the volume in MIP mode.voidMULTIHISTOMode(boolean bOn)Display the volume in Multi-histo mode.private voidPreRender(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller)PreRender renders the proxy geometry into the PBuffer texture.voidprintProgram()private WildMagic.LibGraphics.SceneGraph.TriMeshreCreateBox(int iXBound, int iYBound, int iZBound)voidreCreateScene(VolumeImage image)voidreCreateScene(VolumeImage imageA, VolumeImage imageB)voidrecreateShaderEffect(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.Rendering.Texture targetTexture)voidreleaseShaderEffect(WildMagic.LibGraphics.Rendering.Renderer kRenderer)voidReloadVolumeShader(WildMagic.LibGraphics.Rendering.Renderer kRenderer)Reloads the VolumeShaderEffect current shader program.voidRender(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller, boolean bPreRender, boolean bSolid)Render the object.private voidretriangulate(java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> intersectionPoints)Generates the new VertexBuffer and IndexBuffer for the retriangulated faces of the cube based on how the cube intersects with the clipping plane.voidSelfShadow(boolean bShadow)Enables/Disables self-shadowing in the Surface mode.voidsetABBlend(float fValue)Sets blending between imageA and imageB.voidSetBackgroundColor(WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)Sets the background color.voidSetClip(int iWhich, float data, boolean bEnable)Sets axis-aligned clipping for the VolumeShaderEffect.voidSetClipArb(float[] afEquation, boolean bEnable)Sets arbitrary clipping for the VolumeShaderEffect.voidSetClipArbInv(float[] afEquation, boolean bEnable)Sets arbitrary clipping for the VolumeShaderEffect.voidSetClipEye(float[] afEquation, boolean bEnable)Sets eye clipping for the VolumeShaderEffect.voidSetClipEyeInv(float[] afEquation, boolean bEnable)Sets inverse-eye clipping for the VolumeShaderEffect.voidSetClipOBB(WildMagic.LibFoundation.Mathematics.Vector3f center, WildMagic.LibFoundation.Mathematics.Vector3f scale, WildMagic.LibFoundation.Mathematics.Vector3f[] axes, float[] extents, boolean bEnable)voidSetClipSphere(WildMagic.LibFoundation.Mathematics.Vector3f center, WildMagic.LibFoundation.Mathematics.Vector3f scale, float radius, boolean bEnable)voidSetCustomBlend(int iBlendEquation, int iLogicOp, int iSrcBlend, int iDstBlend, WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)voidSetGradientMagnitude(boolean bShow)Enables/Disables Gradient Magnitude filter.voidsetHyperStack(VolumeImage[] images, WildMagic.LibGraphics.Rendering.Texture colormap)voidsetImageOn(int which, boolean on)voidSetLight(java.lang.String kLightType, float[] afType)Sets lighting in the VolumeShaderEffect.voidSetMaterialState(WildMagic.LibGraphics.Rendering.MaterialState kMaterial)Called from the AdvancedMaterialProperties dialog.voidsetPlaneConstant(float _constant)Set the front the clipping plane constantvoidsetRGBTA(ModelRGB RGBT)voidsetRGBTB(ModelRGB RGBT)voidsetVolumeBlend(float fBlend)Sets the blend factor for displaying the ray-cast volume with other objects in the scene.intsetVolumeSamples(float fSample)voidSURFASTMode()Display the volume in Surface mode.voidSURMode()Display the volume in Composite Surface mode.voidupdateLevWidgetState(java.util.Vector<ClassificationWidget> kLWS)-
Methods inherited from class gov.nih.mipav.view.renderer.WildMagic.Render.VolumeObject
Blend, Dropper, Erase, GetBackface, getDepth, GetDisplay, GetMesh, GetName, GetPickable, GetPolygonMode, GetScene, getTexCoord, localToScannerCoords, localToVolumeCoords, Paint, PostRender, scale, SetBackface, SetColor, SetDisplay, SetFrontface, setImageB, SetPickable, SetPolygonMode, SetTranslate, Translate, volumeToLocalCoords
-
-
-
-
Field Detail
-
m_kVolumeShaderEffect
private VolumeShaderEffectMultiPass m_kVolumeShaderEffect
VolumeShaderEffect applied to proxy-geometry:
-
m_spkVertexColor3Shader
private WildMagic.LibGraphics.Effects.ShaderEffect m_spkVertexColor3Shader
Vertex-color shader effect used for the polylines and the first-pass rendering of the proxy-geometry:
-
m_fMax
private float m_fMax
Normalized volume extents:
-
m_kMaterial
private WildMagic.LibGraphics.Rendering.MaterialState m_kMaterial
Material properties for Volume Surface (and Composite Surface) mode
-
m_kMesh
private WildMagic.LibGraphics.SceneGraph.TriMesh m_kMesh
Volume proxy-geometry (cube)
-
numPoints
private final int numPoints
- See Also:
- Constant Field Values
-
centerBox
private WildMagic.LibFoundation.Mathematics.Vector3f centerBox
-
clippedPoints
private boolean[] clippedPoints
-
cornerPoints
private WildMagic.LibFoundation.Mathematics.Vector3f[] cornerPoints
-
rotatedPoints
private WildMagic.LibFoundation.Mathematics.Vector3f[] rotatedPoints
-
reorderedList
private int[] reorderedList
-
frontBottomLeftIndex
private final int frontBottomLeftIndex
- See Also:
- Constant Field Values
-
frontBottomRightIndex
private final int frontBottomRightIndex
- See Also:
- Constant Field Values
-
frontTopRightIndex
private final int frontTopRightIndex
- See Also:
- Constant Field Values
-
frontTopLeftIndex
private final int frontTopLeftIndex
- See Also:
- Constant Field Values
-
backBottomLeftIndex
private final int backBottomLeftIndex
- See Also:
- Constant Field Values
-
backBottomRightIndex
private final int backBottomRightIndex
- See Also:
- Constant Field Values
-
backTopRightIndex
private final int backTopRightIndex
- See Also:
- Constant Field Values
-
backTopLeftIndex
private final int backTopLeftIndex
- See Also:
- Constant Field Values
-
frontBottomLeft
private WildMagic.LibFoundation.Mathematics.Vector3f frontBottomLeft
-
frontBottomRight
private WildMagic.LibFoundation.Mathematics.Vector3f frontBottomRight
-
frontTopRight
private WildMagic.LibFoundation.Mathematics.Vector3f frontTopRight
-
frontTopLeft
private WildMagic.LibFoundation.Mathematics.Vector3f frontTopLeft
-
backBottomLeft
private WildMagic.LibFoundation.Mathematics.Vector3f backBottomLeft
-
backBottomRight
private WildMagic.LibFoundation.Mathematics.Vector3f backBottomRight
-
backTopRight
private WildMagic.LibFoundation.Mathematics.Vector3f backTopRight
-
backTopLeft
private WildMagic.LibFoundation.Mathematics.Vector3f backTopLeft
-
m_kCullPlane
private WildMagic.LibFoundation.Mathematics.Plane3f m_kCullPlane
-
planeConstant
private float planeConstant
-
m_kRenderer
private WildMagic.LibGraphics.Rendering.Renderer m_kRenderer
-
kWorldInv
private WildMagic.LibFoundation.Mathematics.Matrix4f kWorldInv
-
topFace
private java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> topFace
-
bottomFace
private java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> bottomFace
-
leftFace
private java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> leftFace
-
rightFace
private java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> rightFace
-
frontFace
private java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> frontFace
-
backFace
private java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> backFace
-
hyperStack
private VolumeImage[] hyperStack
-
hyperstackColormap
private WildMagic.LibGraphics.Rendering.Texture hyperstackColormap
-
-
Constructor Detail
-
VolumeRayCast
public VolumeRayCast(VolumeImage kImageA, VolumeImage kImageB)
Creates a new VolumeRayCast object.- Parameters:
kImageA- the VolumeImage containing the data and textures for rendering.kVolumeImageB- second VolumeImage.
-
-
Method Detail
-
CheckViewIntersection
public void CheckViewIntersection(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller)The volume data is rendered with a fragment (pixel) shader on the GPU. The shader is activated by rendering a volume proxy geometry, which is a cube that matches the volume bounding box. One problem with this technique for rendering volume data is that when the bounding-volume proxy geometry is clipped by the view-frustum near-plane the geometry is no longer rendered on the GPU and therefore the fragment shader is no longer activated. This causes the volume rendering to disappear as the user tries to zoom into it. This function automatically detects clipping of the volume proxy-geometry by the view-frustum near-plane as the camera moves into the volume. When clipping is detected, the algorithm generates a new triangle mesh by intersecting the near-plane with the original bounding-cube. The new triangle mesh serves as the volume proxy geometry. The result is the appearance of moving inside the volume as the user zooms the camera. The default cube is always the starting point for the algorithm, even if a non-cube shape is currently displayed as the volume proxy geometry.- Parameters:
kRenderer-kCuller-
-
setPlaneConstant
public void setPlaneConstant(float _constant)
Set the front the clipping plane constant- Parameters:
_constant- contant between 0 to 0.01;
-
CMPMode
public void CMPMode()
Display the volume in Composite mode.
-
CreateScene
public void CreateScene()
Called by the init() function. Creates and initialized the scene-graph.- Parameters:
eFormat- FrameBuffer.FormatTypeeDepth- FrameBuffer.DepthTypeeStencil- FrameBuffer.StencilTypeeBuffering- FrameBuffer.BufferingTypeeMultisampling- FrameBuffer.MultisamplingTypeiWidth- canvas widthiHeight- canvas heightarg0- the GLCanvaskRenderer- the OpenGLRenderer.
-
reCreateScene
public void reCreateScene(VolumeImage image)
-
reCreateScene
public void reCreateScene(VolumeImage imageA, VolumeImage imageB)
-
dispose
public void dispose(WildMagic.LibGraphics.Rendering.Renderer kRenderer)
delete local memory.- Overrides:
disposein classVolumeObject
-
DRRMode
public void DRRMode()
Display the volume in DDR mode.
-
getABBlend
public float getABBlend()
-
GetClipEffect
public VolumeClipEffect GetClipEffect()
Return current clipping state.- Returns:
- current clipping state.
-
GetGradientMagnitude
public boolean GetGradientMagnitude()
-
GetMaterialState
public WildMagic.LibGraphics.Rendering.MaterialState GetMaterialState()
Called from the JPanelDisplay dialog. Gets the material properties for the VolumeShaderSUR (Surface and Composite Surface volume shaders.)- Returns:
- material properties for the surface mode.
-
getMesh
public WildMagic.LibGraphics.SceneGraph.TriMesh getMesh()
-
GetShaderEffect
public VolumeShaderEffectMultiPass GetShaderEffect()
Returns the VolumeShaderEffect.- Returns:
- the VolumeShaderEffect.
-
GetTranslate
public WildMagic.LibFoundation.Mathematics.Vector3f GetTranslate()
Returns the translation vector.- Overrides:
GetTranslatein classVolumeObject- Returns:
- the translation vector.
-
GetWorld
public WildMagic.LibFoundation.Mathematics.Matrix4f GetWorld()
-
MIPMode
public void MIPMode()
Display the volume in MIP mode.
-
MULTIHISTOMode
public void MULTIHISTOMode(boolean bOn)
Display the volume in Multi-histo mode.
-
printProgram
public void printProgram()
-
setHyperStack
public void setHyperStack(VolumeImage[] images, WildMagic.LibGraphics.Rendering.Texture colormap)
-
setImageOn
public void setImageOn(int which, boolean on)
-
getImageOn
public boolean getImageOn(int which)
-
recreateShaderEffect
public void recreateShaderEffect(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.Rendering.Texture targetTexture)
-
releaseShaderEffect
public void releaseShaderEffect(WildMagic.LibGraphics.Rendering.Renderer kRenderer)
-
ReloadVolumeShader
public void ReloadVolumeShader(WildMagic.LibGraphics.Rendering.Renderer kRenderer)
Reloads the VolumeShaderEffect current shader program.- Parameters:
kRenderer- the OpenGLRenderer object.
-
Render
public void Render(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller, boolean bPreRender, boolean bSolid)Render the object.- Specified by:
Renderin classVolumeObject- Parameters:
kRenderer- the OpenGLRenderer object.kCuller- the Culler object.
-
SelfShadow
public void SelfShadow(boolean bShadow)
Enables/Disables self-shadowing in the Surface mode.- Parameters:
bShadow- shadow on/off.
-
setABBlend
public void setABBlend(float fValue)
Sets blending between imageA and imageB.- Parameters:
fValue- the blend value (0-1)
-
SetBackgroundColor
public void SetBackgroundColor(WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)
Sets the background color.- Parameters:
kColor- new background color.
-
SetClip
public void SetClip(int iWhich, float data, boolean bEnable)Sets axis-aligned clipping for the VolumeShaderEffect.- Parameters:
afClip- the clipping parameters for axis-aligned clipping.
-
SetClipArb
public void SetClipArb(float[] afEquation, boolean bEnable)Sets arbitrary clipping for the VolumeShaderEffect.- Parameters:
afEquation- the arbitrary-clip plane equation.
-
SetClipArbInv
public void SetClipArbInv(float[] afEquation, boolean bEnable)Sets arbitrary clipping for the VolumeShaderEffect.- Parameters:
afEquation- the arbitrary-clip plane equation.
-
SetClipEye
public void SetClipEye(float[] afEquation, boolean bEnable)Sets eye clipping for the VolumeShaderEffect.- Parameters:
afEquation- the eye clipping equation.
-
SetClipEyeInv
public void SetClipEyeInv(float[] afEquation, boolean bEnable)Sets inverse-eye clipping for the VolumeShaderEffect.- Parameters:
afEquation- the inverse-eye clipping equation.
-
SetClipSphere
public void SetClipSphere(WildMagic.LibFoundation.Mathematics.Vector3f center, WildMagic.LibFoundation.Mathematics.Vector3f scale, float radius, boolean bEnable)
-
SetClipOBB
public void SetClipOBB(WildMagic.LibFoundation.Mathematics.Vector3f center, WildMagic.LibFoundation.Mathematics.Vector3f scale, WildMagic.LibFoundation.Mathematics.Vector3f[] axes, float[] extents, boolean bEnable)
-
SetCustomBlend
public void SetCustomBlend(int iBlendEquation, int iLogicOp, int iSrcBlend, int iDstBlend, WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)
-
SetGradientMagnitude
public void SetGradientMagnitude(boolean bShow)
Enables/Disables Gradient Magnitude filter.- Parameters:
bShow- gradient magnitude filter on/off
-
SetLight
public void SetLight(java.lang.String kLightType, float[] afType)Sets lighting in the VolumeShaderEffect.- Overrides:
SetLightin classVolumeObject- Parameters:
kLightType- name of the light to set.afType- the type of light to set.
-
SetMaterialState
public void SetMaterialState(WildMagic.LibGraphics.Rendering.MaterialState kMaterial)
Called from the AdvancedMaterialProperties dialog. Sets the material properties for the VolumeShaderSUR (Surface and Composite Surface volume shaders.)- Parameters:
kMaterial- new material properties for the surface mode.
-
setRGBTA
public void setRGBTA(ModelRGB RGBT)
-
setRGBTB
public void setRGBTB(ModelRGB RGBT)
-
setVolumeBlend
public void setVolumeBlend(float fBlend)
Sets the blend factor for displaying the ray-cast volume with other objects in the scene.- Parameters:
fBlend- the blend factor for the ray-cast volume.
-
setVolumeSamples
public int setVolumeSamples(float fSample)
-
SURFASTMode
public void SURFASTMode()
Display the volume in Surface mode.
-
SURMode
public void SURMode()
Display the volume in Composite Surface mode.
-
updateLevWidgetState
public void updateLevWidgetState(java.util.Vector<ClassificationWidget> kLWS)
-
Box
private WildMagic.LibGraphics.SceneGraph.TriMesh Box(int iXBound, int iYBound, int iZBound)Called by CreateBox. Creates the bounding-box proxy geometry (VertexBuffer, IndexBuffer).- Parameters:
iXBound- image x-extent.iYBound- image y-extent.iZBound- image z-extent.- Returns:
- TriMesh, new geometry.
-
reCreateBox
private WildMagic.LibGraphics.SceneGraph.TriMesh reCreateBox(int iXBound, int iYBound, int iZBound)
-
checkMeshPoints
private void checkMeshPoints()
Check that the currently loaded proxy geometry is the default cube, if it is not reload it onto the GPU.
-
computeIntersections
private void computeIntersections()
Compute the cube-plane intersection. Remove clipped points from each face of the cube that intersects the clipping-plane. Add the intersection points to clipped faces. This is done while maintaining the counter-clockwise ordering of the points on the cube faces.
-
CreateBox
private void CreateBox()
Called by CreateScene. Creates the bounding-box proxy geometry scene node.
-
cullBackBottomLeft
private void cullBackBottomLeft()
Creates a re-mapping of the cube corners so the back bottom left corner is at position 0 in the reorderedList. The other points are added to the list based on the cube connectivity.
-
cullBackBottomRight
private void cullBackBottomRight()
Creates a re-mapping of the cube corners so the back bottom right corner is at position 0 in the reorderedList. The other points are added to the list based on the cube connectivity.
-
cullBackTopLeft
private void cullBackTopLeft()
Creates a re-mapping of the cube corners so the back top left corner is at position 0 in the reorderedList. The other points are added to the list based on the cube connectivity.
-
cullBackTopRight
private void cullBackTopRight()
Creates a re-mapping of the cube corners so the back top right corner is at position 0 in the reorderedList. The other points are added to the list based on the cube connectivity.
-
cullFrontBottomLeft
private void cullFrontBottomLeft()
Creates a re-mapping of the cube corners so the front bottom left corner is at position 0 in the reorderedList. The other points are added to the list based on the cube connectivity.
-
cullFrontBottomRight
private void cullFrontBottomRight()
Creates a re-mapping of the cube corners so the front bottom right corner is at position 0 in the reorderedList. The other points are added to the list based on the cube connectivity.
-
cullFrontTopLeft
private void cullFrontTopLeft()
Creates a re-mapping of the cube corners so the front top left corner is at position 0 in the reorderedList. The other points are added to the list based on the cube connectivity.
-
cullFrontTopRight
private void cullFrontTopRight()
Creates a re-mapping of the cube corners so the front top right corner is at position 0 in the reorderedList. The other points are added to the list based on the cube connectivity.
-
cullPoints
private void cullPoints(float[] clippedDistance)
1. Determine which of the cube corners is the furthest along the negative z-direction (0,0,-1). This corner is clipped by the view-frustum and will serve and the starting corner in creating the new mesh surface.- Parameters:
clippedDistance-
-
fillBox
private void fillBox(WildMagic.LibGraphics.SceneGraph.IndexBuffer pkIB)
Generates the triangle -index array connectivity for the default cube, stores the index array in the input IndexBuffer.- Parameters:
pkIB-
-
fillBox
private void fillBox(WildMagic.LibGraphics.SceneGraph.VertexBuffer pkVB)
Fills in the values for the default cube. Writes the values into the input VertexBuffer. Fills in the position, color, and texture coordinates.- Parameters:
pkVB-
-
PreRender
private void PreRender(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller)PreRender renders the proxy geometry into the PBuffer texture.- Parameters:
kRenderer- the OpenGLRenderer object.kCuller- the Culler object.
-
retriangulate
private void retriangulate(java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> intersectionPoints)
Generates the new VertexBuffer and IndexBuffer for the retriangulated faces of the cube based on how the cube intersects with the clipping plane. Each of the faces: top, bottom, front, back, left, right have points listed in counter-clockwise order. Where the clipping plane intersects the face the clipped points have been removed and the new intersection points have been added -- always maintaining the ccw ordering of the points. This way we can automatically generate the triangle mesh by adding up the points and calculating the number of triangles per face. The input list represents the new face -- the one generated by the clip plane intersecting the cube.- Parameters:
intersectionPoints-
-
-