diff --git a/src/main/java/cactusServer/entities/Instance.java b/src/main/java/cactusServer/entities/Instance.java index c89d46a..930931d 100644 --- a/src/main/java/cactusServer/entities/Instance.java +++ b/src/main/java/cactusServer/entities/Instance.java @@ -3,6 +3,7 @@ import java.util.HashMap; import java.util.HashSet; +import org.ntlab.radishforandroidstudio.framework.model3D.BaseObject3D; import org.ntlab.radishforandroidstudio.framework.model3D.Object3D; import org.ntlab.radishforandroidstudio.framework.model3D.Position3D; import org.ntlab.radishforandroidstudio.framework.model3D.Quaternion3D; @@ -10,6 +11,11 @@ import org.ntlab.radishforandroidstudio.framework.physics.AngularVelocity3D; import org.ntlab.radishforandroidstudio.framework.physics.Ground; import org.ntlab.radishforandroidstudio.framework.physics.Velocity3D; +import org.ntlab.radishforandroidstudio.java3d.Appearance; +import org.ntlab.radishforandroidstudio.java3d.IndexedTriangleArray; +import org.ntlab.radishforandroidstudio.java3d.Material; +import org.ntlab.radishforandroidstudio.java3d.Point3d; +import org.ntlab.radishforandroidstudio.java3d.Vector3f; import cactusServer.entities.Entity; import cactusServer.entities.MovableObject; @@ -53,10 +59,33 @@ private void initUniverse() { universe = new Universe(); + /* // �X�e�[�W��3D�f�[�^��ǂݍ��ݔz�u���� Object3D stageObj = StageModelManager.getInstance().getStage(stageID).createObject(); stage = new Ground(stageObj); universe.place(stage); + */ + + + IndexedTriangleArray groundGeometry = new IndexedTriangleArray(4, + IndexedTriangleArray.COORDINATES | IndexedTriangleArray.NORMALS, 6); + groundGeometry.setCoordinate(0, new Point3d(-20.0, -1.0, -20.0)); + groundGeometry.setCoordinate(1, new Point3d(20.0, -1.0, -20.0)); + groundGeometry.setCoordinate(2, new Point3d(20.0, -1.0, 20.0)); + groundGeometry.setCoordinate(3, new Point3d(-20.0, -1.0, 20.0)); + groundGeometry.setNormal(0, new Vector3f(0.0f, 1.0f, 0.0f)); + groundGeometry.setNormal(1, new Vector3f(0.0f, 1.0f, 0.0f)); + groundGeometry.setNormal(2, new Vector3f(0.0f, 1.0f, 0.0f)); + groundGeometry.setNormal(3, new Vector3f(0.0f, 1.0f, 0.0f)); + groundGeometry.setCoordinateIndices(0, new int[]{0, 3, 2}); + groundGeometry.setCoordinateIndices(3, new int[]{0, 2, 1}); + Appearance ap2 = new Appearance(); + Material m2 = new Material(); + m2.setDiffuseColor(0.5f, 1.0f, 0.2f); + ap2.setMaterial(m2); + Ground ground = new Ground(new BaseObject3D(groundGeometry, ap2)); + universe.place(ground); + } public String getName() {