master
王宇洋 3 years ago
parent 2a5e062e6a
commit 94cc3ab5fb

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -3,7 +3,7 @@ package Scene.Objects;
import Scene.base.SceneObject; import Scene.base.SceneObject;
import base.GraphicsObjects.Point4f; import base.GraphicsObjects.Point4f;
import base.GraphicsObjects.Vector4f; import base.GraphicsObjects.Vector4f;
import base.objects3D.TexCube; import base.objects3D.DisplayListTexCube;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.newdawn.slick.Color; import org.newdawn.slick.Color;
import org.newdawn.slick.opengl.Texture; import org.newdawn.slick.opengl.Texture;
@ -18,7 +18,7 @@ import java.util.HashMap;
* @Description: * @Description:
**/ **/
public class Copyleft extends SceneObject { public class Copyleft extends SceneObject {
private TexCube cube = new TexCube(); private DisplayListTexCube cube = new DisplayListTexCube();
public Copyleft(Point4f origin, Point4f position, Vector4f scale) { public Copyleft(Point4f origin, Point4f position, Vector4f scale) {
super(origin, position, scale); super(origin, position, scale);
@ -46,7 +46,7 @@ public class Copyleft extends SceneObject {
; ;
// GL11.glDisable(GL11.GL_LIGHTING); // switch lighting off // GL11.glDisable(GL11.GL_LIGHTING); // switch lighting off
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
cube.DrawTexCube(1f); cube.DrawTexCube();
// GL11.glEnable(GL11.GL_LIGHTING); // switch lighting off // GL11.glEnable(GL11.GL_LIGHTING); // switch lighting off
; ;

@ -3,7 +3,8 @@ package Scene.Objects;
import Scene.base.SceneObject; import Scene.base.SceneObject;
import base.GraphicsObjects.Point4f; import base.GraphicsObjects.Point4f;
import base.GraphicsObjects.Vector4f; import base.GraphicsObjects.Vector4f;
import base.objects3D.TexCube; import base.objects3D.DisplayListTexCube;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.newdawn.slick.Color; import org.newdawn.slick.Color;
import org.newdawn.slick.opengl.Texture; import org.newdawn.slick.opengl.Texture;
@ -18,7 +19,7 @@ import java.util.HashMap;
* @Description: * @Description:
**/ **/
public class Cube extends SceneObject { public class Cube extends SceneObject {
private TexCube cube = new TexCube(); private DisplayListTexCube cube = new DisplayListTexCube();
public Cube(Point4f origin, Point4f position, Vector4f scale) { public Cube(Point4f origin, Point4f position, Vector4f scale) {
super(origin, position, scale); super(origin, position, scale);
@ -45,7 +46,7 @@ public class Cube extends SceneObject {
getTextures().get("default_dirt").bind(); getTextures().get("default_dirt").bind();
; ;
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
cube.DrawTexCube(1f); cube.DrawTexCube();
; ;
} }

@ -198,12 +198,12 @@ public class Player extends SceneObject {
LimbRotation = 0; LimbRotation = 0;
} }
//a sphere for drawing // //a sphere for drawing
Sphere sphere = new Sphere(); // Sphere sphere = new Sphere();
//a sphere with texture // //a sphere with texture
TexSphere texSphere = new TexSphere(); // TexSphere texSphere = new TexSphere();
//a cylinder for drawing // //a cylinder for drawing
Cylinder cylinder = new Cylinder(); // Cylinder cylinder = new Cylinder();
//Start to draw //Start to draw
GL11.glPushMatrix(); GL11.glPushMatrix();

@ -1,39 +0,0 @@
package Scene.Objects;
import Scene.base.SceneObject;
import base.GraphicsObjects.Point4f;
import base.GraphicsObjects.Vector4f;
import base.objects3D.Oval;
import org.lwjgl.opengl.GL11;
import org.newdawn.slick.Color;
import org.newdawn.slick.opengl.Texture;
import java.util.HashMap;
/**
* @Author: WangYuyang
* @Date: 2021/11/6-00:58
* @Project: Assignment3
* @Package: Scene.Objects
* @Description:
**/
public class TestObj extends SceneObject {
Oval oval = new Oval();
public TestObj(Point4f origin, Point4f position, Vector4f scale) {
super(origin, position, scale);
}
public TestObj(Point4f origin, Point4f position, Vector4f scale, HashMap<String, Texture> textures) {
super(origin, position, scale, textures);
}
public TestObj(Point4f origin, Point4f position, Vector4f scale, Vector4f rotation, HashMap<String, Texture> textures) {
super(origin, position, scale, rotation, textures);
}
@Override
public void draw(Integer frame_delta) {
Color.black.bind();
oval.DrawOval(1, 32);
}
}

@ -3,6 +3,7 @@ package Scene.Objects;
import Scene.base.SceneObject; import Scene.base.SceneObject;
import base.GraphicsObjects.Point4f; import base.GraphicsObjects.Point4f;
import base.GraphicsObjects.Vector4f; import base.GraphicsObjects.Vector4f;
import base.objects3D.DisplayListTexCube;
import base.objects3D.TexCube; import base.objects3D.TexCube;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.newdawn.slick.Color; import org.newdawn.slick.Color;
@ -18,7 +19,7 @@ import java.util.HashMap;
* @Description: * @Description:
**/ **/
public class Wall extends SceneObject { public class Wall extends SceneObject {
private TexCube MyGrid = new TexCube(); private DisplayListTexCube MyGrid = new DisplayListTexCube();
public Wall(Point4f origin, Point4f position, Vector4f scale) { public Wall(Point4f origin, Point4f position, Vector4f scale) {
super(origin, position, scale); super(origin, position, scale);
@ -47,7 +48,7 @@ public class Wall extends SceneObject {
// getTextures().get("default_dirt").bind(); // getTextures().get("default_dirt").bind();
; ;
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
MyGrid.DrawTexCube(10f); MyGrid.DrawTexCube();
; ;
} }

@ -3,7 +3,8 @@ package Scene.skybox;
import Scene.base.SceneObject; import Scene.base.SceneObject;
import base.GraphicsObjects.Point4f; import base.GraphicsObjects.Point4f;
import base.GraphicsObjects.Vector4f; import base.GraphicsObjects.Vector4f;
import base.objects3D.TexCube; import base.objects3D.DisplayListTexCube;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
import org.newdawn.slick.Color; import org.newdawn.slick.Color;
@ -21,7 +22,7 @@ import static org.lwjgl.opengl.GL11.*;
* @Description: * @Description:
**/ **/
public class Skybox extends SceneObject { public class Skybox extends SceneObject {
private TexCube cube = new TexCube(); private DisplayListTexCube cube = new DisplayListTexCube();
int face1 = glGenLists(1); int face1 = glGenLists(1);
int face2 = glGenLists(1); int face2 = glGenLists(1);
int face3 = glGenLists(1); int face3 = glGenLists(1);

Loading…
Cancel
Save