finished game-engine-terrain-generation #2
@ -128,7 +128,7 @@ public class Engine {
|
||||
|
||||
//Create Hexagon
|
||||
HexagonModel hexagonModel = new HexagonModel();
|
||||
RawModel hexagonRawModel = loader.loadToVAO(hexagonModel.getVertices(), hexagonModel.getTextureCoords(), hexagonModel.getNormals(), hexagonModel.getIndices());
|
||||
RawModel hexagonRawModel = loader.loadHexagon(hexagonModel);
|
||||
ModelTexture hexagonTexture = new ModelTexture(loader.loadTexture("white"));
|
||||
TexturedModel hexagontexturedModel = new TexturedModel(hexagonRawModel, hexagonTexture);
|
||||
Entity hexagonEntity = new Entity(hexagontexturedModel, new Vector3f(0,1,0), 0,0,0,1);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package core.engine;
|
||||
|
||||
import core.engine.model.HexagonModel;
|
||||
import core.engine.model.RawModel;
|
||||
import core.engine.textures.Texture;
|
||||
import org.lwjgl.BufferUtils;
|
||||
@ -29,6 +30,10 @@ public class Loader {
|
||||
return new RawModel(vaoID, indices.length);
|
||||
}
|
||||
|
||||
public RawModel loadHexagon(HexagonModel hexagonModel) {
|
||||
return loadToVAO(hexagonModel.getVertices(), hexagonModel.getTextureCoords(), hexagonModel.getNormals(), hexagonModel.getIndices());
|
||||
}
|
||||
|
||||
public int loadTexture(String fileName) {
|
||||
Texture texture = new Texture("res/" + fileName + ".png");
|
||||
int textureID = texture.getTextureID();
|
||||
|
@ -9,7 +9,6 @@ import java.util.List;
|
||||
|
||||
public class Terrain {
|
||||
|
||||
|
||||
private List<TerrainTile> terrainTiles = new ArrayList<>();
|
||||
|
||||
public Terrain(Loader loader, ModelTexture modelTexture) {
|
||||
|
Loading…
Reference in New Issue
Block a user