Package aspect.render

Examples of aspect.render.Material


    @Override
    public void onAdd() {
       
        printGlVersion();
        player = new Player(Vector3.zero());
        Material material = new Material(Texture.create(UNLOADED_IMAGE));
        cube = new Entity(box(material, 0.9f, 0.7f, 0.6f));
        cube.pos = new Vector3(-1, 0, -4);
        cube.ang.pitch = -20;
        pipe = new Entity(pipe(material, 0.5f, 2, 60));
        pipe.pos = new Vector3(1, 0, -4);
View Full Code Here


        run(800, 600, false, 60, new EntityDemo());
    }
   
    @Override
    public void onAdd() {
        Material material = new Material(loadTexture(new File("textures/tex.jpg")));
        ViewModel model = box(material, 1, 1, 1);
        cube = new Entity(model);
        cube.pos.z = -4;
        cube.addBehavior(new Seizure());
        cube.addBehavior(new CmpntRotate());
View Full Code Here

                if (timeUntilSpawn <= 0) {
                    float width = random.nextFloat() * 2.0f + 1.0f;
                    float height = random.nextFloat() * 2.0f + 1.0f;
                    float depth = random.nextFloat() * 2.0f + 1.0f;
                    final Entity entity = RigidBody.box(new Material(Color.random()), width, height, depth, 1.0f);

                    entity.addBehavior(new Behavior() {
                        @Override
                        public void update() {
                            if (entity.transform.position.y < -20.0f || isKeyDown(KEY_LCONTROL)) {
View Full Code Here

    public static Material loadMaterial(File source) {
        try {
            return loadMaterial(getStream(source));
        } catch (IOException ex) {
            Logger.getLogger(Resources.class.getName()).log(Level.SEVERE, null, ex);
            return new Material();
        }
    }
View Full Code Here

    // When loading a Material from an InputStream, make sure to load the Shader
    // and Texture first.
    public static Material loadMaterial(InputStream source) {
        String s = loadTextFile(source);
        Material m = new Material();
        for (String line : s.trim().split("\n")) {
            line = line.trim();
            String[] args = line.split(" ");
            if (line.startsWith("#") || line.isEmpty()) {
                continue;
View Full Code Here

    public static Material loadMaterial(String name, File source) {
        if (MATERIALS.containsKey(name)) {
            return MATERIALS.get(name);
        }

        Material material = loadMaterial(source);
        addMaterial(name, material);
        return material;
    }
View Full Code Here

    public static Material loadMaterial(String name, InputStream source) {
        if (MATERIALS.containsKey(name)) {
            return MATERIALS.get(name);
        }

        Material material = loadMaterial(source);
        addMaterial(name, material);
        return material;
    }
View Full Code Here

    public static ViewModel loadObj(String obj, Vector3 scale) throws IOException {
        ArrayList<Vector3> allVertices = new ArrayList<>(100);
        ArrayList<Vector2> allTexCoords = new ArrayList<>(100);
        ArrayList<Vector3> allNormals = new ArrayList<>(100);

        Material currentMaterial = null;
        //LinkedList<ViewModel> polygons = new LinkedList<>();

        HashMap<Material, LinkedList<Vertex>> triangles = new HashMap<>();

        for (String s : obj.trim().split("\n")) {
View Full Code Here

        return new MultiModel(polygons);
    }

    public static void loadMtl(String mtl) throws IOException {
        HashMap<String, Color> colors = new HashMap<>();
        Material current = null;

        for (String s : mtl.trim().split("\n")) {
            s = s.trim();
            String[] parts = s.split(" ");
            switch (parts[0]) {
                case "newmtl": {
                    current = new Material();
                    current.shader = ShaderProgram.PHONG;
                    current.cull = false;
                    addMaterial(parts[1], current);
                    break;
                }
View Full Code Here

        float[] texCoords = rectTexCoords(hRepeat, vRepeat);
        return new Mesh(QUADS, vertices, copyVector3(Vector3.zAxis(), 4), texCoords, texture);
    }

    public static ViewModel rect(Color color, float width, float height) {
        return rect(new Material(color), width, height);
    }
View Full Code Here

TOP

Related Classes of aspect.render.Material

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.