Adding all jars and a testfile
19
.classpath
|
|
@ -2,5 +2,24 @@
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||||
|
<classpathentry kind="lib" path="lib/jinput.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/jME_2.0.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/jme-audio.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/jme-awt.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/jme-collada.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/jme-editors.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/jme-effects.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/jme-font.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/jme-gamestates.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/jme-model.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/jme-scene.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/jme-swt.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/jme-terrain.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/jme-xml.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/jme.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/lwjgl_test.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/lwjgl_util_applet.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/lwjgl_util.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/lwjgl.jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
||||||
BIN
OpenAL32.dll
Normal file
BIN
jinput-dx8.dll
Normal file
BIN
jinput-raw.dll
Normal file
BIN
lib/jME_2.0.jar
Normal file
BIN
lib/jinput.jar
Normal file
BIN
lib/jme-audio.jar
Normal file
BIN
lib/jme-awt.jar
Normal file
BIN
lib/jme-collada.jar
Normal file
BIN
lib/jme-editors.jar
Normal file
BIN
lib/jme-effects.jar
Normal file
BIN
lib/jme-font.jar
Normal file
BIN
lib/jme-gamestates.jar
Normal file
BIN
lib/jme-model.jar
Normal file
BIN
lib/jme-scene.jar
Normal file
BIN
lib/jme-swt.jar
Normal file
BIN
lib/jme-terrain.jar
Normal file
BIN
lib/jme-xml.jar
Normal file
BIN
lib/jme.jar
Normal file
BIN
lib/lwjgl.jar
Normal file
BIN
lib/lwjgl_test.jar
Normal file
BIN
lib/lwjgl_util.jar
Normal file
BIN
lib/lwjgl_util_applet.jar
Normal file
BIN
lwjgl.dll
Normal file
8
properties.cfg
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
#Game Settings written by com.jme.app.BaseGame$BaseGameSettings at Sun Mar 08 18:20:37 CET 2009
|
||||||
|
#Sun Mar 08 18:20:37 CET 2009
|
||||||
|
FREQ=60
|
||||||
|
WIDTH=1440
|
||||||
|
RENDERER=LWJGL
|
||||||
|
HEIGHT=900
|
||||||
|
DEPTH=32
|
||||||
|
FULLSCREEN=true
|
||||||
BIN
src/sg/data/skybox/advanced/front.png
Normal file
|
After Width: | Height: | Size: 2.2 MiB |
BIN
src/sg/data/skybox/advanced/rest.png
Normal file
|
After Width: | Height: | Size: 971 KiB |
BIN
src/sg/data/skybox/simple/back.png
Normal file
|
After Width: | Height: | Size: 126 KiB |
BIN
src/sg/data/skybox/simple/bottom.png
Normal file
|
After Width: | Height: | Size: 72 KiB |
BIN
src/sg/data/skybox/simple/east.png
Normal file
|
After Width: | Height: | Size: 156 KiB |
BIN
src/sg/data/skybox/simple/front.png
Normal file
|
After Width: | Height: | Size: 197 KiB |
BIN
src/sg/data/skybox/simple/top.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
src/sg/data/skybox/simple/west.png
Normal file
|
After Width: | Height: | Size: 152 KiB |
122
src/sg/test/Lesson1.java
Normal file
|
|
@ -0,0 +1,122 @@
|
||||||
|
package sg.test;
|
||||||
|
import com.jme.app.SimpleGame;
|
||||||
|
import com.jme.renderer.ColorRGBA;
|
||||||
|
import com.jme.scene.Skybox;
|
||||||
|
import com.jme.scene.shape.Box;
|
||||||
|
import com.jme.scene.shape.Sphere;
|
||||||
|
import com.jme.light.PointLight;
|
||||||
|
import com.jme.math.Vector3f;
|
||||||
|
import com.jme.bounding.BoundingBox;
|
||||||
|
import com.jme.scene.state.LightState;
|
||||||
|
import com.jme.scene.state.TextureState;
|
||||||
|
import com.jme.image.Texture;
|
||||||
|
import com.jme.util.TextureManager;
|
||||||
|
|
||||||
|
|
||||||
|
public class Lesson1 extends SimpleGame {
|
||||||
|
private Skybox skybox;
|
||||||
|
private Sphere s;
|
||||||
|
private LightState lightState;
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Lesson1 app = new Lesson1();
|
||||||
|
app.setConfigShowMode(ConfigShowMode.AlwaysShow);
|
||||||
|
app.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void simpleInitGame() {
|
||||||
|
display.setTitle("Tutorial 1");
|
||||||
|
|
||||||
|
s = new Sphere("Sphere", 30, 30, 25);
|
||||||
|
s.setLocalTranslation(new Vector3f(0,0,-40));
|
||||||
|
s.setModelBound(new BoundingBox());
|
||||||
|
s.updateModelBound();
|
||||||
|
|
||||||
|
Texture texture = TextureManager.loadTexture(
|
||||||
|
Lesson1.class.getClassLoader().getResource(
|
||||||
|
"jmetest/data/images/Monkey.jpg"),
|
||||||
|
Texture.MinificationFilter.Trilinear,
|
||||||
|
Texture.MagnificationFilter.Bilinear);
|
||||||
|
TextureState ts = display.getRenderer().createTextureState();
|
||||||
|
ts.setEnabled(true);
|
||||||
|
ts.setTexture(texture);
|
||||||
|
|
||||||
|
s.setRenderState(ts);
|
||||||
|
|
||||||
|
rootNode.attachChild(s);
|
||||||
|
graphNode.attachChild(new Box("box",null, 0f,0f,0f));
|
||||||
|
|
||||||
|
buildSkyBox();
|
||||||
|
rootNode.attachChild(this.skybox);
|
||||||
|
|
||||||
|
buildLighting();
|
||||||
|
rootNode.setRenderState(lightState);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void simpleUpdate(){
|
||||||
|
skybox.setLocalTranslation(cam.getLocation());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buildLighting() {
|
||||||
|
/** Set up a basic, default light. */
|
||||||
|
PointLight pl = new PointLight();
|
||||||
|
pl.setDiffuse(new ColorRGBA(1.0f, 0.0f, 0.0f, 1.0f));
|
||||||
|
pl.setAmbient(new ColorRGBA(0.5f, 0.0f, 0.0f, 1.0f));
|
||||||
|
//create a point light at position 10,0,0
|
||||||
|
pl.setLocation(new Vector3f(10,0,0));
|
||||||
|
pl.setEnabled(true);
|
||||||
|
|
||||||
|
/** Attach the light to a lightState and the lightState to rootNode. */
|
||||||
|
LightState lightState = display.getRenderer().createLightState();
|
||||||
|
lightState.setEnabled(true);
|
||||||
|
lightState.attach(pl);
|
||||||
|
//scene.setRenderState(lightState);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buildSkyBox() {
|
||||||
|
skybox = new Skybox("skybox", 500, 500, 500);
|
||||||
|
|
||||||
|
Texture north = TextureManager.loadTexture(
|
||||||
|
Lesson1.class.getClassLoader().getResource(
|
||||||
|
"sg/data/skybox/advanced/front.png"),
|
||||||
|
Texture.MinificationFilter.BilinearNearestMipMap,
|
||||||
|
Texture.MagnificationFilter.Bilinear);
|
||||||
|
Texture south = TextureManager.loadTexture(
|
||||||
|
Lesson1.class.getClassLoader().getResource(
|
||||||
|
"sg/data/skybox/advanced/rest.png"),
|
||||||
|
Texture.MinificationFilter.BilinearNearestMipMap,
|
||||||
|
Texture.MagnificationFilter.Bilinear);
|
||||||
|
Texture east = TextureManager.loadTexture(
|
||||||
|
Lesson1.class.getClassLoader().getResource(
|
||||||
|
"sg/data/skybox/advanced/rest.png"),
|
||||||
|
Texture.MinificationFilter.BilinearNearestMipMap,
|
||||||
|
Texture.MagnificationFilter.Bilinear);
|
||||||
|
Texture west = TextureManager.loadTexture(
|
||||||
|
Lesson1.class.getClassLoader().getResource(
|
||||||
|
"sg/data/skybox/advanced/rest.png"),
|
||||||
|
Texture.MinificationFilter.BilinearNearestMipMap,
|
||||||
|
Texture.MagnificationFilter.Bilinear);
|
||||||
|
Texture up = TextureManager.loadTexture(
|
||||||
|
Lesson1.class.getClassLoader().getResource(
|
||||||
|
"sg/data/skybox/advanced/rest.png"),
|
||||||
|
Texture.MinificationFilter.BilinearNearestMipMap,
|
||||||
|
Texture.MagnificationFilter.Bilinear);
|
||||||
|
Texture down = TextureManager.loadTexture(
|
||||||
|
Lesson1.class.getClassLoader().getResource(
|
||||||
|
"sg/data/skybox/advanced/rest.png"),
|
||||||
|
Texture.MinificationFilter.BilinearNearestMipMap,
|
||||||
|
Texture.MagnificationFilter.Bilinear);
|
||||||
|
|
||||||
|
skybox.setTexture(Skybox.Face.North, north);
|
||||||
|
skybox.setTexture(Skybox.Face.West, west);
|
||||||
|
skybox.setTexture(Skybox.Face.South, south);
|
||||||
|
skybox.setTexture(Skybox.Face.East, east);
|
||||||
|
skybox.setTexture(Skybox.Face.Up, up);
|
||||||
|
skybox.setTexture(Skybox.Face.Down, down);
|
||||||
|
skybox.preloadTextures();
|
||||||
|
skybox.updateRenderState();
|
||||||
|
// scene.attachChild(skybox);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||