more obj loader
parent
2a04b8e8a9
commit
433a6dc773
|
@ -61,7 +61,7 @@ public class Example {
|
|||
Window.setBackgroundColour(0.2f, 0.2f, 0.8f);
|
||||
|
||||
|
||||
TexturedModel tModel = ModelLoader.loadModel("Zebra.obj", "stallTexture.png");
|
||||
TexturedModel tModel = ModelLoader.loadModel("stall.obj", "stallTexture.png");
|
||||
tModel.getTexture().setReflectivity(1f);
|
||||
tModel.getTexture().setShineDamper(7f);
|
||||
Player entity = new Player(tModel, new Vector3f(0,0,-3),0,180f,0, new Vector3f(0.2f, 0.2f, 0.2f));
|
||||
|
@ -86,7 +86,7 @@ public class Example {
|
|||
|
||||
|
||||
|
||||
TexturedModel dragonMdl = ModelLoader.loadModel("dragon.obj", "stallTexture.png");
|
||||
TexturedModel dragonMdl = ModelLoader.loadModel("Zebra.obj", "stallTexture.png");
|
||||
dragonMdl.getTexture().setReflectivity(4f);
|
||||
dragonMdl.getTexture().setShineDamper(2f);
|
||||
|
||||
|
|
|
@ -80,15 +80,11 @@ public class OBJFileLoader {
|
|||
float y = vertex.getPosition().y;
|
||||
float z = vertex.getPosition().z;
|
||||
|
||||
verticies[i] = x;
|
||||
i++;
|
||||
verticies[i] = y;
|
||||
i++;
|
||||
verticies[i] = z;
|
||||
i++;
|
||||
textureCoords[j] = vertex.getTextureIndex().x;
|
||||
j++;
|
||||
textureCoords[j] = vertex.getTextureIndex().y;
|
||||
verticies[i++] = x;
|
||||
verticies[i++] = y;
|
||||
verticies[i++] = z;
|
||||
textureCoords[j++] = vertex.getTextureIndex().x;
|
||||
textureCoords[j++] = vertex.getTextureIndex().y;
|
||||
}
|
||||
|
||||
return new ModelData(verticies, textureCoords, new float[normals.sizeof()], indicesList, i);
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue