@Override public void push(GLGraphics2D newG2d) { gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW); gl.glPushMatrix(); }
gl2.glPushMatrix(); gl2.glRotatef(180f, 0, 0, -1); gl2.glTranslatef((float) (-width / 1f), (float) (-height / 2f), -650f); gl2.glPushMatrix(); gl2.glColor4f(.5f,.5f,.5f,1); gl2.glRotatef(-180f, 0, -1, 0); gl2.glTranslatef(0f, 0, 30f); gl2.glPushMatrix(); gl2.glRotatef(90f, 0, -1, 0); gl2.glTranslatef(0,0,5); glut.glutSolidCone(15f, 50f, 12, 12); gl2.glPopMatrix(); gl2.glPushMatrix(); gl2.glRotatef(90f, 0, 1, 0); gl2.glTranslatef(0,0,5);
textures[i].bind(gl2); textures[i].enable(gl2); gl2.glPushMatrix(); gl2.glTranslatef((float)(width/2), (float)(height/2), 0); gl2.glRotatef(180, 0, 0, -1); textures[i].bind(gl2); textures[i].enable(gl2); gl2.glPushMatrix(); gl2.glTranslatef((float)(width/2), (float)(height/2), 0); gl2.glRotatef(180, 0, 0, -1); gl2.glPushMatrix(); gl2.glTranslatef((float)(width/2), (float)(height/2), 0); gl2.glRotatef(angle/2f, 0, 0, 1); gl2.glPushMatrix(); gl2.glTranslatef((float)(width/2), (float)(height/2), 0); gl2.glRotatef(180, 0, -1, 0);
@Override public void beginPoly(int windingRule) { /* * pen hangs down and to the right. See java.awt.Graphics */ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW); gl.glPushMatrix(); gl.glTranslatef(0.5f, 0.5f, 0); super.beginPoly(windingRule); }
public void drawBoundingBox(BoundingBox box, Matrix4 transform) { gl.glPushMatrix(); gl.glMultMatrixf(transform.val, 0); drawBoundingBox(box); gl.glPopMatrix(); }
@Override public void beginPoly(int windingRule) { /* * pen hangs down and to the right. See java.awt.Graphics */ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW); gl.glPushMatrix(); gl.glTranslatef(0.5f, 0.5f, 0); super.beginPoly(windingRule); }
private void drawActiveSpot(GL2 gl, Point3d activeSpot, boolean isHighlightedEditor, EditorType editorType, double distanceRatio) { gl.glPushMatrix(); gl.glTranslated(activeSpot.x, activeSpot.y, activeSpot.z); EditorMode highlight = EditorMode.HIGHLIGHT_2; if (isHighlightedEditor) { highlight = EditorMode.HIGHLIGHT_1; } double camDistanceRatio = distanceRatio * Editor.SELECTION_ETITOR_CAMERA_RATIO; activeSpotDrawer.drawEditor(gl, camDistanceRatio, editorType, highlight); gl.glPopMatrix(); }
private static void drawArrow(GL2 gl, GLU glu, GLUquadric quadratic, double editorRadius) { double length = 2d * editorRadius; double arrowheadLength = 1d * editorRadius; double baseRadius = 0.1d * editorRadius; double arrowheadRadius = 0.6d * editorRadius; gl.glPushMatrix(); gl.glTranslated(0, -length / 2d, 0); ArrowDrawUtil.drawArrow(gl, glu, quadratic, length, arrowheadLength, baseRadius, arrowheadRadius, NUMBER_OF_SECTIONS); gl.glPopMatrix(); } }
@Override public void beginPoly(int windingRule) { buffer.clear(); /* * pen hangs down and to the right. See java.awt.Graphics */ gl.glMatrixMode(GL2.GL_MODELVIEW); gl.glPushMatrix(); gl.glTranslatef(0.5f, 0.5f, 0); gl.glPushAttrib(GL2.GL_LINE_BIT | GL2.GL_POINT_BIT); }
public void render(GL2 gl2) { paintBackground(gl2); paintCamera(gl2); gl2.glPushMatrix(); if (robot != null) { robot.render(gl2); } gl2.glPopMatrix(); } }
@Override public void beginPoly(int windingRule) { buffer.clear(); /* * pen hangs down and to the right. See java.awt.Graphics */ gl.glMatrixMode(GL2.GL_MODELVIEW); gl.glPushMatrix(); gl.glTranslatef(0.5f, 0.5f, 0); gl.glPushAttrib(GL2.GL_LINE_BIT | GL2.GL_POINT_BIT); }
public void drawCylinder(double baseRadius, double topRadius, double height, double x, double y, double z) { final int slices = DEFAULT_RESOLUTION; final int stacks = DEFAULT_RESOLUTION; gl.glPushMatrix(); // Draw sphere (possible styles: FILL, LINE, POINT). //gl.glColor3f(0.3f, 0.5f, 1f); gl.glTranslated(x, y, z); GLUquadric cylinder = generateQuadric(glu); glu.gluCylinder(cylinder, baseRadius, topRadius, height, slices, stacks); glu.gluDeleteQuadric(cylinder); gl.glPopMatrix(); }
@Override protected void paintMotors(GL2 gl2,MakelangeloRobotSettings settings) { double top = settings.getLimitTop(); double bottom = settings.getLimitBottom(); double right = settings.getLimitRight(); double left = settings.getLimitLeft(); gl2.glPushMatrix(); gl2.glTranslated(left , top , 0); gl2.glRotated(270, 0, 0, 1); paintOneMotor(gl2); gl2.glPopMatrix(); gl2.glPushMatrix(); gl2.glTranslated(right, top , 0); gl2.glRotated(180, 0, 0, 1); paintOneMotor(gl2); gl2.glPopMatrix(); gl2.glPushMatrix(); gl2.glTranslated(right, bottom, 0); gl2.glRotated( 90, 0, 0, 1); paintOneMotor(gl2); gl2.glPopMatrix(); gl2.glPushMatrix(); gl2.glTranslated(left , bottom, 0); gl2.glRotated( 0, 0, 0, 1); paintOneMotor(gl2); gl2.glPopMatrix(); }
@Override public void draw(GL2 pGl, Camera camera) { pGl.glPushMatrix(); pGl.glTranslated(getGlobalX(), 0, -getGlobalY()); try { modelRender.render(pGl, model); } finally { pGl.glPopMatrix(); } }
@Override public void draw(Graphics3D g) { AWTGraphics3D graphics = (AWTGraphics3D) g; GL2 gl = graphics.getGL2(); gl.glPushMatrix(); setupTextureAttribs(gl); renderTextured(gl); resetTextureAttribs(gl); gl.glPopMatrix(); }
public void drawSphere(double radius, double x, double y, double z, int resolution, Color color) { final int slices = resolution; final int stacks = resolution; gl.glPushMatrix(); glSetColor(color); gl.glTranslated(x, y, z); GLUquadric sphere = generateQuadric(glu); glu.gluSphere(sphere, radius, slices, stacks); glu.gluDeleteQuadric(sphere); gl.glPopMatrix(); }
protected void begin(TextRenderer renderer) { setTextColorRespectComposite(renderer); GL2 gl = g2d.getGLContext().getGL().getGL2(); gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW); gl.glPushMatrix(); gl.glScalef(1, -1, 1); gl.glTranslatef(0, -g2d.getCanvasHeight(), 0); renderer.begin3DRendering(); }
protected void begin(TextRenderer renderer) { setTextColorRespectComposite(renderer); GL2 gl = g2d.getGLContext().getGL().getGL2(); gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW); gl.glPushMatrix(); gl.glScalef(1, -1, 1); gl.glTranslatef(0, -g2d.getCanvasHeight(), 0); renderer.begin3DRendering(); }
public void rotateText(GL gl, Coord3d posReal) { gl.getGL2().glPushMatrix(); gl.getGL2().glMatrixMode(GLMatrixFunc.GL_MODELVIEW); loadIdentity(gl); rotateOf(gl, 90, AXE_Z); translateTo(gl, posReal, false); gl.getGL2().glScalef(scale.x, scale.y, scale.z); gl.getGL2().glPopMatrix(); }
@Override protected void paintCalibrationPoint(GL2 gl2, MakelangeloRobotSettings settings) { gl2.glPushMatrix(); gl2.glTranslated(settings.getHomeX(), settings.getHomeY(), 0); gl2.glColor3f(0.8f, 0.8f, 0.8f); gl2.glBegin(GL2.GL_LINES); gl2.glVertex2f(-0.25f, 0.0f); gl2.glVertex2f(0.25f, 0.0f); gl2.glVertex2f(0.0f, -0.25f); gl2.glVertex2f(0.0f, 0.25f); gl2.glEnd(); gl2.glPopMatrix(); }