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


Java GL2.glRasterPos3f方法代码示例

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


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

示例1: annotate

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public synchronized void annotate (GLAutoDrawable drawable){
	if ( !isFilterEnabled() ){
		return;
	}
	super.annotate(drawable);
	final int sx = chip.getSizeX(),  sy = chip.getSizeY();
	final GL2 gl = drawable.getGL().getGL2();
	gl.glLineWidth(2f);
	gl.glColor3f(0,0,1);
	gl.glRasterPos3f(0,sy * getTopLine(),0);
	glut.glutBitmapString(GLUT.BITMAP_TIMES_ROMAN_24,String.format("%d exited",nOut));
	gl.glRasterPos3f(0,sy * getBotLine(),0);
	glut.glutBitmapString(GLUT.BITMAP_TIMES_ROMAN_24,String.format("%d entered",nIn));
	gl.glBegin(GL.GL_LINES);
	gl.glVertex2f(0,sy * getTopLine());
	gl.glVertex2f(sx,sy * getTopLine());
	gl.glVertex2f(0,sy * getBotLine());
	gl.glVertex2f(sx,sy * getBotLine());
	gl.glEnd();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:22,代码来源:BeeCounter.java

示例2: 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

示例3: 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

示例4: 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,5,5);

	glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18,String.format(state));
	if(state=="tracking"){
		glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18,String.format(" Tracked Angle = %s",trackedAngle));


	}


	//glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18,String.format("  Angle=%s",ANG));
	//gl.glPopMatrix();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:23,代码来源:ControlFilter.java

示例5: 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,10,10);
	if(LEDRecognized){
		glut.glutBitmapString(GLUT.BITMAP_HELVETICA_12,String.format(" LED Detected: x = %s",fmt.format(LED.getLocation().getX())));
		glut.glutBitmapString(GLUT.BITMAP_HELVETICA_12,String.format(" y = %s",fmt.format(LED.getLocation().getY())));
	}
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:17,代码来源:LEDTracker.java

示例6: init

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
/** Called by the drawable immediately after the OpenGL context is
    initialized. Can be used to perform one-time OpenGL
    initialization such as setup of lights and display lists. Note
    that this method may be called more than once if the underlying
    OpenGL context for the GLAutoDrawable is destroyed and
    recreated, for example if a GLCanvas is removed from the widget
    hierarchy and later added again.
 */
@Override
public void init(GLAutoDrawable drawable){
	GL2 gl = drawable.getGL().getGL2();

	gl.setSwapInterval(1);
	gl.glShadeModel(GLLightingFunc.GL_FLAT);

	gl.glClearColor(0,0,0,0f);
	gl.glClear(GL.GL_COLOR_BUFFER_BIT);
	gl.glLoadIdentity();

	gl.glRasterPos3f(0,0,0);
	gl.glColor3f(1,1,1);
	glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18,"Initialized display");

	reval();

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

示例7: 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);
	glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, String.format("Total = %s", fmt.format(rate)));
	glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, String.format("; Coch0 = %s", fmt.format(coch0Rate)));
	glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, String.format("; Coch1 = %s", fmt.format(coch1Rate)));
	gl.glPopMatrix();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:17,代码来源:CochleaEventRate.java

示例8: drawTimeScaling

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void drawTimeScaling(GLAutoDrawable drawable, float timeExpansion) {
    if (!isTimeScaling()) {
        return;
    }
    final int sx = chip.getSizeX(), sy = chip.getSizeY();
    final float yorig = .95f * sy, xpos = 0, barh = .03f * sy;
    int h = drawable.getSurfaceHeight(), w = drawable.getSurfaceWidth();
    GL2 gl = drawable.getGL().getGL2();

    gl.glPushMatrix();
    gl.glColor3f(1, 1, 1);
    GLUT glut = chip.getCanvas().getGlut();
    StringBuilder s = new StringBuilder();
    if ((timeExpansion < 1) && (timeExpansion != 0)) {
        s.append('/');
        timeExpansion = 1 / timeExpansion;
    } else {
        s.append('x');
    }
    int font = GLUT.BITMAP_9_BY_15;
    String s2 = String.format("Time factor: %10s", engFmt.format(timeExpansion) + s);

    float sw = (glut.glutBitmapLength(font, s2) / (float) w) * sx;
    gl.glRasterPos3f(0, yorig, 0);
    glut.glutBitmapString(font, s2);
    float x0 = xpos;
    float x1 = (float) (xpos + (x0 * Math.log10(timeExpansion)));
    float y0 = sy + barh;
    float y1 = y0;
    gl.glRectf(x0, y0, x1, y1);
    gl.glPopMatrix();

}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:34,代码来源:Info.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); // must set color before raster position (raster position is like glVertex)
	gl.glRasterPos3f(0,0,0);
	glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18,String.format("ITD(us)=%s",fmt.format(lpFilterITD.getValue())));
	glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18,String.format("  ILD=%s",fmt.format(lpFilterILD.getValue())));
	glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18,String.format("  azm=%s",azm));
	gl.glPopMatrix();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:16,代码来源:CochleaCrossCorrelator.java

示例10: drawEventRateBars

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void drawEventRateBars(GLAutoDrawable drawable) {
    if (!isEventRate()) {
        return;
    }
    GL2 gl = drawable.getGL().getGL2();
    // positioning of rate bars depends on num types and display size
    ChipCanvas.Borders borders = chip.getCanvas().getBorders();

    // get screen width in screen pixels, subtract borders in screen pixels to find width of drawn chip area in screen pixels
    float /*h = drawable.getHeight(), */ w = drawable.getSurfaceWidth() - (2 * borders.leftRight * chip.getCanvas().getScale());
    int ntypes = eventRateFilter.getNumCellTypes();
    final int sx = chip.getSizeX(), sy = chip.getSizeY();
    final float yorig = .9f * sy, xpos = 0, ystep = Math.max(.03f * sy, 6), barh = .03f * sy;

    gl.glPushMatrix();
    //        gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
    //        gl.glLoadIdentity();
    gl.glColor3f(1, 1, 1);
    int font = GLUT.BITMAP_9_BY_15;
    GLUT glut = chip.getCanvas().getGlut();
    int nbars = eventRateFilter.isMeasureIndividualTypesEnabled() ? ntypes : 1;
    for (int i = 0; i < nbars; i++) {
        final float rate = eventRateFilter.getFilteredEventRate(i);
        float bary = yorig - (ystep * i);
        gl.glRasterPos3f(xpos, bary, 0);
        String s = null;
        if (eventRateFilter.isMeasureIndividualTypesEnabled()) {
            s = String.format("Type %d: %10s", i, engFmt.format(rate) + " Hz");
        } else {
            s = String.format("All %d types: %10s", ntypes, engFmt.format(rate) + " Hz");
        }
        // get the string length in screen pixels , divide by chip array in screen pixels,
        // and multiply by number of pixels to get string length in screen pixels.
        float sw = (glut.glutBitmapLength(font, s) / w) * sx;
        glut.glutBitmapString(font, s);
        gl.glRectf(xpos + sw, bary + barh, xpos + sw + ((rate * sx) / getEventRateScaleMax()), bary);
    }
    gl.glPopMatrix();

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

示例11: drawAccumulatedEventCount

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void drawAccumulatedEventCount(GLAutoDrawable drawable) {
        if (!showAccumulatedEventCount) {
            return;
        }
        GL2 gl = drawable.getGL().getGL2();
        gl.glColor3f(1, 1, 1);
        int font = GLUT.BITMAP_9_BY_15;
        final int sx = chip.getSizeX(), sy = chip.getSizeY();
        final float yorig = .7f * sy, xpos = 0;
        GLUT glut = chip.getCanvas().getGlut();
        gl.glRasterPos3f(xpos, yorig, 0);
        int n=chip.getNumPixels();
        float cDvs = (float) accumulatedDVSEventCount;
        float cDvsOn = (float) accumulatedDVSOnEventCount;
        float cDvsOff = (float) accumulatedDVSOffEventCount;
        float cAps = (float) accumulatedAPSSampleCount;
        float cImu = (float) accumulatedIMUSampleCount;
        float t = 1e-6f * (float) accumulateTimeUs;
        String s = String.format("In %ss:\n%s DVS events (%seps, %seps/pix)\n  %s DVS ON events (%seps, %seps/pix)\n  %s DVS OFF events (%seps, %seps/pix)\n%s APS samples (%ssps)\n%s IMU samples (%ssps)",
                engFmt.format(t),
                engFmt.format(accumulatedDVSEventCount), engFmt.format(cDvs / t), engFmt.format(cDvs/t/n),
                engFmt.format(accumulatedDVSOnEventCount), engFmt.format(cDvsOn / t), engFmt.format(cDvsOn/t/n),
                engFmt.format(accumulatedDVSOffEventCount), engFmt.format(cDvsOff / t), engFmt.format(cDvsOff/t/n),
                engFmt.format(accumulatedAPSSampleCount / 2), engFmt.format(cAps / 2 / t), // divide by two for reset/signal reads
                engFmt.format(accumulatedIMUSampleCount), engFmt.format(cImu / t));
        MultilineAnnotationTextRenderer.setScale(.2f);
        MultilineAnnotationTextRenderer.resetToYPositionPixels(chip.getSizeY() * .8f);
        MultilineAnnotationTextRenderer.renderMultilineString(s);
//        glut.glutBitmapString(font, s);
    }
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:31,代码来源:Info.java

示例12: 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);
	glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18,String.format("ITD(us)=%s",fmt.format(ITD)));

	glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18,String.format("  Angle=%s",ANG));
	gl.glPopMatrix();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:16,代码来源:CorrelatorFilter.java

示例13: init

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void init( GLAutoDrawable drawable ) {
	// drawable.setGL(new DebugGL(drawable.getGL()));
	drawable.setAutoSwapBufferMode(true);
	final GL2 gl = drawable.getGL().getGL2();

	//	        log.info("OpenGL implementation is: " + gl.getClass().getName() + "\nGL_VENDOR: "
	//	                + gl.glGetString(GL.GL_VENDOR) + "\nGL_RENDERER: " + gl.glGetString(GL.GL_RENDERER) + "\nGL_VERSION: "
	//	                + gl.glGetString(GL.GL_VERSION) // + "\nGL_EXTENSIONS: " + gl.glGetString(GL.GL_EXTENSIONS)
	//	        );
	final float glVersion = Float.parseFloat(gl.glGetString(GL.GL_VERSION).substring(0, 3));
	if (glVersion < 1.3f) {
		//	            log.warning("\n\n*******************\nOpenGL version "
		//	                    + glVersion
		//	                    + " < 1.3, some features may not work and program may crash\nTry switching from 16 to 32 bit color if you have decent graphics card\n\n");
	}
	// System.out.println("GLU_EXTENSIONS: "+glu.gluGetString(GLU.GLU_EXTENSIONS));

	gl.setSwapInterval(1);
	gl.glShadeModel(GLLightingFunc.GL_FLAT);

	gl.glClearColor(0, 0, 0, 0f);
	gl.glClear(GL.GL_COLOR_BUFFER_BIT);
	gl.glLoadIdentity();

	gl.glRasterPos3f(0, 0, 0);
	gl.glColor3f(1, 1, 1);
	//	        glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, "Initialized display");
	// Start animator (which should be a field).
	animator = new FPSAnimator(glcanvas, 60);
	animator.start();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:33,代码来源:Triangulation3DViewer.java

示例14: annotate

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

	}
	GL2 gl = drawable.getGL().getGL2(); // when we getString this we are already set up with scale 1=1 pixel, at LL corner
	if ( gl == null ){
		log.warning("null GL in BlurringTunnelTracker.annotate");
		return;
	}
	gl.glPushMatrix();
	try{
		for (int i=0; i<clusters.size(); i++ ){
			Cluster c = clusters.get(i);
			if ( showClusters && c.isVisible() ){
				c.draw(drawable);
			}
			// text annoations on clusters, setup
			final int font = GLUT.BITMAP_HELVETICA_18;
			gl.glColor3f(1,1,1);
			gl.glRasterPos3f(chip.getSizeX()/2,chip.getSizeY()+10,0);

			// annotate the cluster with hash ID
			if ( sendClusterInfo ){
				chip.getCanvas().getGlut().glutBitmapString(font,String.format("Flow: %d",flow));
			}
		}
	} catch ( java.util.ConcurrentModificationException e ){
		// this is in case cluster list is modified by real time filter during rendering of clusters
		log.warning(e.getMessage());
	}
	gl.glPopMatrix();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:35,代码来源:BlurringTunnelTracker.java

示例15: 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);
 glut.glutBitmapString(GLUT.BITMAP_HELVETICA_12, String.format("Low passed event rate=%s Hz, state=%s", fmt.format(rateEstimator.getFilteredEventRate()), state.toString()));
 gl.glPopMatrix();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:14,代码来源:DVSBiasController.java


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