Example usage for org.lwjgl.opengl GL11 glPointSize

List of usage examples for org.lwjgl.opengl GL11 glPointSize

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL11 glPointSize.

Prototype

public static void glPointSize(@NativeType("GLfloat") float size) 

Source Link

Document

Controls the rasterization of points if no vertex, tessellation control, tessellation evaluation, or geometry shader is active.

Usage

From source file:espresso3d.engine.renderer.E3DGeometryRenderer.java

License:Open Source License

public void renderPoint(E3DPoint point) {
    E3DVector4F color = point.getColor();
    E3DVector3F pos = point.getPos();/*  ww w  . j  a  va  2 s .  c  om*/

    GL11.glPointSize(100f);//(float)point.getSize());
    GL11.glBegin(GL11.GL_POINTS);// Begin Drawing The Line
    GL11.glColor4f((float) color.getA(), (float) color.getB(), (float) color.getC(), (float) color.getD()); //default all white color for the base polygon

    //Draw vertices
    GL11.glVertex3f((float) (pos.getX()), (float) (pos.getY()), (float) (pos.getZ()));
    GL11.glEnd();
}

From source file:espresso3d.engine.renderer.particle.E3DParticleRendererARBPointSprite.java

License:Open Source License

private void setupPointSpriteParameters(double spriteSize) {
    particleDistanceScalarBuffer.clear();
    //        particleDistanceScalarBuffer.put(0.0f);//1.0f);
    particleDistanceScalarBuffer.put(0.0f);//1.0f);
    particleDistanceScalarBuffer.put(0.0f);
    particleDistanceScalarBuffer.put((float) (1.0
            / (getEngine().getCurrentViewport().getWidth() * getEngine().getCurrentViewport().getHeight())));//0.1f);
    particleDistanceScalarBuffer.rewind();

    ARBPointParameters.glPointParameterARB(ARBPointParameters.GL_POINT_DISTANCE_ATTENUATION_ARB,
            particleDistanceScalarBuffer);
    ARBPointParameters.glPointParameterfARB(ARBPointParameters.GL_POINT_SIZE_MIN_ARB, 1f);//(float)particle.getSize());//1f );
    ARBPointParameters.glPointParameterfARB(ARBPointParameters.GL_POINT_SIZE_MAX_ARB, maxPointSpriteSize);
    ARBPointParameters.glPointParameterfARB(ARBPointParameters.GL_POINT_FADE_THRESHOLD_SIZE_ARB, 100f);
    /*        GL14.glPointParameter(GL14.GL_POINT_DISTANCE_ATTENUATION, particleDistanceScalarBuffer);
            GL14.glPointParameterf( GL14.GL_POINT_SIZE_MIN, 1f);//(float)particle.getSize());//1f );
            GL14.glPointParameterf( GL14.GL_POINT_SIZE_MAX, maxPointSpriteSize);
            GL14.glPointParameterf(GL14.GL_POINT_FADE_THRESHOLD_SIZE, 100f);
    *//*  ww  w  .ja  v a  2  s .co m*/

    GL14.glPointParameterf(GL20.GL_POINT_SPRITE_COORD_ORIGIN, GL20.GL_LOWER_LEFT);
    GL11.glTexEnvf(ARBPointSprite.GL_POINT_SPRITE_ARB, ARBPointSprite.GL_COORD_REPLACE_ARB, GL11.GL_TRUE);
    //        GL11.glTexEnvf(  GL20.GL_POINT_SPRITE, GL20.GL_COORD_REPLACE, GL11.GL_TRUE );

    GL11.glPointSize((float) spriteSize); //POINT_SIZE_WORLD_COORD_SCALAR);
}

From source file:fable.framework.ui.views.chiPlotView.java

License:Open Source License

/**
 * Build the list to display here// w  w  w  .jav  a2 s  .com
 */
private static void drawReliefList() {

    if (!reliefListFirst) {
        GL11.glDeleteLists(reliefList, 1);
    }
    reliefListFirst = false;
    reliefList = GL11.glGenLists(1);
    GL11.glNewList(reliefList, GL11.GL_COMPILE);
    GL11.glColor3f(1.0f, 1.0f, 1.0f); // white
    GL11.glPointSize(pointSize);
    for (int i = 0; i < imageWidth - 1; i++) {
        GL11.glBegin(GL11.GL_LINE_STRIP);
        int j = i + 1;
        int color_index = (int) image[i];
        if (color_index < 0)
            color_index = 0;
        if (color_index > COLOR_INDEX_MAX)
            color_index = COLOR_INDEX_MAX;
        GL11.glColor3f(red[color_index], green[color_index], blue[color_index]); // temperature lut
        GL11.glVertex3f(i, image[i], image[j]);
        // System.out.println("i=" + i + ", j=" + j + " image[i]=" +
        // image[i] + " image[j]=" + image[j]);
        GL11.glEnd();
    }
    /*
     * gl.glBegin(GL.GL_TRIANGLES);
     * 
     * gl.glVertex3f(-1.0f, -0.5f, 0.0f); // lower left vertex
     * gl.glVertex3f( 1.0f, -0.5f, 0.0f); // lower right vertex
     * gl.glVertex3f( 0.0f, 0.5f, 0.0f); // upper vertex
     * 
     * gl.glEnd();
     */
    GL11.glEndList();
    GL11.glFlush();
}

From source file:fable.imageviewer.views.ReliefView.java

License:Open Source License

private void drawReliefList() {
    // long started = System.currentTimeMillis();
    if (!reliefListFirst) {
        GL11.glDeleteLists(reliefList, 1);
    }//from  w  w w  .  jav a2s. c  o  m
    reliefListFirst = false;
    reliefList = GL11.glGenLists(1);
    GL11.glNewList(reliefList, GL11.GL_COMPILE);
    GL11.glColor3f(1.0f, 1.0f, 1.0f); // white
    GL11.glPointSize(pointSize);
    for (int i = 0; i < imageWidth; i++) {
        GL11.glBegin(GL11.GL_LINE_STRIP);
        for (int j = 0; j < imageHeight; j++) {
            int color_index;
            color_index = (int) image[j * imageWidth + i];
            if (color_index < 0)
                color_index = 0;
            if (color_index > colorIndexMax)
                color_index = colorIndexMax;
            GL11.glColor3f(red[color_index], green[color_index], blue[color_index]); // temperature lut
            GL11.glVertex3f(i, j, image[j * imageWidth + i]);
        }
        GL11.glEnd();
    }
    for (int i = 0; i < imageHeight; i++) {
        GL11.glBegin(GL11.GL_LINE_STRIP);
        for (int j = 0; j < imageWidth; j++) {
            int color_index;
            color_index = (int) image[i * imageWidth + j];
            if (color_index < 0)
                color_index = 0;
            if (color_index > colorIndexMax)
                color_index = colorIndexMax;
            GL11.glColor3f(red[color_index], green[color_index], blue[color_index]); // temperature lut
            GL11.glVertex3f(j, i, image[i * imageWidth + j]);
        }
        GL11.glEnd();
    }
    GL11.glEndList();
    // long elapsed = System.currentTimeMillis()-started;
    // logger.debug("time to draw relief list "+elapsed+" ms");
}

From source file:fr.def.iss.vd2.lib_v3d.camera.V3DSimple2DCamera.java

License:Open Source License

private void displayTarget() {

    GL11.glColor4f(1.0f, 0.5f, 0.5f, 0.8f);
    GL11.glLineWidth(1.2f);/*from   w ww  .  j a va2  s .co  m*/
    GL11.glBegin(GL11.GL_LINES);
    {

        GL11.glColor4f(1.0f, 0.0f, 0.0f, 0.8f);
        GL11.glVertex3d(-1, 0, 0);
        GL11.glVertex3d(1, 0, 0);

        GL11.glVertex3d(0.9, 0.1, 0);
        GL11.glVertex3d(1, 0, 0);

        GL11.glVertex3d(0.9, -0.1, 0);
        GL11.glVertex3d(1, 0, 0);

        //y
        GL11.glColor4f(0.0f, 1.0f, 0.0f, 0.8f);
        GL11.glVertex3d(0, -1, 0);
        GL11.glVertex3d(0, 1, 0);

        GL11.glVertex3d(0.1, 0.9, 0);
        GL11.glVertex3d(0, 1, 0);

        GL11.glVertex3d(-0.1, 0.9, 0);
        GL11.glVertex3d(0, 1, 0);

        //z
        GL11.glColor4f(0.0f, 0.0f, 1.0f, 0.8f);
        GL11.glVertex3d(0, 0, -1);
        GL11.glVertex3d(0, 0, 1);

        GL11.glVertex3d(0.1, 0, 0.9);
        GL11.glVertex3d(0, 0, 1);

        GL11.glVertex3d(-0.1, 0, 0.9);
        GL11.glVertex3d(0, 0, 1);

    }
    GL11.glEnd();

    GL11.glPointSize(1.2f);
    GL11.glBegin(GL11.GL_POINTS);
    {
        GL11.glVertex3d(position.x, position.y, 0);

    }
    GL11.glEnd();

}

From source file:fr.def.iss.vd2.lib_v3d.camera.V3DSimple3DCamera.java

License:Open Source License

private void displayTarget() {

    GL11.glColor4f(1.0f, 0.5f, 0.5f, 0.8f);
    GL11.glLineWidth(1.2f);/*from ww w.ja  v  a 2 s .c  o  m*/
    GL11.glBegin(GL11.GL_LINES);
    {

        GL11.glColor4f(1.0f, 0.0f, 0.0f, 0.8f);
        GL11.glVertex3d(-1, 0, 0);
        GL11.glVertex3d(1, 0, 0);

        GL11.glVertex3d(0.9, 0.1, 0);
        GL11.glVertex3d(1, 0, 0);

        GL11.glVertex3d(0.9, -0.1, 0);
        GL11.glVertex3d(1, 0, 0);

        //y
        GL11.glColor4f(0.0f, 1.0f, 0.0f, 0.8f);
        GL11.glVertex3d(0, -1, 0);
        GL11.glVertex3d(0, 1, 0);

        GL11.glVertex3d(0.1, 0.9, 0);
        GL11.glVertex3d(0, 1, 0);

        GL11.glVertex3d(-0.1, 0.9, 0);
        GL11.glVertex3d(0, 1, 0);

        //z
        GL11.glColor4f(0.0f, 0.0f, 1.0f, 0.8f);
        GL11.glVertex3d(0, 0, -1);
        GL11.glVertex3d(0, 0, 1);

        GL11.glVertex3d(0.1, 0, 0.9);
        GL11.glVertex3d(0, 0, 1);

        GL11.glVertex3d(-0.1, 0, 0.9);
        GL11.glVertex3d(0, 0, 1);

    }
    GL11.glEnd();

    GL11.glPointSize(1.2f);
    GL11.glBegin(GL11.GL_POINTS);
    {
        GL11.glVertex3d(position.x, position.y, position.z);

    }
    GL11.glEnd();

}

From source file:fr.def.iss.vd2.lib_v3d.element.V3DBoundingBox.java

License:Open Source License

public void display() {

    if (showCenter) {
        GL11.glColor4f(centerColor.r, centerColor.g, centerColor.b, centerColor.a);
        GL11.glPointSize(4.0f);
        GL11.glBegin(GL11.GL_POINTS);//from  ww  w.j  av a  2  s .com

        GL11.glVertex3d(center.x, center.y, center.z);

        GL11.glEnd();
    }
    if (flat || size.z == 0) {
        displayFlat();
    } else {
        displayThick();
    }
}

From source file:fr.def.iss.vd2.lib_v3d.element.V3DCircle.java

License:Open Source License

@Override
protected void doDisplay(I3dCamera camera) {

    GL11.glLineWidth(thickness);/* ww w.  j av a2s  .  c  o  m*/
    GL11.glPointSize(thickness * 0.9f);

    if (renderMode == RenderMode.SOLID) {
        innerRadius = 0.9f * radius;
        drawSolidCircle();

    } else {
        //glu.gluPartialDisk(qobj, 0, radius, quality, 4, 0, 360);

        if (innerRadius == 0) {
            drawCircle();
        } else {
            drawExternCircle();
        }
    }
}

From source file:fr.def.iss.vd2.lib_v3d.element.V3DPoint.java

License:Open Source License

@Override
protected void doDisplay(I3dCamera camera) {

    GL11.glPointSize(size);

    GL11.glBegin(GL11.GL_POINTS);

    GL11.glVertex3d(0, 0, 0);

    GL11.glEnd();

}

From source file:fr.def.iss.vd2.lib_v3d.v3draw.V3DrawReader.java

License:Open Source License

private void setPointThickness() {
    float thickness = buffer.getFloat();
    GL11.glPointSize(thickness);
    // System.err.println("glPointSize " + thickness);
}