mCircle = new Line3D(points, mLineThickness, mColor); mCircle.setMaterial(material); mCircle.setDrawingMode(GLES20.GL_LINES); mCircle.enableLookAt(); addChild(mCircle); mLine = new Line3D(points, mLineThickness, mColor); mLine.setMaterial(material); mLine.setDrawingMode(GLES20.GL_LINES); mLine.enableLookAt(); addChild(mLine);
/** * Creates a line primitive with a specified color for each point. * * @param points * @param thickness * @param colors * @param createVBOs */ public Line3D(Stack<Vector3> points, float thickness, int[] colors, boolean createVBOs) { super(); mPoints = points; mLineThickness = thickness; mColors = colors; if (colors != null && colors.length != points.size()) throw new RuntimeException("The number of line points and colors is not the same."); init(createVBOs); }
/** * Creates a line primitive with a single color. * * @param points * @param thickness * @param color */ public Line3D(Stack<Vector3> points, float thickness, int color) { this(points, thickness, null); setColor(color); }
protected void init(boolean createVBOs) { setDoubleSided(true); setDrawingMode(GLES20.GL_LINE_STRIP); setData(vertices, null, null, colors, indices, createVBOs);
private void updateLightTransform(Camera camera) { if(mCircle == null) createLines(); mCircle.setLookAt(camera.getPosition()); mCircle.setScale(mPosition.distanceTo(camera.getPosition()) * 0.1f); mCircle.setPosition(mLight.getPosition()); mLine.setPosition(mLight.getPosition()); mLine.setOrientation(mLight.getOrientation()); }
ret.addChild(new Line3D(currentLayer.getPoints(), 1f, Color.argb(255, 0x55, 0x11, 0xEF))); currentLayer = new GCodeLayer();
private void updateLightTransform(Camera camera) { if(mCircle == null) createLines(); mCircle.setLookAt(camera.getPosition()); mCircle.setScale(mPosition.distanceTo(camera.getPosition()) * 0.1f); mCircle.setPosition(mLight.getPosition()); mLine.setPosition(mLight.getPosition()); mLine.setOrientation(mLight.getOrientation()); }
protected void init(boolean createVBOs) { setDoubleSided(true); setDrawingMode(GLES20.GL_LINE_STRIP); setData(vertices, null, null, colors, indices, createVBOs);
ret.addChild(new Line3D(currentLayer.getPoints(), 1f, Color.argb(255, 0x55, 0x11, 0xEF))); currentLayer = new GCodeLayer();
mCircle = new Line3D(points, mLineThickness, mColor); mCircle.setMaterial(material); mCircle.setDrawingMode(GLES20.GL_LINES); mCircle.enableLookAt(); addChild(mCircle); mLine = new Line3D(points, mLineThickness, mColor); mLine.setMaterial(material); mLine.setDrawingMode(GLES20.GL_LINES); mLine.enableLookAt(); addChild(mLine);
/** * Creates a line primitive with a single color. * * @param points * @param thickness * @param color */ public Line3D(Stack<Vector3> points, float thickness, int color) { this(points, thickness, null); setColor(color); }
/** * Creates a line primitive with a specified color for each point. * * @param points * @param thickness * @param colors * @param createVBOs */ public Line3D(Stack<Vector3> points, float thickness, int[] colors, boolean createVBOs) { super(); mPoints = points; mLineThickness = thickness; mColors = colors; if (colors != null && colors.length != points.size()) throw new RuntimeException("The number of line points and colors is not the same."); init(createVBOs); }