Skip to content
Snippets Groups Projects
Commit 94e0f2c8 authored by Radek Ošlejšek's avatar Radek Ošlejšek
Browse files

Added drawable line

parent befdabbe
No related branches found
No related tags found
No related merge requests found
package cz.fidentis.analyst.scene;
import com.jogamp.opengl.GL2;
import javax.vecmath.Point3d;
/**
* A line to be shown in the scene, e.g., to show a ray.
*
* @author Radek Oslejsek
*/
public class DrawableLine extends Drawable {
private final Point3d startPoint;
private final Point3d endPoint;
/**
* Constructor.
*
* @param start Start point
* @param end End point
*/
public DrawableLine(Point3d start, Point3d end) {
this.startPoint = start;
this.endPoint = end;
}
@Override
protected void renderObject(GL2 gl) {
gl.glBegin(GL2.GL_LINES);
gl.glVertex3d(startPoint.x, startPoint.y, startPoint.z);
gl.glVertex3d(endPoint.x, endPoint.y, endPoint.z);
gl.glEnd();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment