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.Vector3f
backBottomLeft
private int
backBottomLeftIndex
private WildMagic.LibFoundation.Mathematics.Vector3f
backBottomRight
private int
backBottomRightIndex
private java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
backFace
private WildMagic.LibFoundation.Mathematics.Vector3f
backTopLeft
private int
backTopLeftIndex
private WildMagic.LibFoundation.Mathematics.Vector3f
backTopRight
private int
backTopRightIndex
private java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
bottomFace
private WildMagic.LibFoundation.Mathematics.Vector3f
centerBox
private boolean[]
clippedPoints
private WildMagic.LibFoundation.Mathematics.Vector3f[]
cornerPoints
private WildMagic.LibFoundation.Mathematics.Vector3f
frontBottomLeft
private int
frontBottomLeftIndex
private WildMagic.LibFoundation.Mathematics.Vector3f
frontBottomRight
private int
frontBottomRightIndex
private java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
frontFace
private WildMagic.LibFoundation.Mathematics.Vector3f
frontTopLeft
private int
frontTopLeftIndex
private WildMagic.LibFoundation.Mathematics.Vector3f
frontTopRight
private int
frontTopRightIndex
private VolumeImage[]
hyperStack
private WildMagic.LibGraphics.Rendering.Texture
hyperstackColormap
private WildMagic.LibFoundation.Mathematics.Matrix4f
kWorldInv
private java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
leftFace
private float
m_fMax
Normalized volume extents:private WildMagic.LibFoundation.Mathematics.Plane3f
m_kCullPlane
private WildMagic.LibGraphics.Rendering.MaterialState
m_kMaterial
Material properties for Volume Surface (and Composite Surface) modeprivate WildMagic.LibGraphics.SceneGraph.TriMesh
m_kMesh
Volume proxy-geometry (cube)private WildMagic.LibGraphics.Rendering.Renderer
m_kRenderer
private VolumeShaderEffectMultiPass
m_kVolumeShaderEffect
VolumeShaderEffect applied to proxy-geometry:private WildMagic.LibGraphics.Effects.ShaderEffect
m_spkVertexColor3Shader
Vertex-color shader effect used for the polylines and the first-pass rendering of the proxy-geometry:private int
numPoints
private float
planeConstant
private int[]
reorderedList
private java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
rightFace
private WildMagic.LibFoundation.Mathematics.Vector3f[]
rotatedPoints
private 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.TriMesh
Box(int iXBound, int iYBound, int iZBound)
Called by CreateBox.private void
checkMeshPoints()
Check that the currently loaded proxy geometry is the default cube, if it is not reload it onto the GPU.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.void
CMPMode()
Display the volume in Composite mode.private void
computeIntersections()
Compute the cube-plane intersection.private void
CreateBox()
Called by CreateScene.void
CreateScene()
Called by the init() function.private void
cullBackBottomLeft()
Creates a re-mapping of the cube corners so the back bottom left corner is at position 0 in the reorderedList.private void
cullBackBottomRight()
Creates a re-mapping of the cube corners so the back bottom right corner is at position 0 in the reorderedList.private void
cullBackTopLeft()
Creates a re-mapping of the cube corners so the back top left corner is at position 0 in the reorderedList.private void
cullBackTopRight()
Creates a re-mapping of the cube corners so the back top right corner is at position 0 in the reorderedList.private void
cullFrontBottomLeft()
Creates a re-mapping of the cube corners so the front bottom left corner is at position 0 in the reorderedList.private void
cullFrontBottomRight()
Creates a re-mapping of the cube corners so the front bottom right corner is at position 0 in the reorderedList.private void
cullFrontTopLeft()
Creates a re-mapping of the cube corners so the front top left corner is at position 0 in the reorderedList.private void
cullFrontTopRight()
Creates a re-mapping of the cube corners so the front top right corner is at position 0 in the reorderedList.private void
cullPoints(float[] clippedDistance)
1.void
dispose(WildMagic.LibGraphics.Rendering.Renderer kRenderer)
delete local memory.void
DRRMode()
Display the volume in DDR mode.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.private void
fillBox(WildMagic.LibGraphics.SceneGraph.VertexBuffer pkVB)
Fills in the values for the default cube.float
getABBlend()
VolumeClipEffect
GetClipEffect()
Return current clipping state.boolean
GetGradientMagnitude()
boolean
getImageOn(int which)
WildMagic.LibGraphics.Rendering.MaterialState
GetMaterialState()
Called from the JPanelDisplay dialog.WildMagic.LibGraphics.SceneGraph.TriMesh
getMesh()
VolumeShaderEffectMultiPass
GetShaderEffect()
Returns the VolumeShaderEffect.WildMagic.LibFoundation.Mathematics.Vector3f
GetTranslate()
Returns the translation vector.WildMagic.LibFoundation.Mathematics.Matrix4f
GetWorld()
void
MIPMode()
Display the volume in MIP mode.void
MULTIHISTOMode(boolean bOn)
Display the volume in Multi-histo mode.private void
PreRender(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller)
PreRender renders the proxy geometry into the PBuffer texture.void
printProgram()
private WildMagic.LibGraphics.SceneGraph.TriMesh
reCreateBox(int iXBound, int iYBound, int iZBound)
void
reCreateScene(VolumeImage image)
void
reCreateScene(VolumeImage imageA, VolumeImage imageB)
void
recreateShaderEffect(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.Rendering.Texture targetTexture)
void
releaseShaderEffect(WildMagic.LibGraphics.Rendering.Renderer kRenderer)
void
ReloadVolumeShader(WildMagic.LibGraphics.Rendering.Renderer kRenderer)
Reloads the VolumeShaderEffect current shader program.void
Render(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller, boolean bPreRender, boolean bSolid)
Render the object.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.void
SelfShadow(boolean bShadow)
Enables/Disables self-shadowing in the Surface mode.void
setABBlend(float fValue)
Sets blending between imageA and imageB.void
SetBackgroundColor(WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)
Sets the background color.void
SetClip(int iWhich, float data, boolean bEnable)
Sets axis-aligned clipping for the VolumeShaderEffect.void
SetClipArb(float[] afEquation, boolean bEnable)
Sets arbitrary clipping for the VolumeShaderEffect.void
SetClipArbInv(float[] afEquation, boolean bEnable)
Sets arbitrary clipping for the VolumeShaderEffect.void
SetClipEye(float[] afEquation, boolean bEnable)
Sets eye clipping for the VolumeShaderEffect.void
SetClipEyeInv(float[] afEquation, boolean bEnable)
Sets inverse-eye clipping for the VolumeShaderEffect.void
SetClipOBB(WildMagic.LibFoundation.Mathematics.Vector3f center, WildMagic.LibFoundation.Mathematics.Vector3f scale, WildMagic.LibFoundation.Mathematics.Vector3f[] axes, float[] extents, boolean bEnable)
void
SetClipSphere(WildMagic.LibFoundation.Mathematics.Vector3f center, WildMagic.LibFoundation.Mathematics.Vector3f scale, float radius, boolean bEnable)
void
SetCustomBlend(int iBlendEquation, int iLogicOp, int iSrcBlend, int iDstBlend, WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)
void
SetGradientMagnitude(boolean bShow)
Enables/Disables Gradient Magnitude filter.void
setHyperStack(VolumeImage[] images, WildMagic.LibGraphics.Rendering.Texture colormap)
void
setImageOn(int which, boolean on)
void
SetLight(java.lang.String kLightType, float[] afType)
Sets lighting in the VolumeShaderEffect.void
SetMaterialState(WildMagic.LibGraphics.Rendering.MaterialState kMaterial)
Called from the AdvancedMaterialProperties dialog.void
setPlaneConstant(float _constant)
Set the front the clipping plane constantvoid
setRGBTA(ModelRGB RGBT)
void
setRGBTB(ModelRGB RGBT)
void
setVolumeBlend(float fBlend)
Sets the blend factor for displaying the ray-cast volume with other objects in the scene.int
setVolumeSamples(float fSample)
void
SURFASTMode()
Display the volume in Surface mode.void
SURMode()
Display the volume in Composite Surface mode.void
updateLevWidgetState(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:
dispose
in 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:
GetTranslate
in 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:
Render
in 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:
SetLight
in 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
-
-
-