Skip to content

Instantly share code, notes, and snippets.

@mcroydon
Created April 25, 2011 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcroydon/941157 to your computer and use it in GitHub Desktop.
Save mcroydon/941157 to your computer and use it in GitHub Desktop.
A Scala port of the "Hello SimpleApplication" app from the jMonkeyEngine wiki
// A scala port of http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_simpleapplication
package com.postneo
package eep
import com.jme3.app.SimpleApplication
import com.jme3.material.Material
import com.jme3.math.Vector3f
import com.jme3.scene.Geometry
import com.jme3.scene.shape.Box
import com.jme3.math.ColorRGBA
object Eep extends SimpleApplication {
def main(args: Array[String]): Unit = {
this.start()
}
override def simpleInitApp() = {
val b = new Box(Vector3f.ZERO, 1, 1, 1)
val geom = new Geometry("Box", b)
val mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md")
mat.setColor("Color", ColorRGBA.Blue)
geom.setMaterial(mat)
rootNode.attachChild(geom)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment