Examples of GL


Examples of de.dermoba.srcp.devices.GL

        }
        if (locomotive.getSession() == null && session != null) {
            locomotive.setSession(session);
        }
        if (locomotive.getGL() == null) {
            GL gl = new GL(session);
            gl.setBus(locomotive.getBus());
            gl.setAddress(locomotive.getAddress());
            locomotive.setGL(gl);
            lockControl.registerControlObject(
                    "GL",
                    new SRCPAddress(locomotive.getBus(), locomotive
                            .getAddress()), locomotive);
View Full Code Here

Examples of de.dermoba.srcp.devices.GL

            }
            int drivingSteps = locomotive.getDrivingSteps();
            if (speed < 0 || speed > drivingSteps) {
                return;
            }
            GL gl = locomotive.getGL();
            switch (locomotive.direction) {
            case FORWARD:
                gl.set(SRCPLocomotive.FORWARD_DIRECTION, speed, drivingSteps,
                        functions);
                break;
            case REVERSE:
                gl.set(SRCPLocomotive.REVERSE_DIRECTION, speed, drivingSteps,
                        functions);
                break;
            case UNDEF:
                gl.set(SRCPLocomotive.FORWARD_DIRECTION, speed, drivingSteps,
                        functions);
                locomotive.setDirection(SRCPLocomotiveDirection.FORWARD);
                break;
            }
            locomotive.setCurrentSpeed(speed);
View Full Code Here

Examples of javax.media.opengl.GL

        //GLContext oldContext = GLContext.getCurrent();
        GLContext context = pbuffer.getContext();
        if (context.makeCurrent() == GLContext.CONTEXT_NOT_CURRENT) {
            throw new RuntimeException("Error making pbuffer's context current");
        }
        GL gl = pbuffer.getGL();
        gl.glMatrixMode(GL.GL_MODELVIEW);
        gl.glLoadIdentity();

        //Init
        drawable.initConfig(gl);
        vizConfig.setDisableLOD(true);
        engine.initScreenshot(gl, GLAbstractListener.glu);
View Full Code Here

Examples of javax.media.opengl.GL

        gl.glVertex3f(cubeSize, -cubeSize, -cubeSize)// Bottom Right Of The Quad (Right)
        gl.glEnd();      // End Drawing The Cube
    }

    public void renderScreenshot(GLAutoDrawable drawable) {
        GL gl = drawable.getGL();
        if (vizController.getVizModel().isUse3d()) {
            gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
        } else {
            gl.glClear(GL.GL_COLOR_BUFFER_BIT);
        }
        setCameraPosition(gl, glu);
        engine.display(gl, glu);
    }
View Full Code Here

Examples of javax.media.opengl.GL

        fps = 1000.0f / delta;
        if (fps < 100) {
            fpsAvg = (fpsAvg * fpsCount + fps) / ++fpsCount;
        }

        GL gl = drawable.getGL();

        if (vizController.getVizModel().isUse3d()) {
            gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
        } else {
            gl.glClear(GL.GL_COLOR_BUFFER_BIT);
        }

        render3DScene(gl, glu);
    }
View Full Code Here

Examples of javax.media.opengl.GL

                viewportH = (int) (width * (1 / aspectRatio));
            }
            viewportX = ((width - viewportW) / 2);
            viewportY = ((height - viewportH) / 2);

            GL gl = drawable.getGL();

            gl.glViewport(viewportX, viewportY, viewportW, viewportH);
            gl.glGetIntegerv(GL.GL_VIEWPORT, viewport);//Update viewport buffer

            gl.glMatrixMode(GL.GL_PROJECTION);
            gl.glLoadIdentity();
            glu.gluPerspective(viewField, aspectRatio, nearDistance, farDistance);
            gl.glGetDoublev(GL.GL_PROJECTION_MATRIX, projMatrix);//Update projection buffer


            gl.glMatrixMode(GL.GL_MODELVIEW);
            gl.glLoadIdentity();

            reshape3DScene(drawable.getGL());

            if (DEBUG) {
                DEBUG = false;
                System.err.println("GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR));
                System.err.println("GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER));
                System.err.println("GL_VERSION: " + gl.glGetString(GL.GL_VERSION));
            }

            resizing = false;
        }
    }
View Full Code Here

Examples of javax.media.opengl.GL

    @Override
    public void reshape(GLAutoDrawable gLDrawable,
        int x, int y, int width, int height) {
     
      final GL gl = gLDrawable.getGL();

          if (height <= 0) { // avoid a divide by zero error!
              height = 1;
          }
                   
          gl.glViewport(0, 0, width, height);
         
          renderOptions.projection =
            renderOptions.projection.withAspectRatio((double)width / height);
         
    }
View Full Code Here

Examples of javax.media.opengl.GL

    protected void setLineWidth(DrawContext dc)
    {
        Double lineWidth = this.getActiveAttributes().getLineWidth();
        if (lineWidth != null)
        {
            GL gl = dc.getGL();

            if (dc.isPickingMode())
            {
                gl.glLineWidth(lineWidth.floatValue() + this.getLinePickWidth());
            }
            else
                gl.glLineWidth(lineWidth.floatValue());

            if (!dc.isPickingMode())
            {
                gl.glHint(GL.GL_LINE_SMOOTH_HINT, this.getActiveAttributes().getAntiAliasHint());
                gl.glEnable(GL.GL_LINE_SMOOTH);
            }
        }
    }
View Full Code Here

Examples of javax.media.opengl.GL

        int minFilter = this.isEnableSmoothing() ?
            (this.isUseMipmaps() ? GL.GL_LINEAR_MIPMAP_LINEAR : GL.GL_LINEAR) : GL.GL_NEAREST;
        int magFilter = this.isEnableSmoothing() ?
            GL.GL_LINEAR : GL.GL_NEAREST;

        GL gl = dc.getGL();
        gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, minFilter);
        gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, magFilter);
    }
View Full Code Here

Examples of javax.media.opengl.GL

  public GLMain3D() {
      addGLEventListener(this);
  }

  public void init(GLAutoDrawable drawable) {
    GL gl = drawable.getGL();
   
    rtri = 0;
    rtry = 0;

    pitch = 0;
    roll = 0;

    clippingPlanes[0]=10;
    clippingPlanes[1]=10;

    nav.setViewer(new Point3D(0,0,3));
    viewCulling = true;
    nav.setDirection(new Point3D(0,0,-1));

    threadStarted = false;
//    start();
    aspect = 1.f;

    alwaysBind = false;

    navRotate = false;
    old_valid = false;
    matrix_valid = false;
    fullscreen = false;

    depthbuffer = null;
    grabDepthBuffer = true;
//    grabDepthBuffer = false;

    navtime_ctime = new Date();
    navtime_nowtime = new Date();

        gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
        gl.glShadeModel(GL.GL_SMOOTH); // try setting this to GL_FLAT and
                                       // see what happens.
    drawable.addMouseListener(this);
    drawable.addMouseMotionListener(this);
    drawable.addMouseWheelListener(this);
    drawable.addKeyListener(this);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.