当前位置: 首页>>代码示例>>Java>>正文


Java GL2.glPopMatrix方法代码示例

本文整理汇总了Java中com.jogamp.opengl.GL2.glPopMatrix方法的典型用法代码示例。如果您正苦于以下问题:Java GL2.glPopMatrix方法的具体用法?Java GL2.glPopMatrix怎么用?Java GL2.glPopMatrix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jogamp.opengl.GL2的用法示例。


在下文中一共展示了GL2.glPopMatrix方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: render

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void render(GL2 gl) {
    final float alpha = .2f;
    final float scaleRadius = .0001f;
    glu.gluQuadricDrawStyle(quad, GLU.GLU_FILL);
    for (int x = 0; x < nx; x++) {
        for (int y = 0; y < ny; y++) {
            gl.glPushMatrix();
            final int shift = 1 << (subunitSubsamplingBits - 1);
            gl.glTranslatef(shift + (x << subunitSubsamplingBits), shift + (y << subunitSubsamplingBits), 5);
            gl.glColor4f(0, 1, 0, alpha);
            //glu.gluDisk(quad, 0, (float)Math.log10((double)scaleRadius *synapticWeight* offSubunits[x][y].computeInputToApproachCell()), 16, 1);
            glu.gluDisk(quad, 0, scaleRadius *synapticWeight*  onSubunits[x][y].computeInputToApproachCell(), 16, 1);
            gl.glColor4f(1, 0, 0, alpha);
            glu.gluDisk(quad, 0, scaleRadius *synapticWeight*  offSubunits[x][y].computeInputToApproachCell(), 16, 1);
            //glu.gluDisk(quad, 0, (float)Math.log10((double)scaleRadius *synapticWeight* onSubunits[x][y].computeInputToApproachCell()), 16, 1);
            gl.glPopMatrix();
        }
    }
    renderer.begin3DRendering();
    renderer.setColor(0, 1, 0, 1);
    renderer.draw3D("Inhibitory ON subunits", 0, chip.getSizeY(), 0, .5f);
    renderer.setColor(1, 0, 0, 1);
    renderer.draw3D("Excitatory OFF subunits", chip.getSizeX() / 2, chip.getSizeY(), 0, .5f);
    renderer.end3DRendering(); // annotation on top

}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:27,代码来源:ApproachCell.java

示例2: annotate

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable) {
    if (!isFilterEnabled()) {
        return;
    }
    GL2 gl = drawable.getGL().getGL2();
    gl.glPushMatrix();
    final GLUT glut = new GLUT();
    gl.glColor3f(1, 1, 1); // must set color before raster position (raster position is like glVertex)
    gl.glRasterPos3f(0, 0, 0);
    final float filteredOutPercent = 100 * (float) filteredOutEventCount / totalEventCount;
    String s = null;
    if (adaptiveFilteringEnabled) {
        s = String.format("dt=%.1fms, filteredOutPercent=%%%.1f, entropyReduction=%.1f",
                dt * 1e-3f, filteredOutPercent, entropyReduction);
    } else {
        s = String.format("filteredOutPercent=%%%.1f",
                filteredOutPercent);
    }
    glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, s);
    gl.glPopMatrix();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:23,代码来源:SpatioTemporalCorrelationFilter.java

示例3: drawPolygon

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void drawPolygon(final GL2 gl, final int xLowerLeft, final int yLowerLeft, final int width, final int height) {
    gl.glPushMatrix();
    gl.glDisable(GL.GL_DEPTH_TEST);
    gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
    gl.glEnable(GL.GL_BLEND);
    gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP);
    gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP);
    gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
    gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
    final double xRatio = (double) chip.getSizeX() / (double) width;
    final double yRatio = (double) chip.getSizeY() / (double) height;
    gl.glBegin(GL2.GL_POLYGON);

    gl.glTexCoord2d(0, 0);
    gl.glVertex2d(xLowerLeft, yLowerLeft);
    gl.glTexCoord2d(xRatio, 0);
    gl.glVertex2d(xRatio * width + xLowerLeft, yLowerLeft);
    gl.glTexCoord2d(xRatio, yRatio);
    gl.glVertex2d(xRatio * width + xLowerLeft, yRatio * height + yLowerLeft);
    gl.glTexCoord2d(0, yRatio);
    gl.glVertex2d(+xLowerLeft, yRatio * height + yLowerLeft);

    gl.glEnd();
    gl.glPopMatrix();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:26,代码来源:RoShamBoCNN.java

示例4: annotate

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable) {
	GL2 gl = drawable.getGL().getGL2();
	gl.glPushMatrix();
	String s = state.toString();
	gl.glScalef(.1f, .1f, 1);
	//        float l=glut.glutStrokeLengthf(GLUT.STROKE_ROMAN,s);
	gl.glTranslatef(0, chip.getSizeY() * .8f, 0);
	gl.glLineWidth(3);
	gl.glColor3f(1, 0, 0);
	glut.glutStrokeString(GLUT.STROKE_ROMAN, s);
	gl.glPopMatrix();
	switch (state) {
		case Replay:
			// draw replay progress bar
			gl.glPushMatrix();
			gl.glColor3f(0, 0, 1);
			gl.glRectf(1, 1, (chip.getSizeX() * (float) currentReplayPosition) / numEventsRecorded, 3);
			gl.glPopMatrix();
			break;
		case Live:
		case Init:
			//                info.annotate(drawable);
	}
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:26,代码来源:AutomaticReplayPlayer.java

示例5: annotate

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
/**
 * Annotation or drawing method
 * @param drawable OpenGL Rendering Object
 */
@Override
public void annotate (GLAutoDrawable drawable) {
	if (!isAnnotationEnabled()) {
		return;
	}
	GL2 gl = drawable.getGL().getGL2();
	if (gl == null) {
		return;
	}

	// Draw Box around relevant pixels
	gl.glPushMatrix();
	gl.glLineWidth(1f);
	gl.glBegin(GL.GL_LINE_LOOP);
	gl.glColor3f(1f,0.1f,0.1f);
	gl.glVertex2f(xStart-1,yStart-1);
	gl.glVertex2f(xStart+xPixels,yStart-1);
	gl.glVertex2f(xStart+xPixels,yStart+yPixels);
	gl.glVertex2f(xStart-1,yStart+yPixels);
	gl.glEnd();
	gl.glPopMatrix();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:27,代码来源:StdpFeatureLearningI.java

示例6: render

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void render(GL2 gl) {//fix graphic
    final float alpha = .2f;
    glu.gluQuadricDrawStyle(quad, GLU.GLU_FILL);
    int off = (1 << (subunitSubsamplingBits)) / 2;
    for (int x = 0; x < nx; x++) {
        for (int y = 0; y < ny; y++) {
            gl.glPushMatrix();
            gl.glTranslatef((x << subunitSubsamplingBits) + off, (y << subunitSubsamplingBits) + off, 5);
            if (x == excitedColumnNumber) {
               gl.glColor4f(0, 1, 0, alpha);
            } else {
               gl.glColor4f(1, 0, 0, alpha);
            }
            glu.gluDisk(quad, 0, subunitActivityBlobRadiusScale * synapticWeight * subunits[x][y].computeInputToCell(), 16, 1);
            gl.glPopMatrix();
        }
    }
    renderer.begin3DRendering();
    renderer.setColor(0, 1, 0, 1);
    renderer.draw3D("Inhibition", 0, chip.getSizeY(), 0, .5f);
    renderer.setColor(1, 0, 0, 1);
    renderer.draw3D("Active Scan", chip.getSizeX() / 2, chip.getSizeY(), 0, .5f);
    renderer.end3DRendering();


}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:27,代码来源:FrequencyDetectionCell.java

示例7: draw

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
public void draw(GL2 gl) {
    GLUT cGLUT = chip.getCanvas().getGlut();
    final int font = GLUT.BITMAP_HELVETICA_12;
    gl.glColor3f(1, 1, 1);
    cGLUT.glutBitmapString(font, toString()); // annotate
    gl.glRasterPos3f(location.x, location.y, 0);
    float amplitude = 1000 * getAmplitude();
    float phase = getPhase(0);
    gl.glPushMatrix();
    gl.glTranslatef(location.x, location.y, 0);
    gl.glLineWidth(3);
    gl.glBegin(GL.GL_LINES);
    gl.glVertex2f(0, 0);
    gl.glVertex2d(amplitude * Math.cos(phase), amplitude * Math.sin(phase));
    gl.glEnd();
    gl.glPopMatrix();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:18,代码来源:PllTracker.java

示例8: annotate

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable) {
       if(!isAnnotationEnabled() || !isFilterEnabled()) {
		return;
	}
       if(!isFilterEnabled()) {
		return;
	}
       GL2 gl=drawable.getGL().getGL2();

           gl.glPushMatrix();
           {
               for(int ctr=0;ctr<maxBoxNum;ctr++) {
               gl.glColor3f(0,0,ctr);
               gl.glLineWidth(2f);
               gl.glBegin(GL.GL_LINE_LOOP);
               gl.glVertex2i(startX[ctr],startY[ctr]);
               gl.glVertex2i(endX[ctr],startY[ctr]);
               gl.glVertex2i(endX[ctr],endY[ctr]);
               gl.glVertex2i(startX[ctr],endY[ctr]);
               gl.glEnd();
           }
           gl.glPopMatrix();
       }
   }
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:26,代码来源:MultipleXYTypeFilter.java

示例9: annotate

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable) {
    if (!isFilterEnabled()) {
        return;
    }
    GL2 gl = drawable.getGL().getGL2();
    gl.glPushMatrix();
    final GLUT glut = new GLUT();
    gl.glColor3f(1, 1, 1);
    gl.glRasterPos3f(0, 0, 0);
    if (showAnnotations == true) {
        glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, String.format("avgITD(us)=%s", fmt.format(bestITD)));
        glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, String.format("  ITDConfidence=%f", avgITDConfidence));
        glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, String.format("  ILD=%f", ILD));
        if ((useLaterSpikeForWeight == true) || (usePriorSpikeForWeight == true)) {
            glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, String.format("  lastWeight=%f", lastWeight));
        }
    }
    if ((display == true) && (frame != null)) {
        //frame.setITD(avgITD);
        frame.setText(String.format("avgITD(us)=%s   ITDConfidence=%f   ILD=%f", fmt.format(bestITD), avgITDConfidence, ILD));
    }
    gl.glPopMatrix();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:25,代码来源:ITDFilter_robothead6DOF.java

示例10: annotate

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable) {
    GL2 gl = drawable.getGL().getGL2();
    checkBlend(gl);
    gl.glPushMatrix();
    gl.glTranslatef(chip.getSizeX() / 2, chip.getSizeY() / 2, 10);
    if (showOutputCell && (verticalObjectMotionCellModel.nSpikes > getIntegrateAndFireThreshold())) {
        gl.glColor4f(1, 1, 1, .2f);
        glu.gluQuadricDrawStyle(quad, GLU.GLU_FILL);
        float radius = (chip.getMaxSize() * verticalObjectMotionCellModel.spikeRateHz) / maxSpikeRateHz / 2;
        glu.gluDisk(quad, 0, radius, 32, 1);
        verticalObjectMotionCellModel.resetSpikeCount();
    }
    gl.glPopMatrix();

    if (showSubunits) {
        gl.glColor4f(0, 1, 0, .3f);
        gl.glRectf(-10, 0, -5, inhibition);
        gl.glColor4f(1, 0, 0, .3f);
        gl.glRectf(-20, 0, -15, centerExcition);
        renderer.begin3DRendering();
        renderer.setColor(0, 1, 0, .3f);
        renderer.draw3D("sur", -10, -3, 0, .4f);
        renderer.setColor(1, 0, 0, .3f);
        renderer.draw3D("cen", -20, -3, 0, .4f);
        renderer.end3DRendering();
        // render all the subunits now
        subunits.render(gl);
    }

}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:32,代码来源:VerticalObjectMotionCell.java

示例11: annotate

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable) {
	GL2 gl=drawable.getGL().getGL2(); // when we getString this we are already set up with updateShape 1=1 pixel, at LL corner

	if(gl==null) {
		log.warning("null GL");
		return;
	}
	final float BOX_LINE_WIDTH=3f; // in pixels

	gl.glColor3f(1, 0, 0);
	gl.glLineWidth(BOX_LINE_WIDTH);
	final  int sx=2,    sy=2;
	for(PanTiltCalibrationPoint p : sampleVector) {
		gl.glPushMatrix();
		final  int x=(int) p.ret.x,    y=(int) p.ret.y;
		gl.glBegin(GL.GL_LINE_LOOP);
		{
			gl.glVertex2i(x-sx, y-sy);
			gl.glVertex2i(x+sx, y-sy);
			gl.glVertex2i(x+sx, y+sy);
			gl.glVertex2i(x-sx, y+sy);
		}
		gl.glEnd();
		gl.glPopMatrix();
	}
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:28,代码来源:PanTiltCalibrator.java

示例12: render

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void render(GL2 gl) {
    if (showSubunits && showSpecificOMCoutput && !showAllOMCoutputs) {
        final float alpha = .2f;
        glu.gluQuadricDrawStyle(quad, GLU.GLU_FILL);
        int off = (1 << (subsample)) / 2;
        for (int x = 0; x < (nxmax); x++) {
            for (int y = 0; y < (nymax); y++) {
                gl.glPushMatrix();
                gl.glTranslatef((x << subsample) + off, (y << subsample) + off, 5);
                if (((x == getShowXcoord()) && (y == getShowYcoord())) || ((x == (getShowXcoord() + 1)) && (y == (getShowYcoord() + 1)))
                        || ((x == getShowXcoord()) && (y == (getShowYcoord() + 1))) || ((x == (getShowXcoord() + 1)) && (y == getShowYcoord()))) {
                    gl.glColor4f(1, 0, 0, alpha);
                } else {
                    gl.glColor4f(0, 1, 0, alpha);
                }
                glu.gluDisk(quad, 0, subunitActivityBlobRadiusScale * subunits[x][y].computeInputToCell(), 16, 1);
                gl.glPopMatrix();
            }
        }
        renderer.begin3DRendering();
        renderer.setColor(1, 0, 0, 1);
        renderer.draw3D("Center", 0, chip.getSizeY(), 0, .5f);
        renderer.setColor(0, 1, 0, 1);
        renderer.draw3D("Surround", chip.getSizeX() / 2, chip.getSizeY(), 0, .5f);
        renderer.end3DRendering();
    }
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:28,代码来源:OmcodFpga.java

示例13: annotate

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
public void annotate(GLAutoDrawable drawable) {
    if(!isAnnotationEnabled() || !isFilterEnabled()) return;
    if(!isFilterEnabled()) return;
    GL2 gl=drawable.getGL().getGL2();
    gl.glPushMatrix();
    {
        
    }
    gl.glPopMatrix();
    
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:12,代码来源:PerspecTransform.java

示例14: annotate

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable) {
    GL2 gl = drawable.getGL().getGL2();
    checkBlend(gl);
    gl.glPushMatrix();
    gl.glTranslatef(chip.getSizeX() / 2, chip.getSizeY() / 2, 10);
    if (showOutputCell && (frequencyDetectionCellModel.nSpikes > getIntegrateAndFireThreshold())) {
        gl.glColor4f(1, 1, 1, .2f);
        glu.gluQuadricDrawStyle(quad, GLU.GLU_FILL);
        float radius = (chip.getMaxSize() * frequencyDetectionCellModel.spikeRateHz) / maxSpikeRateHz / 2;
        glu.gluDisk(quad, 0, radius, 32, 1);
        frequencyDetectionCellModel.resetSpikeCount();
    }
    gl.glPopMatrix();

    if (showSubunits) {
        gl.glColor4f(1, 0, 0, .3f);
        gl.glRectf(-10, 0, -5, inhibition);
        gl.glColor4f(0, 1, 0, .3f);
        gl.glRectf(-20, 0, -15, centerExcitation);
        renderer.begin3DRendering();
        renderer.setColor(1, 0, 0, .3f);
        renderer.draw3D("ini", -10, -3, 0, .4f);
        renderer.setColor(0, 1, 0, .3f);
        renderer.draw3D("exc", -20, -3, 0, .4f);
        renderer.end3DRendering();
        // render all the subunits now
        subunits.render(gl);
    }

}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:32,代码来源:FrequencyDetectionCell.java

示例15: drawThrottlePainter

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
/**
 * Displays the extracted track points
 */
private void drawThrottlePainter(GLAutoDrawable drawable) {
    if (isSelected() && (getTrack() != null) && (getTrack().getPointList() != null) && (currentProfile != null)) {
        Point mp = glCanvas.getMousePosition();
        Point p = canvas.getPixelFromPoint(mp);
        if (p == null) {
            return;
        }
        GL2 gl = drawable.getGL().getGL2();
        checkBlend(gl);
        switch (editState) {
            case None:
                gl.glColor4f(.25f, .25f, 0, .3f);
                break;
            case Increae:
                gl.glColor4f(0, .45f, 0, .5f);
                break;
            case Decrease:
                gl.glColor4f(.45f, .0f, 0, .5f);

        }
        gl.glPushMatrix();
        gl.glTranslatef(p.x, p.y, 0);
        if (quad == null) {
            quad = glu.gluNewQuadric();
        }
        glu.gluQuadricDrawStyle(quad, GLU.GLU_FILL);
        glu.gluDisk(quad, 0, 5, 32, 1);
        gl.glPopMatrix();

        chip.getCanvas().checkGLError(gl, glu, "in drawThrottlePainterk");

    }
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:37,代码来源:HumanVsComputerThrottleController.java


注:本文中的com.jogamp.opengl.GL2.glPopMatrix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。