Difference between revisions of "Main Page"

From JPCT
Jump to: navigation, search
(Setting Bigger Heap (Memory) Size for Applets Via HTML)
(Code Snippets)
Line 46: Line 46:
  
  
== Code Snippets ==
+
Setting non-standard Applet heap size in html:
 
Just add <param name="java_arguments" value="-Xmx256m"> where 256m can be the size in MB of your heap. Ex.:
 
Just add <param name="java_arguments" value="-Xmx256m"> where 256m can be the size in MB of your heap. Ex.:
  
Line 52: Line 52:
 
<param name="java_arguments" value="-Xmx256m">
 
<param name="java_arguments" value="-Xmx256m">
 
</APPLET>
 
</APPLET>
 +
 +
Initializing the lwjgl joystick:
 +
Controllers controllers = new Controllers();
 +
try {
 +
      controllers.create();
 +
      if (controllers.getControllerCount() > 0) {
 +
joystick = controllers.getController(0);
 +
System.out.println("Joystick has "+joystick.getButtonCount() +" buttons. Its name is "+joystick.getName());
 +
      }
 +
      else joystick = null;
 +
}
 +
catch (org.lwjgl.LWJGLException e) {System.err.println("Couldn't initialize Controllers: "+e.getMessage());}
 +
 +
Using the lwjgl joystick:
 +
Inside the main applet loop:
 +
if (joystick != null) {
 +
joystick.poll();
 +
rotateZ += joystick.getXAxisValue()/2f;
 +
if (joystick.isButtonPressed(0))
 +
      ;//DO SOMETHING
 +
}

Revision as of 07:43, 24 April 2009

The jPCT wiki


jPCT is a free, small, fast and easy to learn 3D engine for Java. It offers support for software and hardware rendering. This Wiki should help people with tutorials, instructions and samples. If you think that you have something to contribute, just create an account and go for it...


jPCT ressources

The jPCT homepage

The jPCT community


Installation

Requirements

How to install


How to start

First steps

Hello World

Loading models

Advanced example

Applets

Advanced topics

The different renderers

Collision detection

Multithreading

Compiled objects

Shaders

Physics


Setting non-standard Applet heap size in html: Just add <param name="java_arguments" value="-Xmx256m"> where 256m can be the size in MB of your heap. Ex.:

<APPLET archive="MyApplet.jar" code="MyApplet" width="640" height="320"> <param name="java_arguments" value="-Xmx256m"> </APPLET>

Initializing the lwjgl joystick: Controllers controllers = new Controllers(); try {

     controllers.create();
     if (controllers.getControllerCount() > 0) {

joystick = controllers.getController(0); System.out.println("Joystick has "+joystick.getButtonCount() +" buttons. Its name is "+joystick.getName());

     }
     else joystick = null;

} catch (org.lwjgl.LWJGLException e) {System.err.println("Couldn't initialize Controllers: "+e.getMessage());}

Using the lwjgl joystick: Inside the main applet loop: if (joystick != null) { joystick.poll(); rotateZ += joystick.getXAxisValue()/2f; if (joystick.isButtonPressed(0))  ;//DO SOMETHING }