Author Topic: just getting started problems  (Read 749 times)

Offline em3plum

  • byte
  • *
  • Posts: 2
    • View Profile
just getting started problems
« on: August 19, 2015, 11:28:21 pm »
Just downloaded today and Iwould like to go through the entire wiki before trying anything on my own. I am using regular jpct not the jpct-ae I ran into problems with hello world here is the class:
Code: [Select]
import com.threed.jpct.*;


public class HelloWorld {
public static void main(String args[]) throws InterruptedException{

World world = new World();
world.setAmbientLight(0, 255, 0);

TextureManager.getInstance().addTexture("box", new Texture("box.jpg"));

Object3D box = Primitives.getBox(13f, 2f);
box.setTexture("box");
box.setEnvmapped(Object3D.ENVMAP_ENABLED);

box.build();

world.addObject(box);

world.getCamera().setPosition(50, -50, -5);
world.getCamera().lookAt(box.getTransformedCenter());

FrameBuffer buffer = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_NORMAL);
buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
buffer.enableRenderer(IRenderer.RENDERER_OPENGL);

while (!org.lwjgl.opengl.Display.isCloseRequested()) {
        box.rotateY(0.01f);
buffer.clear(java.awt.Color.BLUE);
world.renderScene(buffer);
world.draw(buffer);
buffer.update();
buffer.displayGLOnly();
Thread.sleep(10);
}
buffer.disableRenderer(IRenderer.RENDERER_OPENGL);
buffer.dispose();
System.exit(0);


}

}
and here are the errors
Loading Texture...box.jpg
[ Wed Aug 19 17:23:55 EDT 2015 ] - ERROR: File 'box.jpg' not found - replacement texture used instead!
Java version is: 1.8.0_45
-> support for BufferedImage
Version helper for 1.5+ initialized!
-> using BufferedImage
Software renderer (OpenGL mode) initialized
Software renderer disposed
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
   at java.lang.ClassLoader.loadLibrary(Unknown Source)
   at java.lang.Runtime.loadLibrary0(Unknown Source)
   at java.lang.System.loadLibrary(Unknown Source)
   at org.lwjgl.Sys$1.run(Sys.java:73)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
   at org.lwjgl.Sys.loadLibrary(Sys.java:95)
   at org.lwjgl.Sys.<clinit>(Sys.java:112)
   at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
   at com.threed.jpct.GLHelper.findMode(GLHelper.java:67)
   at com.threed.jpct.GLHelper.findMode(GLHelper.java:62)
   at com.threed.jpct.GLHelper.init(GLHelper.java:160)
   at com.threed.jpct.GLRenderer.init(GLRenderer.java:24)
   at com.threed.jpct.FrameBuffer.enableRenderer(FrameBuffer.java:1134)
   at com.threed.jpct.FrameBuffer.enableRenderer(FrameBuffer.java:753)
   at com.threed.jpct.FrameBuffer.enableRenderer(FrameBuffer.java:700)
   at HelloWorld.main(HelloWorld.java:25)
Now I am not 100 percent sure I think one of the errors where it says no lwjgl in library path means i somehow messed up installing the jars not 100% sure though
I am using the Enterprise Edition of Eclipse because I usually work with tomcat
« Last Edit: August 19, 2015, 11:32:44 pm by em3plum »

Offline AGP

  • quad
  • ******
  • Posts: 1526
    • View Profile
Re: just getting started problems
« Reply #1 on: August 20, 2015, 02:40:17 am »
Assuming you're using Windows, copy the lwjgl dlls to System32 and make sure that the lwjgl jars are in your classpath (java -classpath lwjgl.jar;.;lwjgl_util.jar ... MyClass). Good luck.

Offline em3plum

  • byte
  • *
  • Posts: 2
    • View Profile
Re: just getting started problems
« Reply #2 on: August 20, 2015, 03:08:31 am »
thank you that worked perfectly