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

Merge branch '176-add-drawable-line' into 'master'

Resolve "Add drawable line"

Closes #176

See merge request grp-fidentis/analyst2!185
parents befdabbe 94e0f2c8
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