Hello JPCT Community!
I have big trouble in understanding how to get some kind of "canvas" to render my 3D Scenes to.
I need a component to integrate into my GUI, I was thinking about a class that extends JPanel and is able to display Software and Hardware Rendering.
It also has to lbe able to listen to Mouse and Keyboard events..
Can Anyone give me a hint?
I am as far as this, but there is no rendering viewable:
I just found the HelloWorld-Apps in the jpctapi116rc2.zip.
Is ist possible to use OpenGL or Hardwaremode to render into a JPanel?
I have big trouble in understanding how to get some kind of "canvas" to render my 3D Scenes to.
I need a component to integrate into my GUI, I was thinking about a class that extends JPanel and is able to display Software and Hardware Rendering.
It also has to lbe able to listen to Mouse and Keyboard events..
Can Anyone give me a hint?
I am as far as this, but there is no rendering viewable:
Code Select
import com.threed.jpct.*;
import java.awt.Graphics;
import java.io.PrintStream;
import java.net.URL;
import javax.swing.JPanel;
public class Panel3D extends JPanel
{
private World _world;
private FrameBuffer _buffer;
private Camera _camera;
public Panel3D()
{
//this.addMouseListener(arg0);
//this.addKeyListener(arg0);
Logger.setLogLevel(2);
Config.useMultipleThreads = true;
Config.fadeoutLight = false;
Config.linearDiv = 100F;
Config.farPlane = 500F;
_world = new World();
_world.setAmbientLight(250, 250, 250);
_buffer = new FrameBuffer(this.getHeight(), this.getWidth(), 0);
_buffer.enableRenderer(IRenderer.RENDERER_OPENGL);
_camera = _world.getCamera();
}
}
I just found the HelloWorld-Apps in the jpctapi116rc2.zip.
Is ist possible to use OpenGL or Hardwaremode to render into a JPanel?