org.jzy3d.plot3d.primitives.textured
Class DrawableTexture
- java.lang.Object
-
- org.jzy3d.plot3d.primitives.AbstractDrawable
-
- org.jzy3d.plot3d.primitives.textured.DrawableTexture
-
- All Implemented Interfaces:
- IGLRenderer, ISortableDraw, ITranslucent
- Direct Known Subclasses:
- PickableTexture
public class DrawableTexture extends AbstractDrawable implements ITranslucent
ADrawableTexturecan only mount its texture while the GL2 thread is current, so the best is to let draw() automount texture file the first time the resource is required. When a texture is loaded for the first time, it updates the current view bounds since the texture bounds where up to now unknown and fixed to origin with no width. ADrawableTexturerequires a color filter (default is white), and a set of coordinates defining the polygon on which the texture should be drawn. This texture implementation impose the texture to be perpendicular to aPlaneAxis. It is thus defined with 2d Coordinates in the plane defined by the {PlaneAxis, axisValue}
-
-
Constructor Summary
Constructors Constructor and Description DrawableTexture(SharedTexture resource)DrawableTexture(SharedTexture resource, PlaneAxis orientation)DrawableTexture(SharedTexture resource, PlaneAxis orientation, float axisValue)DrawableTexture(SharedTexture resource, PlaneAxis orientation, float axisValue, Color filter)DrawableTexture(SharedTexture resource, PlaneAxis orientation, float axisValue, java.util.List<Coord2d> coords)DrawableTexture(SharedTexture resource, PlaneAxis orientation, float axisValue, java.util.List<Coord2d> coords, Color filter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidapplyGeometryTransform(Transform transform)voiddebugMapping()voiddraw(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam)Call OpenGL2 routines for rendering the object.BoundingBox3dgetBounds()Return the BoundingBox of this object.ColorgetColorFilter()static java.util.List<Coord2d>getManualTextureMapping(float width, float height)static java.util.List<Coord2d>getManualTextureMapping(float width, float height, float xoffset, float yoffset)Must supply the expected size of texture in 3d coordinates.Coord2dgetPlanePosition()SharedTexturegetResource()TransformgetTextureScale()voidsetAlphaFactor(float a)voidsetColorFilter(Color filter)voidsetPlanePosition(Coord2d planePosition)voidsetResource(SharedTexture resource)voidsetTextureScale(Transform textureScale)voidupdateBounds()-
Methods inherited from class org.jzy3d.plot3d.primitives.AbstractDrawable
addDrawableListener, dispose, doTransform, getBarycentre, getBoundingBoxColor, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString, toString
-
-
-
-
Constructor Detail
-
DrawableTexture
public DrawableTexture(SharedTexture resource)
-
DrawableTexture
public DrawableTexture(SharedTexture resource, PlaneAxis orientation)
-
DrawableTexture
public DrawableTexture(SharedTexture resource, PlaneAxis orientation, float axisValue)
-
DrawableTexture
public DrawableTexture(SharedTexture resource, PlaneAxis orientation, float axisValue, Color filter)
-
DrawableTexture
public DrawableTexture(SharedTexture resource, PlaneAxis orientation, float axisValue, java.util.List<Coord2d> coords)
-
DrawableTexture
public DrawableTexture(SharedTexture resource, PlaneAxis orientation, float axisValue, java.util.List<Coord2d> coords, Color filter)
-
-
Method Detail
-
getColorFilter
public Color getColorFilter()
-
setColorFilter
public void setColorFilter(Color filter)
-
setAlphaFactor
public void setAlphaFactor(float a)
- Specified by:
setAlphaFactorin interfaceITranslucent
-
getManualTextureMapping
public static java.util.List<Coord2d> getManualTextureMapping(float width, float height, float xoffset, float yoffset)
Must supply the expected size of texture in 3d coordinates.- Returns:
-
getManualTextureMapping
public static java.util.List<Coord2d> getManualTextureMapping(float width, float height)
-
debugMapping
public void debugMapping()
-
getBounds
public BoundingBox3d getBounds()
Description copied from class:AbstractDrawableReturn the BoundingBox of this object.- Overrides:
getBoundsin classAbstractDrawable- Returns:
- a bounding box
-
getPlanePosition
public Coord2d getPlanePosition()
-
setPlanePosition
public void setPlanePosition(Coord2d planePosition)
-
getTextureScale
public Transform getTextureScale()
-
setTextureScale
public void setTextureScale(Transform textureScale)
-
draw
public void draw(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam)Description copied from class:AbstractDrawableCall OpenGL2 routines for rendering the object.- Specified by:
drawin interfaceIGLRenderer- Specified by:
drawin classAbstractDrawable- Parameters:
gl- GL2 contextglu- GLU contextcam- a reference to a shooting Camera.
-
getResource
public SharedTexture getResource()
-
setResource
public void setResource(SharedTexture resource)
-
applyGeometryTransform
public void applyGeometryTransform(Transform transform)
- Specified by:
applyGeometryTransformin classAbstractDrawable
-
updateBounds
public void updateBounds()
- Specified by:
updateBoundsin classAbstractDrawable
-
-
DMelt 3.0 © DataMelt by jWork.ORG