Package main.asset

Examples of main.asset.ModelChunk


        glFrontFace(GL_CCW);
        glClearColor(0.0f, 0.0f, 0.0f, 1.0f);

        long start = System.currentTimeMillis();
        AssetFile assets = AssetFile.load(new File("assets/test.ten"));
        ModelChunk model = (ModelChunk) assets.findChunk("carrier");
        System.out.println(System.currentTimeMillis() - start);
        TextureChunk tex1 = (TextureChunk) assets.findChunk("tex1");

        ByteBuffer buf = ByteBuffer.allocateDirect(tex1.getData().length);
        System.out.println(tex1.getData().length);
        buf.put(tex1.getData());
        buf.flip();

        texture1 = new Texture(buf, tex1.getWidth(), tex1.getHeight());
        texture1.bindTexture();
        texture1.useTexture();

        lightShader = new Shader(Shader.DEFAULT_LIGHT_VERTEX_PROGRAM, Shader.DEFAULT_LIGHT_FRAGMENT_PROGRAM);
        texShader = new Shader("assets/shaders/texture_shader");
        triangleBatch = new RenderableObject(GL_TRIANGLES, model.getVertices(), null, model.getNormals(), model.getTextureCoordinates(), model.getIndices());

        glViewport(0, 0, 640, 480);
    }
View Full Code Here

TOP

Related Classes of main.asset.ModelChunk

Copyright © 2018 www.massapicom. 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.