Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jonas

Pages: 1 [2] 3
16
German corner / Re: Software/Hardware Renderer?
« on: March 14, 2008, 06:18:56 pm »
hi

hardware renderer greift via Lwjgl+OpenGL auf deine Grafikkarte zu, der software renderer nicht.

Vorteil am Software renderer ist das du keine der nativen libraries(*.dll für windows zB.) benötigst die für den hardware modus benötigt werden. Vor allem für Applets nützlich. Dafür ists halt ein wenig langsamer.

17
News / Re: jPCT on my new...
« on: March 13, 2008, 09:46:33 am »
nice gadget that is.

I'd be more interested in the game however ;D

18
Support / Re: How to setup environment
« on: March 06, 2008, 03:09:13 pm »
Hi

If you want to use software just use the components graphics object to paint the framebuffer on to the component..

frambuffer.display(component.getGraphics());

For the hardware mode you could use a canvas like this and add it to a jpanel(if you want to use both, soft and hardware modus you can then just replace the canvas in the jpanel by its software counterpart). I think there could be some problems with that because of Swing/awt integration..this one needs to call render() after every update to the world you want rendered...:

Code: [Select]
public class HardwareCanvas extends Canvas
{

   private FrameBuffer _buffer;
   private World _world;

   private Canvas myCanvas;
   
   private boolean isWireframeMode = false;
 
   public HardwareCanvas(World myWorld)
   {
     
      this.myWorld = myWorld;
      createCanvas(800, 800);
     
   }
   
   /**
    *  Set up the panel and listener, and create a framebuffer
    *  in hardwarerendering mode.
    */

   private void createCanvas(int height, int width) {
     
      if(myCanvas == null)
      {
         myFramebuffer = new FrameBuffer(
                 width,
                 height,
                 FrameBuffer.SAMPLINGMODE_HARDWARE_ONLY);
         myFramebuffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);

         myCanvas = myFramebuffer.enableGLCanvasRenderer(); // Enable hardware rendering

         /* Your listeners go here*/
         
         myCanvas.addKeyListener( new KeyAdapter() {} );
       
         myCanvas.requestFocus();
      }
   }
/* Render the world...could use a render loop as well so you dont have to call it after every update */

   public void render() {

         myFramebuffer.clear();
         //Render the scene onto an image
         myWorld.renderScene(myFramebuffer);

         if (!isWireframeMode) {
            myWorld.draw(myFramebuffer);
         } else {
            myWorld.drawWireframe(myFramebuffer, Color.white);
         }

         myFramebuffer.update();
         
         SwingUtilities.invokeLater(new Runnable() {

            public void run()
            {
               myFramebuffer.displayGLOnly();
               myCanvas.repaint();
            }
         
         });
     
   }

   public void changeWireframeMode()
   {
      isWireframeMode = !isWireframeMode;
      this.render();
   }
     
}

19
News / Re: Release candidate of 1.16
« on: March 02, 2008, 08:20:35 pm »
Works for me now, thanks.

20
News / Re: Release candidate of 1.16
« on: March 02, 2008, 07:00:48 pm »
Hi
I get that msg from winrar:

!    CRC failed in jpct\lib\lwjgl-1.1.4\jinput.jar. The file is corrupt
!    CRC failed in jpct\lib\lwjgl-1.1.4\lwjgl.jar. The file is corrupt
!    CRC failed in jpct\lib\lwjgl-1.1.4\lwjgl_test.jar. The file is corrupt



21
Support / Re: 2nd object
« on: February 11, 2008, 01:13:15 pm »
Hi

Loading a 3ds model may result in more than one Object3D(e.g. in the cartoon example theres an object for the hand, one for the body and so on...).

So what that code does is to rotate all these parts of the loaded model. It is then merged into one bigger object3d representing the whole model.

If you want to load multiple models that way, just pack it into a method. Like

Code: [Select]
public Object3D loadModel(String filename, float scale)
{
Object3D[] model = Loader.load3DS(filename, scale);

Object3D o3d = new Object3D(0);
 
Object3D temp = null;
     
  for (int i=0; i<obj.length; i++)
{
temp=model[i];
temp.setCenter(SimpleVector.ORIGIN);
  temp.rotateX((float)-Math.PI);
  temp.rotateMesh();
  temp.setRotationMatrix(new Matrix());
  o3d=Object3D.mergeObjects(o3d, temp);
  }
return o3d;           
}

and use this one in your code.

22
Support / Re: Serializing Object3Ds to file
« on: February 10, 2008, 10:01:22 pm »
Hi

To get it to work you would have to either set it to null again or make the poly manager transient in object3d befor reading the object(when you start adding userobjects thats probably going to be the same problem)...

-or-

you could also just create a dummy world, put that object3d into it and use the xml serializer that the jpct loader offers? :)





23
Support / Re: How to make quality better in sw mode...
« on: January 29, 2008, 08:13:40 pm »
You could use oversampling(see framebuffer samplingmodes..) or just render a higher resolution.


24
German corner / Re: Alpha-Blending
« on: January 28, 2008, 11:14:42 pm »
Hab mir die Seite auch eben angeschaut..nice work :) ... auch wenn ich WoW nicht mag ;D

25
News / Re: Software renderer and Java6 Update10
« on: January 18, 2008, 01:01:29 pm »
The idea of a default d3d-pipeline just sucks imho.

Agreed ;D

26
News / Re: Software renderer and Java6 Update10
« on: January 18, 2008, 10:37:04 am »
Well I guess best is to turn it off by default ;D.

Wouldn't something like this in the main class help?

Code: [Select]
static
   {
      if(System.getProperty("os.name").contains("Win"))
      {
         System.setProperty("sun.java2d.d3d", "false");
      }
   }

That should work for applets too

27
News / Re: Software renderer and Java6 Update10
« on: January 17, 2008, 04:15:37 pm »
Yes but that should be possible to do using an OpenGl pipeline as well..at least to my humble understanding ;D.

Java3d also offers a direct3d modus which is used by quite a few people. Kinda wierd..since it's not possible to access it directly anyway...so I guess there must be some kind of gain when using d3d on windows or some such..

28
News / Re: Software renderer and Java6 Update10
« on: January 17, 2008, 03:00:51 pm »
I don't quite understand why anyone is interested in a d3d pipeline for java anyway..I mean..after all AWT should be platform independent :).
Especially for a 2d toolkit..oh well..


29
News / Re: Software renderer and Java6 Update10
« on: January 17, 2008, 02:13:04 pm »
Hi

ouch ... and this pipeline is turned on by default? Sounds like a step into the wrong direction;D

Thanx for the hint

30
Bugs / Re: Bug in CollisionListener I think.
« on: January 07, 2008, 03:12:04 pm »
Nice work :)

Pages: 1 [2] 3