本文整理汇总了Java中com.jogamp.opengl.GL2.glLineWidth方法的典型用法代码示例。如果您正苦于以下问题:Java GL2.glLineWidth方法的具体用法?Java GL2.glLineWidth怎么用?Java GL2.glLineWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.GL2
的用法示例。
在下文中一共展示了GL2.glLineWidth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: annotate
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void annotate(final GLAutoDrawable drawable) {
if (!showHotPixels) {
return;
}
final GL2 gl = drawable.getGL().getGL2();
try {
gl.glEnable(GL.GL_BLEND);
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
gl.glBlendEquation(GL.GL_FUNC_ADD);
}
catch (final GLException e) {
e.printStackTrace();
showHotPixels = false;
}
gl.glColor4f(.1f, .1f, 1f, .25f);
gl.glLineWidth(1f);
for (final HotPixel p : hotPixelSet) {
gl.glRectf(p.x - 1, p.y - 1, p.x + 2, p.y + 2);
}
}
示例2: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
/** Displays intensity along with normal 2d histograms.
*
* @param drawable
*/
@Override
public void display(GLAutoDrawable drawable) {
super.display(drawable);
if (intensityDisplayEnabled && (hasIntensity != null)) {
GL2 gl = drawable.getGL().getGL2();
gl.glLineWidth(10);
gl.glColor3f(0, 1, 0);
gl.glBegin(GL.GL_LINES);
gl.glVertex2f(-1, 0);
float f = hasIntensity.getIntensity()*intensityScale;
f = f * getChipCanvas().getChip().getSizeY();
gl.glVertex2f(-1, f);
gl.glEnd();
{
renderer.begin3DRendering();
renderer.setColor(1, 1, 1, 1f);
renderer.draw3D("Intensity", -10, 3, 0, .2f); // TODO fix string n lines
renderer.draw3D(String.format("%.2f", hasIntensity.getIntensity()), -10, 0, 0, .2f); // TODO fix string n lines
renderer.end3DRendering();
}
}
}
示例3: drawOrientationVector
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
protected void drawOrientationVector(GL2 gl, OrientationEventInterface e) {
if (!e.isHasOrientation()) {
return;
}
byte ori = e.getOrientation();
OrientationEventInterface.UnitVector d = OrientationEventInterface.unitVectors[ori];
float jx = 0, jy = 0;
if (jitterVectorLocations) {
jx = (random.nextFloat() - .5f) * jitterAmountPixels;
jy = (random.nextFloat() - .5f) * jitterAmountPixels;
}
gl.glLineWidth(3f);
float[] c = chip.getRenderer().makeTypeColors(e.getNumCellTypes())[ori];
gl.glColor3fv(c, 0);
gl.glBegin(GL.GL_LINES);
gl.glVertex2f((e.getX() - (d.x * length)) + jx, (e.getY() - (d.y * length)) + jy);
gl.glVertex2f((e.getX() + (d.x * length)) + jx, (e.getY() + (d.y * length)) + jy);
gl.glEnd();
}
示例4: annotate
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable) {
GL2 gl = drawable.getGL().getGL2();
gl.glColor3f(0, 1, 1);
gl.glLineWidth(5f);
gl.glBegin(GL.GL_LINES);
for (int n = 0; n < numberOfLinesInUse; n++) {
gl.glVertex2d((sx2 * (lsx[n] + 1)), (sy2 * (lsy[n] + 1)));
gl.glVertex2d((sx2 * (lex[n] + 1)), (sy2 * (ley[n] + 1)));
// g.drawLine((int) (sx2 * (gsx + 1) * 4), (int) (sy2 * (gsy + 1) * 4), (int) (sx2 * (gex + 1) * 4), (int) (sy2 * (gey + 1) * 4));
}
gl.glEnd();
// show matrix
MultilineAnnotationTextRenderer.resetToYPositionPixels(chip.getSizeY());
StringBuilder sb = new StringBuilder("PigTracker\n");
sb.append(String.format("# lines = %d\nm=\n", numberOfLinesInUse));
sb.append(String.format("%6.3f %6.3f %6.3f\n", cm[0], cm[1], cm[2]));
sb.append(String.format("%6.3f %6.3f %6.3f\n", cm[3], cm[4], cm[5]));
sb.append(String.format("%6.3f %6.3f %6.3f\n", cm[6], cm[7], cm[8]));
MultilineAnnotationTextRenderer.renderMultilineString(sb.toString());
}
示例5: 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();
}
示例6: annotate
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable) {
if (!isFilterEnabled()) {
return;
}
final float LINE_WIDTH = 5f; // in pixels
GL2 gl = drawable.getGL().getGL2(); // when we getString this we are already set up with scale 1=1 pixel, at LL corner
gl.glLineWidth(LINE_WIDTH);
double thetaRad = getThetaRad();
double cosTheta = Math.cos(thetaRad);
double sinTheta = Math.sin(thetaRad);
gl.glColor3f(0, 0, 1);
gl.glBegin(GL.GL_LINES);
if ((thetaRad > (Math.PI / 4)) && (thetaRad < ((3 * Math.PI) / 4))) {
gl.glVertex2d(0, yFromX(0, cosTheta, sinTheta));
gl.glVertex2d(sx2 * 2, yFromX(sx2 * 2, cosTheta, sinTheta));
} else {
gl.glVertex2d(xFromY(0, cosTheta, sinTheta), 0);
gl.glVertex2d(xFromY(sy2 * 2, cosTheta, sinTheta), sy2 * 2);
}
gl.glEnd();
}
示例7: drawOsculatingCircle
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
/** Draws the osculating circle of the track at the current car position */
private void drawOsculatingCircle(GL2 gl, Point2D p, double radius, Point2D center) {
radius = Math.abs(radius);
gl.glLineWidth(1.0f);
// Draw line to connect center of circle and car
gl.glColor3f(1.0f, 1.0f, 1.0f);
gl.glBegin(GL.GL_LINES);
gl.glVertex2d(p.getX(), p.getY());
gl.glVertex2d(center.getX(), center.getY());
gl.glEnd();
// Draw circle
gl.glColor3f(1.0f, 0.0f, 1.0f);
gl.glBegin(GL.GL_LINE_LOOP);
for (int i=0; i<60; i++) {
gl.glVertex2d(center.getX()+(radius*Math.cos((6.0*i*Math.PI)/180.0)),
center.getY()+(radius*Math.sin((6.0*i*Math.PI)/180.0)));
}
gl.glEnd();
// gl.glLoadIdentity();
}
示例8: drawAxis
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
public static void drawAxis(GL2 gl, float axisSize) {
//Draw Axis
gl.glLineWidth(2.5f);
//Draw X Axis
gl.glColor3f(1, 0, 0);
gl.glBegin(GL.GL_LINES);
gl.glVertex3f(0, 0, 0);
gl.glVertex3f(axisSize, 0, 0);
gl.glEnd();
//Draw Y Axis
gl.glColor3f(0, 1, 0);
gl.glBegin(GL.GL_LINES);
gl.glVertex3f(0, 0, 0);
gl.glVertex3f(0, axisSize, 0);
gl.glEnd();
//Draw Z Axis
gl.glColor3f(0, 0, 1);
gl.glBegin(GL.GL_LINES);
gl.glVertex3f(0, 0, 0);
gl.glVertex3f(0, 0, axisSize);
gl.glEnd();
}
示例9: draw
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
/** Draws the beat on the cluster location.
*
* @param drawable the GL drawable to draw on.
*/
public void draw(GLAutoDrawable drawable) {
if (isDoneRendering()) {
return;
}
GL2 gl = drawable.getGL().getGL2(); // when we get this we are already set up with scale 1=1 pixel, at LL corner
gl.glPushMatrix();
gl.glColor3f(0, 1, 0); // green
gl.glLineWidth(3); // will get scaled
final int pos = 10;
final String beatString = string;
// render string at location of cluster. size of string is sized to match cluster size
float sw = glut.glutStrokeLength(GLUT.STROKE_ROMAN, beatString); // length in model space
float cw = cluster.getRadius() ; // cluster size (actually radius, to make string half total width)
float scale = cw / sw; // scaling to make string come out size of cluster /2
// set origin to put string centered on cluster
gl.glTranslatef(location.x - (cw/2), location.y, 0);
gl.glScalef(scale, scale, 1); // scale transform to make string right size
glut.glutStrokeString(GLUT.STROKE_ROMAN, beatString); // stroke the string
gl.glPopMatrix();
framesLeftToRender--; // decrease counter for rendering
}
示例10: annotate
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable) {
final GL2 gl = drawable.getGL().getGL2();
if(Xfinals.size()!=0){
// System.out.println("annotate");
//gl.glPushMatrix();
gl.glColor3f(0, 0, 1);
gl.glLineWidth(4);
for(int h=0;h<Xfinals.size(); h++){
for(int i=0;i<Xfinals.get(h).size(); i++){
//centerX[i]=Xfinals.get(i).get(0);
//System.out.println(centerX);
//centerY[i]=Xfinals.get(i).get(1);
//centerZ[i]=Xfinals.get(i).get(2);
gl.glBegin(GL.GL_LINE_LOOP);
//System.out.println(centerY);
gl.glVertex3f((Xfinals.get(h).get(i).get(0)-(radius/2))*scale, (Xfinals.get(h).get(i).get(1)-(radius/2))*scale, (Xfinals.get(h).get(i).get(2)-(radius/2))*scale);
gl.glVertex3f((Xfinals.get(h).get(i).get(0)+(radius/2))*scale, (Xfinals.get(h).get(i).get(1)-(radius/2))*scale, (Xfinals.get(h).get(i).get(2)-(radius/2))*scale);
gl.glVertex3f((Xfinals.get(h).get(i).get(0)-(radius/2))*scale, (Xfinals.get(h).get(i).get(1)+(radius/2))*scale, (Xfinals.get(h).get(i).get(2)-(radius/2))*scale);
gl.glVertex3f((Xfinals.get(h).get(i).get(0)+(radius/2))*scale, (Xfinals.get(h).get(i).get(1)+(radius/2))*scale, (Xfinals.get(h).get(i).get(2)+(radius/2))*scale);
gl.glVertex3f((Xfinals.get(h).get(i).get(0)-(radius/2))*scale, (Xfinals.get(h).get(i).get(1)-(radius/2))*scale, (Xfinals.get(h).get(i).get(2)+(radius/2))*scale);
gl.glVertex3f((Xfinals.get(h).get(i).get(0)+(radius/2))*scale, (Xfinals.get(h).get(i).get(1)-(radius/2))*scale, (Xfinals.get(h).get(i).get(2)+(radius/2))*scale);
gl.glEnd();
}
//gl.glPopMatrix();
}
}
}
示例11: drawSelection
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void drawSelection(GL2 gl, Rectangle r, float[] c) {
gl.glPushMatrix();
gl.glColor3fv(c, 0);
gl.glLineWidth(lineWidth);
gl.glTranslatef(-.5f, -.5f, 0);
gl.glBegin(GL.GL_LINE_LOOP);
gl.glVertex2f(selection.x, selection.y);
gl.glVertex2f(selection.x + selection.width, selection.y);
gl.glVertex2f(selection.x + selection.width, selection.y + selection.height);
gl.glVertex2f(selection.x, selection.y + selection.height);
gl.glEnd();
gl.glPopMatrix();
}
示例12: drawDecisionOutput
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void drawDecisionOutput(int third, GL2 gl, int sy, AbstractDavisCNN net, Color color) {
System.out.printf("max heat value is: %f\n", outputProbVal);
try {
gl.glEnable(GL.GL_BLEND);
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
gl.glBlendEquation(GL.GL_FUNC_ADD);
}
catch (final GLException e) {
e.printStackTrace();
}
gl.glColor4f(1f, .1f, .1f, .25f);
gl.glLineWidth(1f);
gl.glRectf((int)outputX - 10, (int)outputY - 10, (int)outputX + 12, (int)outputY + 12);
}
示例13: annotate
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void annotate(GLAutoDrawable drawable) {
final GL2 gl = drawable.getGL().getGL2();
try {
gl.glEnable(GL.GL_BLEND);
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
gl.glBlendEquation(GL.GL_FUNC_ADD);
}
catch (final GLException e) {
e.printStackTrace();
}
gl.glColor4f(1f, .1f, .1f, .25f);
gl.glLineWidth(1f);
if(displayParticles) {
gl.glColor4f(.1f, 1f, .1f, .25f);
for(int i = 0; i < filter.getParticleCount(); i ++) {
gl.glRectd(filter.get(i).getX() - 0.5, filter.get(i).getY() - 0.5, filter.get(i).getX() + 0.5, filter.get(i).getY() + 0.5);
}
}
gl.glColor4f(.1f, .1f, 1f, .25f);
gl.glRectf((int)outputX - 10, (int)outputY - 10, (int)outputX + 12, (int)outputY + 12);
// }
}
示例14: annotateHistogram
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
public void annotateHistogram(GL2 gl, int width, int height, float lineWidth, Color color) {
gl.glPushAttrib(GL2ES3.GL_COLOR | GL.GL_LINE_WIDTH);
gl.glLineWidth(lineWidth);
float[] ca = color.getColorComponents(null);
gl.glColor4fv(ca, 0);
OutputOrInnerProductFullyConnectedLayer.this.annotateHistogram(gl, width, height);
gl.glPopAttrib();
}
示例15: paintKalmanFilterState
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
protected static void paintKalmanFilterState( final LabyrinthBallKalmanFilter filter, GL2 gl, float[] covColor, float[] speedColor )
{
final double[] mu = filter.getMu();
final double[][] Sigma = filter.getSigma();
paintCovarianceEllipse( mu, Sigma, 3, covColor, gl );
double velx = mu[2] * 0.1;
double vely = mu[3] * 0.1;
gl.glColor3f( speedColor[0], speedColor[1], speedColor[2] );
gl.glLineWidth(2);
gl.glPushMatrix();
gl.glTranslated(mu[0], mu[1], 0);
gl.glBegin(GL.GL_LINES);
gl.glVertex2d(0, 0);
gl.glVertex2d(velx, vely);
gl.glEnd();
gl.glPopMatrix();
gl.glLineWidth(1);
gl.glColor3f(1,1,1);
gl.glBegin(GL.GL_LINES);
gl.glVertex2d(64, 64);
gl.glVertex2d(mu[0], mu[1]);
gl.glEnd();
}