To test out and get the feel of heightmaps in blender, I made a little test heightmap and exported it as an ogrexml file and then converted it to jme binary etc etc. Well to test if I did it right I copied the code from HelloWorld (https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_terrain) and just changed the directory to my heightmap. However when I paste the code, it gives me an error:
Oct 9, 2010 10:21:44 AM com.jme3.system.JmeSystem initialize
INFO: Running on jMonkey Engine 3 Alpha 0.6
Oct 9, 2010 10:21:44 AM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #1: file:/C:/Users/family/AppData/Roaming/.jmonkeyplatform/dev/libs/
Oct 9, 2010 10:21:44 AM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #2: C:UsersfamilyjMonkeyProjectsUntitled
Oct 9, 2010 10:21:44 AM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #3: C:UsersfamilyjMonkeyProjectsUntitled
Oct 9, 2010 10:21:45 AM com.jme3.system.lwjgl.LwjglAbstractDisplay run
INFO: Using LWJGL 2.5
Oct 9, 2010 10:21:45 AM com.jme3.system.lwjgl.LwjglDisplay createContext
INFO: Selected display mode: 640 x 480 x 0 @0Hz
Oct 9, 2010 10:21:46 AM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: Display created.
Oct 9, 2010 10:21:46 AM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: Adapter: vga
Oct 9, 2010 10:21:46 AM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: Driver Version: 6.0.6001.18000
Oct 9, 2010 10:21:46 AM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: Vendor: NVIDIA Corporation
Oct 9, 2010 10:21:46 AM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: OpenGL Version: 2.1.2
Oct 9, 2010 10:21:46 AM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: Renderer: GeForce 6100 nForce 405/PCI/SSE2/3DNOW!
Oct 9, 2010 10:21:46 AM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: GLSL Ver: 1.20 NVIDIA via Cg compiler
Oct 9, 2010 10:21:46 AM com.jme3.system.lwjgl.LwjglTimer
INFO: Timer resolution: 1000 ticks per second
Oct 9, 2010 10:21:46 AM com.jme3.renderer.lwjgl.LwjglRenderer initialize
INFO: Caps: [FrameBuffer, FrameBufferMRT, FrameBufferMultisample, OpenGL20, OpenGL21, ARBprogram, GLSL100, GLSL110, GLSL120, VertexTextureFetch, FloatTexture, FloatColorBuffer]
Oct 9, 2010 10:21:46 AM com.jme3.asset.DesktopAssetManager
INFO: DesktopAssetManager created.
Oct 9, 2010 10:21:46 AM com.jme3.renderer.Camera
INFO: Camera created (W: 640, H: 480)
Oct 9, 2010 10:21:46 AM com.jme3.renderer.Camera
INFO: Camera created (W: 640, H: 480)
Oct 9, 2010 10:21:46 AM com.jme3.input.lwjgl.LwjglMouseInput initialize
INFO: Mouse created.
Oct 9, 2010 10:21:46 AM com.jme3.input.lwjgl.LwjglKeyInput initialize
INFO: Keyboard created.
Oct 9, 2010 10:21:46 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initialize
INFO: Audio effect extension version: 1.0
Oct 9, 2010 10:21:46 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initialize
INFO: Audio max auxilary sends: 2
Oct 9, 2010 10:21:47 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Gui Node)
Oct 9, 2010 10:21:47 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
Oct 9, 2010 10:21:47 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
Oct 9, 2010 10:21:47 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
Oct 9, 2010 10:21:47 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
Oct 9, 2010 10:21:47 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
Oct 9, 2010 10:21:47 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
Oct 9, 2010 10:21:47 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
Oct 9, 2010 10:21:47 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
Oct 9, 2010 10:21:47 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
Oct 9, 2010 10:21:47 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
Oct 9, 2010 10:21:47 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
Oct 9, 2010 10:21:47 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
Oct 9, 2010 10:21:47 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (Statistics View)
Oct 9, 2010 10:21:47 AM com.jme3.scene.Node attachChild
INFO: Child (Statistics View) attached to this node (Gui Node)
Oct 9, 2010 10:21:47 AM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.ClassCastException: com.jme3.scene.Node cannot be cast to com.jme3.material.MaterialDef
at com.jme3.material.Material.(Material.java:149)
at mygame.Main.simpleInitApp(Main.java:57)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:187)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:134)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:183)
at java.lang.Thread.run(Thread.java:619)
BUILD SUCCESSFUL (total time: 9 seconds)
Any ideas why? Thanks
Bumping makes your post get lost in the forum sooner, note theres a “unreplied” filter in the forum overview, so people looking for posts that have not been answered wont find your post any longer
normen said:
Bumping makes your post get lost in the forum sooner, note theres a "unreplied" filter in the forum overview, so people looking for posts that have not been answered wont find your post any longer :P
My bad. I deleted it. Guess it doesn't make sense to now but eh. Any idea what's throwing the error?
The class cast is strange, maybe you use linked nodes? They had a bug in alpha-2, if you update jMP to the latest nightlies (see help) it should go away.
I guess you’re specifying a non-material asset in the Material constructor, e.g:
[java]new Material(assetManager, “Models/abc.mesh.xml”)[/java]
You can only specify files with .j3md extension (material definition) in the Material constructor.