package org.jzy3d.plot3d.primitives.textured;

import java.util.ArrayList;
import java.util.List;

import org.jzy3d.colors.Color;
import org.jzy3d.maths.BoundingBox3d;
import org.jzy3d.maths.ConvexHull;
import org.jzy3d.maths.Coord2d;
import org.jzy3d.maths.Coord3d;
import org.jzy3d.maths.PlaneAxis;
import org.jzy3d.maths.Polygon2d;
import org.jzy3d.plot3d.primitives.AbstractComposite;
import org.jzy3d.plot3d.primitives.AbstractDrawable;
import org.jzy3d.plot3d.primitives.Point;
import org.jzy3d.plot3d.primitives.Quad;
import org.jzy3d.plot3d.primitives.selectable.Selectable;
import org.jzy3d.plot3d.rendering.view.Camera;

import com.jogamp.opengl.GL;
import com.jogamp.opengl.glu.GLU;


public class TexturedCylinder extends AbstractComposite implements Selectable, ITranslucent{
	public TexturedCylinder(MaskPair masks){
		this(new Coord3d(), Color.CYAN, Color.RED, masks);
	}
	
	public TexturedCylinder(Coord3d position, MaskPair masks){
		this(position, Color.CYAN, Color.RED, masks);
	}
	
	public TexturedCylinder(Coord3d position, Color color, Color bgcolor, MaskPair masks){
		alpha = 1;
		List mapping  = new ArrayList(4);
		mapping.add( new Coord2d(position.x-0.5, position.y-0.5) );
		mapping.add( new Coord2d(position.x+0.5, position.y-0.5) );
		mapping.add( new Coord2d(position.x+0.5, position.y+0.5) );
		mapping.add( new Coord2d(position.x-0.5, position.y+0.5) );
		
		dDiskDown  = new DrawableTexture(masks.bgMask, PlaneAxis.Z, position.z - 0.5f, mapping, bgcolor);
		dDiskUp    = new DrawableTexture(masks.bgMask, PlaneAxis.Z, position.z + 0.5f, mapping, bgcolor);
		dArrowDown = new DrawableTexture(masks.symbolMask, PlaneAxis.Z, position.z - 0.5f, mapping, color);
		dArrowUp   = new DrawableTexture(masks.symbolMask, PlaneAxis.Z, position.z + 0.5f, mapping, color);
		
		int slices = 20;
		float radius = 0.5f;
		float height = 1f;
		Coord3d pos = new Coord3d(position.x, position.y, position.z-0.5f);
		quads = new ArrayList(slices);
		for(int i=0; i getLastProjection(){
		return lastProjection;
	}	
	
	protected AbstractDrawable dArrowUp;
	protected AbstractDrawable dArrowDown;
	protected AbstractDrawable dDiskUp;
	protected AbstractDrawable dDiskDown;
	protected List quads;
	
	protected List lastProjection;
	protected Polygon2d lastHull;
	protected float alpha;
}

 

Ads help maintain this website.