Android Open Source - kgl2 Roof






From Project

Back to project page kgl2.

License

The source code is released under:

Boost Software License - Version 1.0 - August 17th, 2003 Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation co...

If you think the Android project kgl2 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*          Copyright  2014 Stanislav Petriakov
// Distributed under the Boost Software License, Version 1.0.
//    (See accompanying file LICENSE_1_0.txt or copy at
//          http://www.boost.org/LICENSE_1_0.txt)
*//*  www . ja v a 2  s  . c o  m*/
package kg.fucking.shit.kgl2;

/**
 * Created by 4eRT on 29.12.2014.
 */
public class Roof extends Mesh {
    public Roof(float width, float height, float depth) {
        width /= 2;
        depth /= 2;

        // +0.1f - fix for overlap
        float vertices[] = {
                -width - width / 4, height - height / 8 + 0.1f, depth + depth / 4,
                -width - width / 4, height + height / 2 + 0.1f, 0,
                -width - width / 4, height - height / 8 + 0.1f, -depth - depth / 4,
                width + width / 4, height - height / 8 + 0.1f, -depth - depth / 4,
                width + width / 4, height + height / 2 + 0.1f, 0,
                width + width / 4, height - height / 8 + 0.1f, depth + depth / 4,
        };

        short indices[] = {
                0, 1, 4,
                0, 4, 5,
                1, 2, 3,
                1, 4, 3,
        };

        float textureCoordinates[] = {
                0.0f, 2.0f,
                0.0f, 0.0f,
                0.0f, 2.0f,
                2.0f, 2.0f,
                2.0f, 0.0f,
                2.0f, 2.0f,
        };

        setIndices(indices);
        setVertices(vertices);
        setTextureCoordinates(textureCoordinates);
    }

}




Java Source Code List

kg.fucking.shit.kgl2.Group.java
kg.fucking.shit.kgl2.HouseBlock.java
kg.fucking.shit.kgl2.InDaHouse.java
kg.fucking.shit.kgl2.Main.java
kg.fucking.shit.kgl2.Mesh.java
kg.fucking.shit.kgl2.OpenGLRenderer.java
kg.fucking.shit.kgl2.Plane.java
kg.fucking.shit.kgl2.Roof.java
kg.fucking.shit.kgl2.Sofa.java