Examples of Vector3f


Examples of org.lwjgl.util.vector.Vector3f

    private static Vector3f parseNormal(String line) {
        String[] xyz = line.split(" ");
        float x = Float.valueOf(xyz[1]);
        float y = Float.valueOf(xyz[2]);
        float z = Float.valueOf(xyz[3]);
        return new Vector3f(x, y, z);
    }
View Full Code Here

Examples of org.lwjgl.util.vector.Vector3f

                            .ambientColour[0], face.getMaterial().ambientColour[1],
                            face.getMaterial().ambientColour[2], 1));
                    glMaterialf(GL_FRONT, GL_SHININESS, face.getMaterial().specularCoefficient);
                }
                if (face.hasNormals()) {
                    Vector3f n1 = m.getNormals().get(face.getNormalIndices()[0] - 1);
                    glNormal3f(n1.x, n1.y, n1.z);
                }
                if (face.hasTextureCoordinates()) {
                    Vector2f t1 = m.getTextureCoordinates().get(face.getTextureCoordinateIndices()[0] - 1);
                    glTexCoord2f(t1.x, t1.y);
                }
                Vector3f v1 = m.getVertices().get(face.getVertexIndices()[0] - 1);
                glVertex3f(v1.x, v1.y, v1.z);
                if (face.hasNormals()) {
                    Vector3f n2 = m.getNormals().get(face.getNormalIndices()[1] - 1);
                    glNormal3f(n2.x, n2.y, n2.z);
                }
                if (face.hasTextureCoordinates()) {
                    Vector2f t2 = m.getTextureCoordinates().get(face.getTextureCoordinateIndices()[1] - 1);
                    glTexCoord2f(t2.x, t2.y);
                }
                Vector3f v2 = m.getVertices().get(face.getVertexIndices()[1] - 1);
                glVertex3f(v2.x, v2.y, v2.z);
                if (face.hasNormals()) {
                    Vector3f n3 = m.getNormals().get(face.getNormalIndices()[2] - 1);
                    glNormal3f(n3.x, n3.y, n3.z);
                }
                if (face.hasTextureCoordinates()) {
                    Vector2f t3 = m.getTextureCoordinates().get(face.getTextureCoordinateIndices()[2] - 1);
                    glTexCoord2f(t3.x, t3.y);
                }
                Vector3f v3 = m.getVertices().get(face.getVertexIndices()[2] - 1);
                glVertex3f(v3.x, v3.y, v3.z);
            }
            glEnd();
        }
        glEndList();
View Full Code Here

Examples of org.lwjgl.util.vector.Vector3f

            } else if (line.startsWith("v ")) {
                String[] xyz = line.split(" ");
                float x = Float.valueOf(xyz[1]);
                float y = Float.valueOf(xyz[2]);
                float z = Float.valueOf(xyz[3]);
                m.getVertices().add(new Vector3f(x, y, z));
            } else if (line.startsWith("vn ")) {
                String[] xyz = line.split(" ");
                float x = Float.valueOf(xyz[1]);
                float y = Float.valueOf(xyz[2]);
                float z = Float.valueOf(xyz[3]);
                m.getNormals().add(new Vector3f(x, y, z));
            } else if (line.startsWith("vt ")) {
                String[] xyz = line.split(" ");
                float s = Float.valueOf(xyz[1]);
                float t = Float.valueOf(xyz[2]);
                m.getTextureCoordinates().add(new Vector2f(s, t));
View Full Code Here

Examples of org.lwjgl.util.vector.Vector3f

                Display.destroy();
                System.exit(1);
            }
            glBegin(GL_TRIANGLES);
            for (Model.Face face : m.getFaces()) {
                Vector3f n1 = m.getNormals().get(face.getNormalIndices()[0] - 1);
                glNormal3f(n1.x, n1.y, n1.z);
                Vector3f v1 = m.getVertices().get(face.getVertexIndices()[0] - 1);
                glVertex3f(v1.x, v1.y, v1.z);
                Vector3f n2 = m.getNormals().get(face.getNormalIndices()[1] - 1);
                glNormal3f(n2.x, n2.y, n2.z);
                Vector3f v2 = m.getVertices().get(face.getVertexIndices()[1] - 1);
                glVertex3f(v2.x, v2.y, v2.z);
                Vector3f n3 = m.getNormals().get(face.getNormalIndices()[2] - 1);
                glNormal3f(n3.x, n3.y, n3.z);
                Vector3f v3 = m.getVertices().get(face.getNormalIndices()[2] - 1);
                glVertex3f(v3.x, v3.y, v3.z);
            }
            glEnd();
        }
        glEndList();
View Full Code Here

Examples of org.openmali.vecmath.Vector3f

    controller.setStopOperation( StopOperation.DESTROY_AND_EXIT );
    controller.setMaxFPS( graphicsConfiguration.getMaxFps() );
    controller.getInputManager().registerKeyboardAndMouse( canvas3D );
   
    addPerspectiveBranch( createScene() );
    getView().lookAt( new Vector3f( 0f, 0f, 1f ), new Vector3f( 0f, 0f, 0f ), new Vector3f( 0f, 1f, 0f ) );
  }
View Full Code Here

Examples of org.openmali.vecmath2.Vector3f

  }
 
  public Food(World world, float x, float y, float z) {
    this.world = world;
   
    this.pos = new Vector3f(x, y, z);
   
    this.addChild(new Transform().setTranslation(x, y, z + .5f).add(
        new Random(System.currentTimeMillis()).nextBoolean()
    ? getApple() : getDrink()));
   
View Full Code Here

Examples of org.spout.math.vector.Vector3f

    }
    seed = WorldGeneratorUtils.getSeed(seed, 4324337, 234571, 76537, material.getId());
    elevation.setSeed((int) (seed * 101));
    shapeBase.setSeed((int) (seed * 313));
    shape.setSeed((int) (seed * 661));
    final Vector3f size = blockData.getSize();
    final int sizeX = size.getFloorX();
    final int sizeY = GenericMath.clamp(size.getFloorY(), 0, NetherGenerator.HEIGHT);
    final int sizeZ = size.getFloorZ();
    final int scale = sizeY / 2;
    final double[][] displacements = WorldGeneratorUtils.fastNoise(elevation, sizeX, sizeZ, 4, x, 0, z);
    final double[][] values = WorldGeneratorUtils.fastNoise(shape, sizeX, sizeZ, 4, x, 0, z);
    for (int xx = 0; xx < sizeX; xx++) {
      for (int zz = 0; zz < sizeZ; zz++) {
View Full Code Here

Examples of railo.runtime.img.vecmath.Vector3f

  public ShadeFilter() {
    bumpHeight = 1.0f;
    bumpSoftness = 5.0f;
    //l = new Vector3f();
    v = new Vector3f();
    //n = new Vector3f();
    //shadedColor = new Color4f();
    //diffuse_color = new Color4f();
    //specular_color = new Color4f();
    tmpv = new Vector3f();
    tmpv2 = new Vector3f();
  }
View Full Code Here

Examples of soc.qase.tools.vecmath.Vector3f

1' option.
@param clipPos the position to which the agent should clip */
/*-------------------------------------------------------------------*/
  protected void clipToPosition(Vector3f clipPos)
  {
    initPos = (clipPos == null ? null : new Vector3f(clipPos));
    initPosReached = (initPos == null);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.