Example usage for org.lwjgl.opengl GL11 glVertex3d

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

Introduction

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

Prototype

public static native void glVertex3d(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y,
        @NativeType("GLdouble") double z);

Source Link

Document

Double version of #glVertex3f Vertex3f .

Usage

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

License:Open Source License

public void displayFlatFaces() {
    float x0 = position.x - size.x / 2;
    float y0 = position.y - size.y / 2;
    float x1 = position.x + size.x / 2;
    float y1 = position.y + size.y / 2;
    GL11.glColor4f(faceColor.r, faceColor.g, faceColor.b, faceColor.a);
    GL11.glBegin(GL11.GL_QUADS);//from  w  ww  . j a  va  2 s  . c  om

    GL11.glVertex3d(x0, y1, 0);
    GL11.glVertex3d(x0, y0, 0);
    GL11.glVertex3d(x1, y0, 0);
    GL11.glVertex3d(x1, y1, 0);

    GL11.glEnd();
}

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

License:Open Source License

public void displayThickLines() {
    float x0 = position.x - size.x / 2;
    float x1 = position.x + size.x / 2;
    float y0 = position.y - size.y / 2;
    float y1 = position.y + size.y / 2;
    float z0 = position.z - size.z / 2;
    float z1 = position.z + size.z / 2;

    GL11.glColor4f(lineColor.r, lineColor.g, lineColor.b, lineColor.a);
    GL11.glLineWidth(2.0f);//from w  w w .  ja v a2 s  . co  m
    GL11.glBegin(GL11.GL_LINE_LOOP);

    GL11.glVertex3d(x0, y0, z1);
    GL11.glVertex3d(x0, y1, z1);
    GL11.glVertex3d(x1, y1, z1);
    GL11.glVertex3d(x1, y0, z1);

    GL11.glEnd();

    GL11.glBegin(GL11.GL_LINE_LOOP);

    GL11.glVertex3d(x0, y1, z0);
    GL11.glVertex3d(x0, y0, z0);
    GL11.glVertex3d(x1, y0, z0);
    GL11.glVertex3d(x1, y1, z0);

    GL11.glEnd();

    GL11.glBegin(GL11.GL_LINES);

    GL11.glVertex3d(x0, y1, z1);
    GL11.glVertex3d(x0, y1, z0);
    GL11.glVertex3d(x0, y0, z1);
    GL11.glVertex3d(x0, y0, z0);
    GL11.glVertex3d(x1, y0, z1);
    GL11.glVertex3d(x1, y0, z0);
    GL11.glVertex3d(x1, y1, z1);
    GL11.glVertex3d(x1, y1, z0);

    GL11.glEnd();
}

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

License:Open Source License

public void displayThickFaces() {
    float x0 = position.x - size.x / 2;
    float x1 = position.x + size.x / 2;
    float y0 = position.y - size.y / 2;
    float y1 = position.y + size.y / 2;
    float z0 = position.z - size.z / 2;
    float z1 = position.z + size.z / 2;

    GL11.glColor4f(faceColor.r, faceColor.g, faceColor.b, faceColor.a);
    GL11.glBegin(GL11.GL_QUADS);// w w w. j  av  a 2 s  .  c o  m

    GL11.glVertex3d(x0, y0, z1);
    GL11.glVertex3d(x0, y0, z0);
    GL11.glVertex3d(x1, y0, z0);
    GL11.glVertex3d(x1, y0, z1);

    GL11.glVertex3d(x0, y1, z1);
    GL11.glVertex3d(x0, y1, z0);
    GL11.glVertex3d(x0, y0, z0);
    GL11.glVertex3d(x0, y0, z1);

    GL11.glVertex3d(x1, y1, z1);
    GL11.glVertex3d(x1, y1, z0);
    GL11.glVertex3d(x0, y1, z0);
    GL11.glVertex3d(x0, y1, z1);

    GL11.glVertex3d(x1, y0, z1);
    GL11.glVertex3d(x1, y0, z0);
    GL11.glVertex3d(x1, y1, z0);
    GL11.glVertex3d(x1, y1, z1);

    GL11.glVertex3d(x0, y0, z0);
    GL11.glVertex3d(x0, y1, z0);
    GL11.glVertex3d(x1, y1, z0);
    GL11.glVertex3d(x1, y0, z0);

    GL11.glVertex3d(x0, y1, z1);
    GL11.glVertex3d(x0, y0, z1);
    GL11.glVertex3d(x1, y0, z1);
    GL11.glVertex3d(x1, y1, z1);

    GL11.glEnd();
}

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

License:Open Source License

@Override
protected void doDisplay(I3dCamera camera) {
    float x0 = -size.x / 2;
    float x1 = size.x / 2;
    float y0 = -size.y / 2;
    float y1 = size.y / 2;
    float z0 = -size.z / 2;
    float z1 = size.z / 2;

    if (renderMode == RenderMode.PLAIN) {

        //GL11.glEnable(GL11.GL_LIGHTING);

        GL11.glBegin(GL11.GL_QUADS);/*  w w w .j  a  va2s . com*/

        GL11.glNormal3f(0, 1, 0);
        GL11.glVertex3d(x0, y0, z1);
        GL11.glVertex3d(x0, y0, z0);
        GL11.glVertex3d(x1, y0, z0);
        GL11.glVertex3d(x1, y0, z1);

        GL11.glNormal3f(1, 0, 0);
        GL11.glVertex3d(x0, y1, z1);
        GL11.glVertex3d(x0, y1, z0);
        GL11.glVertex3d(x0, y0, z0);
        GL11.glVertex3d(x0, y0, z1);

        GL11.glNormal3f(0, -1, 0);
        GL11.glVertex3d(x1, y1, z1);
        GL11.glVertex3d(x1, y1, z0);
        GL11.glVertex3d(x0, y1, z0);
        GL11.glVertex3d(x0, y1, z1);

        GL11.glNormal3f(-1, 0, 0);
        GL11.glVertex3d(x1, y0, z1);
        GL11.glVertex3d(x1, y0, z0);
        GL11.glVertex3d(x1, y1, z0);
        GL11.glVertex3d(x1, y1, z1);

        GL11.glNormal3f(0, 0, 1);
        GL11.glVertex3d(x0, y0, z0);
        GL11.glVertex3d(x0, y1, z0);
        GL11.glVertex3d(x1, y1, z0);
        GL11.glVertex3d(x1, y0, z0);

        GL11.glNormal3f(0, 0, -1);
        GL11.glVertex3d(x0, y1, z1);
        GL11.glVertex3d(x0, y0, z1);
        GL11.glVertex3d(x1, y0, z1);
        GL11.glVertex3d(x1, y1, z1);

        GL11.glEnd();

        GL11.glDisable(GL11.GL_LIGHTING);
    }
    if (renderMode == RenderMode.SOLID) {

        GL11.glLineWidth(thickness);

        GL11.glEnable(GL11.GL_LINE_STIPPLE);
        GL11.glLineStipple(stippleFactor, stipplePattern);

        GL11.glBegin(GL11.GL_LINE_LOOP);

        GL11.glVertex3d(x0, y0, z1);
        GL11.glVertex3d(x0, y1, z1);
        GL11.glVertex3d(x1, y1, z1);
        GL11.glVertex3d(x1, y0, z1);

        GL11.glEnd();

        GL11.glBegin(GL11.GL_LINE_LOOP);

        GL11.glVertex3d(x0, y1, z0);
        GL11.glVertex3d(x0, y0, z0);
        GL11.glVertex3d(x1, y0, z0);
        GL11.glVertex3d(x1, y1, z0);

        GL11.glEnd();

        GL11.glBegin(GL11.GL_LINES);

        GL11.glVertex3d(x0, y1, z1);
        GL11.glVertex3d(x0, y1, z0);
        GL11.glVertex3d(x0, y0, z1);
        GL11.glVertex3d(x0, y0, z0);
        GL11.glVertex3d(x1, y0, z1);
        GL11.glVertex3d(x1, y0, z0);
        GL11.glVertex3d(x1, y1, z1);
        GL11.glVertex3d(x1, y1, z0);

        GL11.glEnd();

        GL11.glDisable(GL11.GL_LINE_STIPPLE);
    }
}

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

License:Open Source License

@Override
protected void doDisplay(I3dCamera camera) {

    GL11.glLineWidth(thickness);//  w w  w.ja  v  a  2s .  c o  m

    GL11.glEnable(GL11.GL_LINE_STIPPLE);
    GL11.glLineStipple(stippleFactor, stipplePattern);

    GL11.glBegin(GL11.GL_LINES);

    GL11.glVertex3d(locationA.x, locationA.y, locationA.z);
    GL11.glVertex3d(locationB.x, locationB.y, locationB.z);

    GL11.glEnd();

    GL11.glDisable(GL11.GL_LINE_STIPPLE);
}

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.element.V3DPolygon.java

License:Open Source License

private void displayPlainPolygon() {
    if (needCompute) {
        // TODO repair
        //computePolygon();
        needCompute = false;//from   w  w w  . j av  a 2  s  .c om
    }

    for (int i = 0; i < vertexTypeList.size(); i++) {

        List<double[]> vertexList = vertexListList.get(i);

        GL11.glBegin(vertexTypeList.get(i));
        for (double[] vertex : vertexList) {
            GL11.glVertex3d(vertex[0], vertex[1], 0);
        }
        GL11.glEnd();

    }
}

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

License:Open Source License

private void drawLine(V3DVect3 point0, V3DVect3 point1) {
    GL11.glVertex3d(point0.x, point0.y, 0);
    GL11.glVertex3d(point1.x, point1.y, 0);
}

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

License:Open Source License

@Override
protected void doDisplay(I3dCamera camera) {

    if (renderMode == RenderMode.PLAIN) {

        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glBegin(GL11.GL_QUADS);//from w  ww.  j a v  a2s  .co  m

        for (int i = 0; i < pointList.size(); i++) {
            if (i == 0) {
                drawQuad(pointList.get(pointList.size() - 1), pointList.get(i));
            } else {
                drawQuad(pointList.get(i - 1), pointList.get(i));
            }
        }
        GL11.glEnd();
        GL11.glDisable(GL11.GL_LIGHTING);
    }
    if (renderMode == RenderMode.SOLID) {

        GL11.glLineWidth(thickness);
        GL11.glBegin(GL11.GL_LINES);

        for (V3DVect3 point : pointList) {
            float z0 = -height / 2;
            float z1 = height / 2;
            GL11.glVertex3d(point.x, point.y, z1);
            GL11.glVertex3d(point.x, point.y, z0);
        }
        GL11.glEnd();
    }
}

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

License:Open Source License

private void drawQuad(V3DVect3 point0, V3DVect3 point1) {
    float normX = -(point1.y - point0.y);
    float normY = (point1.x - point0.x);
    float normLenght = (float) Math.sqrt(normX * normX + normY * normY);
    GL11.glNormal3f(normX / normLenght, normY / normLenght, 0);
    float z0 = -height / 2;
    float z1 = height / 2;
    GL11.glVertex3d(point0.x, point0.y, z1);
    GL11.glVertex3d(point0.x, point0.y, z0);
    GL11.glVertex3d(point1.x, point1.y, z0);
    GL11.glVertex3d(point1.x, point1.y, z1);
}