Tetrapak.java
Go to the documentation of this file.
00001 package edu.tum.cs.ias.knowrob.vis.items;
00002 
00003 import javax.vecmath.Matrix4d;
00004 import javax.vecmath.Vector3d;
00005 
00006 import processing.core.PConstants;
00007 import edu.tum.cs.ias.knowrob.vis.Canvas;
00008 
00009 public class Tetrapak extends Item {
00010 
00011         public Tetrapak(float m00, float m01, float m02, float m03, float m10,
00012                         float m11, float m12, float m13, float m20, float m21, float m22,
00013                         float m23, float m30, float m31, float m32, float m33, float xdim,
00014                         float ydim, float zdim) {
00015                 
00016                 super(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31,
00017                                 m32, m33, xdim, ydim, zdim);
00018         }
00019         
00020         public Tetrapak(Matrix4d pose, Vector3d dim){
00021                 super(pose, dim);
00022         }
00023         
00024         @Override
00025         public void drawIt(Canvas c) {
00026 
00027                 // translate it down by half its height
00028                 c.translate(0.0f, 0.0f, -0.125f);
00029 
00030                 // "wrapper"
00031                 c.beginShape(PConstants.QUAD_STRIP);
00032                 c.vertex(0.05f, 0.05f, 0f);    c.vertex(-0.05f,  0.05f,0f);
00033                 c.vertex(0.05f, 0.05f, 0.20f); c.vertex(-0.05f,  0.05f,0.20f);
00034                 c.vertex(0.05f, 0f,    0.25f); c.vertex(-0.05f,  0f,   0.25f);
00035                 c.vertex(0.05f,-0.05f, 0.20f); c.vertex(-0.05f, -0.05f,0.20f);
00036                 c.vertex(0.05f,-0.05f, 0f);    c.vertex(-0.05f, -0.05f,0f);
00037                 c.endShape(PConstants.CLOSE);
00038                 
00039                 // front side
00040                 c.beginShape(PConstants.TRIANGLE_STRIP);
00041                 c.vertex(-0.05f, 0.05f,0);
00042                 c.vertex(-0.05f,-0.05f,0);
00043                 c.vertex(-0.05f, 0.05f,0.20f);
00044                 c.vertex(-0.05f,-0.05f,0.20f);
00045                 c.vertex(-0.05f, 0,    0.25f);
00046                 c.endShape();
00047                 
00048                 // back side
00049                 c.beginShape(PConstants.TRIANGLE_STRIP);
00050                 c.vertex(0.05f, 0.05f,0);
00051                 c.vertex(0.05f,-0.05f,0);
00052                 c.vertex(0.05f, 0.05f,0.20f);
00053                 c.vertex(0.05f,-0.05f,0.20f);
00054                 c.vertex(0.05f, 0,    0.25f);
00055                 c.endShape();
00056 
00057         }
00058 }


mod_vis
Author(s): Moritz Tenorth, Jakob Engel
autogenerated on Mon Oct 6 2014 01:30:00