diff --git a/.classpath b/.classpath index d171cd4..269d628 100644 --- a/.classpath +++ b/.classpath @@ -2,5 +2,24 @@ + + + + + + + + + + + + + + + + + + + diff --git a/OpenAL32.dll b/OpenAL32.dll new file mode 100644 index 0000000..8dc9fa5 Binary files /dev/null and b/OpenAL32.dll differ diff --git a/jinput-dx8.dll b/jinput-dx8.dll new file mode 100644 index 0000000..0ad824b Binary files /dev/null and b/jinput-dx8.dll differ diff --git a/jinput-raw.dll b/jinput-raw.dll new file mode 100644 index 0000000..2a014f6 Binary files /dev/null and b/jinput-raw.dll differ diff --git a/lib/jME_2.0.jar b/lib/jME_2.0.jar new file mode 100644 index 0000000..6f789ad Binary files /dev/null and b/lib/jME_2.0.jar differ diff --git a/lib/jinput.jar b/lib/jinput.jar new file mode 100644 index 0000000..e12e523 Binary files /dev/null and b/lib/jinput.jar differ diff --git a/lib/jme-audio.jar b/lib/jme-audio.jar new file mode 100644 index 0000000..b1e1984 Binary files /dev/null and b/lib/jme-audio.jar differ diff --git a/lib/jme-awt.jar b/lib/jme-awt.jar new file mode 100644 index 0000000..181f1f9 Binary files /dev/null and b/lib/jme-awt.jar differ diff --git a/lib/jme-collada.jar b/lib/jme-collada.jar new file mode 100644 index 0000000..e485505 Binary files /dev/null and b/lib/jme-collada.jar differ diff --git a/lib/jme-editors.jar b/lib/jme-editors.jar new file mode 100644 index 0000000..58fe559 Binary files /dev/null and b/lib/jme-editors.jar differ diff --git a/lib/jme-effects.jar b/lib/jme-effects.jar new file mode 100644 index 0000000..badc3dc Binary files /dev/null and b/lib/jme-effects.jar differ diff --git a/lib/jme-font.jar b/lib/jme-font.jar new file mode 100644 index 0000000..a2c394a Binary files /dev/null and b/lib/jme-font.jar differ diff --git a/lib/jme-gamestates.jar b/lib/jme-gamestates.jar new file mode 100644 index 0000000..b3528be Binary files /dev/null and b/lib/jme-gamestates.jar differ diff --git a/lib/jme-model.jar b/lib/jme-model.jar new file mode 100644 index 0000000..d2dc683 Binary files /dev/null and b/lib/jme-model.jar differ diff --git a/lib/jme-scene.jar b/lib/jme-scene.jar new file mode 100644 index 0000000..4d33c4b Binary files /dev/null and b/lib/jme-scene.jar differ diff --git a/lib/jme-swt.jar b/lib/jme-swt.jar new file mode 100644 index 0000000..1b6abb1 Binary files /dev/null and b/lib/jme-swt.jar differ diff --git a/lib/jme-terrain.jar b/lib/jme-terrain.jar new file mode 100644 index 0000000..e9b1ada Binary files /dev/null and b/lib/jme-terrain.jar differ diff --git a/lib/jme-xml.jar b/lib/jme-xml.jar new file mode 100644 index 0000000..0689a5c Binary files /dev/null and b/lib/jme-xml.jar differ diff --git a/lib/jme.jar b/lib/jme.jar new file mode 100644 index 0000000..8d87d22 Binary files /dev/null and b/lib/jme.jar differ diff --git a/lib/lwjgl.jar b/lib/lwjgl.jar new file mode 100644 index 0000000..68ab8ee Binary files /dev/null and b/lib/lwjgl.jar differ diff --git a/lib/lwjgl_test.jar b/lib/lwjgl_test.jar new file mode 100644 index 0000000..505bbf6 Binary files /dev/null and b/lib/lwjgl_test.jar differ diff --git a/lib/lwjgl_util.jar b/lib/lwjgl_util.jar new file mode 100644 index 0000000..d5226e8 Binary files /dev/null and b/lib/lwjgl_util.jar differ diff --git a/lib/lwjgl_util_applet.jar b/lib/lwjgl_util_applet.jar new file mode 100644 index 0000000..10fad1a Binary files /dev/null and b/lib/lwjgl_util_applet.jar differ diff --git a/lwjgl.dll b/lwjgl.dll new file mode 100644 index 0000000..387c60d Binary files /dev/null and b/lwjgl.dll differ diff --git a/properties.cfg b/properties.cfg new file mode 100644 index 0000000..cbb07c3 --- /dev/null +++ b/properties.cfg @@ -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 diff --git a/src/sg/data/skybox/advanced/front.png b/src/sg/data/skybox/advanced/front.png new file mode 100644 index 0000000..3693f90 Binary files /dev/null and b/src/sg/data/skybox/advanced/front.png differ diff --git a/src/sg/data/skybox/advanced/rest.png b/src/sg/data/skybox/advanced/rest.png new file mode 100644 index 0000000..35ae69e Binary files /dev/null and b/src/sg/data/skybox/advanced/rest.png differ diff --git a/src/sg/data/skybox/simple/back.png b/src/sg/data/skybox/simple/back.png new file mode 100644 index 0000000..208db53 Binary files /dev/null and b/src/sg/data/skybox/simple/back.png differ diff --git a/src/sg/data/skybox/simple/bottom.png b/src/sg/data/skybox/simple/bottom.png new file mode 100644 index 0000000..4688daf Binary files /dev/null and b/src/sg/data/skybox/simple/bottom.png differ diff --git a/src/sg/data/skybox/simple/east.png b/src/sg/data/skybox/simple/east.png new file mode 100644 index 0000000..9fe23ca Binary files /dev/null and b/src/sg/data/skybox/simple/east.png differ diff --git a/src/sg/data/skybox/simple/front.png b/src/sg/data/skybox/simple/front.png new file mode 100644 index 0000000..7e69837 Binary files /dev/null and b/src/sg/data/skybox/simple/front.png differ diff --git a/src/sg/data/skybox/simple/top.png b/src/sg/data/skybox/simple/top.png new file mode 100644 index 0000000..3a70a37 Binary files /dev/null and b/src/sg/data/skybox/simple/top.png differ diff --git a/src/sg/data/skybox/simple/west.png b/src/sg/data/skybox/simple/west.png new file mode 100644 index 0000000..9a4ac82 Binary files /dev/null and b/src/sg/data/skybox/simple/west.png differ diff --git a/src/sg/test/Lesson1.java b/src/sg/test/Lesson1.java new file mode 100644 index 0000000..8c0afe1 --- /dev/null +++ b/src/sg/test/Lesson1.java @@ -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); + } + +} +