Examples of FszMatrix4


Examples of net.anzix.fsz.voxelworld.FszMatrix4

    public Box( FszMatrix4 position, double sizeX, double sizeY, double sizeZ) {
        this.halfSizeX = sizeX / 2.0;
        this.halfSizeY = sizeY / 2.0;
        this.halfSizeZ = sizeZ / 2.0;
        this.transform = new FszMatrix4();
        position.invert(transform);
    }
View Full Code Here

Examples of net.anzix.fsz.voxelworld.FszMatrix4

    private int numOfNonVoxelBranches = 0;
    private Vector3 trunkStartpoint;
   
    public Tree(Vector3 trunkStartpoint, double trunkLength, double trunkRadius) {
        this.trunkStartpoint = trunkStartpoint;
        FszMatrix4 position = new FszMatrix4();
        position.setTranslation(trunkStartpoint);

        AddBranch(position, 1, trunkLength, trunkRadius);
    }
View Full Code Here

Examples of net.anzix.fsz.voxelworld.FszMatrix4

        IntBuffer indexBuffer = BufferUtils.createIntBuffer(numOfLeafs * 12);
        //FloatBuffer normalBuffer = BufferUtils.createVector3Buffer(numOfLeafs*4);
      
      
        for (int i = 0; i<foliagePositions.size(); i++) {
            FszMatrix4 position = foliagePositions.get(i);
                       
            points[0].set(-14, -1, 0);
            points[1].set(-14, 20, 0);
            points[2].set(14, 20, 0);
            points[3].set(14, -1, 0);
           
            points[4].set(0, -1, -14);
            points[5].set(0, 20, -14);
            points[6].set(0, 20, 4);
            points[7].set(0, -1, 4);
           
            for (Vector3 p : points) {
                position.applyPost(p,p);
                vertexBuffer.put(p.getXf());
                vertexBuffer.put(p.getYf());
                vertexBuffer.put(p.getZf());
            }

View Full Code Here

Examples of net.anzix.fsz.voxelworld.FszMatrix4

        IntBuffer indexBuffer = BufferUtils.createIntBuffer(numOfNonVoxelBranches * (numOfSegments + 1) * 2);
        FloatBuffer normalBuffer = BufferUtils.createVector3Buffer(numOfNonVoxelBranches * numOfSegments * 2);
             
        for (int i = 0; i<branches.size(); i++) {
            Branch branch = branches.get(i);
            FszMatrix4 transform = branch.getTransform();
            double startRadius = branch.getStartRadius();
            double endRadius = branch.getEndRadius();
            double length = branch.getLength();
           
            int ii = i* numOfSegments * 2;
            Vector3 startPoint = branch.getStartPoint();

            for (int s = 0; s<numOfSegments; s++) {
                double angle = s * Math.PI * 2 /numOfSegments ;
                float texCoordX = s/(float)numOfSegments;
               
                double ux = Math.cos(angle);
                double uz = Math.sin(angle);
               
                VoxelWorld.logger.info("SZOG " + angle +" "+ ux +" "+uz);
                point1.set( ux*startRadius, 0, uz*startRadius);
                point2.set( ux*endRadius, length, uz*endRadius);
               
                transform.applyPost(point1,point1);
                transform.applyPost(point2,point2);
               
                vertexBuffer.put(point1.getXf());
                vertexBuffer.put(point1.getYf());
                vertexBuffer.put(point1.getZf());
               
View Full Code Here

Examples of net.anzix.fsz.voxelworld.FszMatrix4

       
            numOfNonVoxelBranches++;
       
            branch.shiftPositionToEndpoint(position);
           
            FszMatrix4 position2 = new FszMatrix4 (position);
            double divisionFactor = Math.random();
            AddBranch(position2, divisionFactor, length, endRadius)
            AddBranch(position,  1.0-divisionFactor, length, endRadius)
        } else {
View Full Code Here

Examples of net.anzix.fsz.voxelworld.FszMatrix4

       
        this.innerHalfSizeX = sizeX / 2.0 - wallThickness;
        this.innerHalfSizeY = sizeY / 2.0 + wallThickness;
        this.innerHalfSizeZ = sizeZ / 2.0 - wallThickness;

        this.transform = new FszMatrix4();
        position.invert(transform);
    }
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.