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
A DrawableTexture
can 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.
A DrawableTexture
requires a color filter (default is white), and a
set of coordinates defining the polygon on which the texture should be drawn.
- Author:
- Martin
Constructor Summary |
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,
List<Coord2d> coords)
|
DrawableTexture(SharedTexture resource,
PlaneAxis orientation,
float axisValue,
List<Coord2d> coords,
Color filter)
|
Methods inherited from class org.jzy3d.plot3d.primitives.AbstractDrawable |
addDrawableListener, call, call, callWithAlphaFactor, dispose, doDrawBounds, doTransform, fireDrawableChanged, fireDrawableChanged, getBarycentre, getBoundingBoxColor, getDistance, getLegend, getLongestDistance, getShortestDistance, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, negative, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setTransform, setTransformBefore, toString, toString |
textureScale
protected Transform textureScale
resource
protected SharedTexture resource
orientation
protected PlaneAxis orientation
texMatMix
protected float[] texMatMix
filter
protected Color filter
axisValue
protected float axisValue
mapping
protected List<Coord2d> mapping
alpha
protected float alpha
planePosition
protected Coord2d planePosition
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,
List<Coord2d> coords)
DrawableTexture
public DrawableTexture(SharedTexture resource,
PlaneAxis orientation,
float axisValue,
List<Coord2d> coords,
Color filter)
getColorFilter
public Color getColorFilter()
setColorFilter
public void setColorFilter(Color filter)
setAlphaFactor
public void setAlphaFactor(float a)
- Specified by:
setAlphaFactor
in interface ITranslucent
initBoundsWithMapping
protected void initBoundsWithMapping()
initBoundsWithResources
protected void initBoundsWithResources()
getDefaultTextureMapping
protected List<Coord2d> getDefaultTextureMapping()
getManualTextureMapping
public static 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 List<Coord2d> getManualTextureMapping(float width,
float height)
debugMapping
public void debugMapping()
getBounds
public BoundingBox3d getBounds()
- Description copied from class:
AbstractDrawable
- Return the BoundingBox of this object.
- Overrides:
getBounds
in class AbstractDrawable
- 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(javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu,
Camera cam)
- Description copied from class:
AbstractDrawable
- Call OpenGL2 routines for rendering the object.
- Specified by:
draw
in interface IGLRenderer
- Specified by:
draw
in class AbstractDrawable
- Parameters:
gl
- GL2 contextglu
- GLU contextcam
- a reference to a shooting Camera.
before
protected void before(javax.media.opengl.GL gl)
after
protected void after(javax.media.opengl.GL gl)
getResource
public SharedTexture getResource()
setResource
public void setResource(SharedTexture resource)
applyGeometryTransform
public void applyGeometryTransform(Transform transform)
- Specified by:
applyGeometryTransform
in class AbstractDrawable
updateBounds
public void updateBounds()
- Specified by:
updateBounds
in class AbstractDrawable
Copyright © 2013. All rights reserved.