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.

Topics - Mr.Marbles

Pages: [1]
Support / jPCT benchmark?
« on: April 25, 2007, 07:20:14 pm »
I was just wondering if jPCT has ever been benchmarked against some of the other java scenegraph engines out there: jME, Java3D, Xith3D, etc. I've personally been working with jPCT for almost 2 years now and have never really considered performance vs. the "competition". So I thought this would something useful to consider.

Besides the fact that jPCT is probably the easiest to learn and supports both software/hardware rendering, are there any other advantages? I've read that Xith3D is a tuned version of Java3D basically aimed at higher performances, and jME was actually benchmarked against Xith3D and found to be faster in some cases. So jME seems to be a clear winner in terms of performance. However I've never seen jPCT benchmarked at all.

Support / FrameBuffer.enableGLCanvasRenderer() performance
« on: April 04, 2007, 01:44:00 am »
Just a quick question about the performance of renderers. In general, should
Code: [Select]
have better performance (lower CPU usage) than
Code: [Select]
FrameBuffer.enableRenderer(IRenderer.RENDERER_SOFTWARE, IRenderer.MODE_OPENGL)
Although the first one is hardware rendering, I'm getting poorer performance out of it. I'm not quite sure why. ???

Support / How to change frame title/icon on lwjgl?
« on: April 02, 2007, 07:34:03 pm »
I'm trying to find a way to access the native window that gets created with the FrameBuffer.displayGLOnly() method. I need to change the title and icon of this window. I notice that the title is "" so it seems that jPCT has access to this window and is modifying the title. Is it possible to get a reference to this window through jPCT?

Support / Rendering 1 World to 2 FrameBuffers
« on: May 09, 2006, 01:39:05 pm »
There seems to be a problem with textures when I render the same world into two different FrameBuffers. The textures don't appear on the second rendered frame buffer. Is this a known issue? Here's the code I'm using:

Code: [Select]



This problem only occurs with hardware rendering; in software rendering mode it works fine.

Support / Object3D bounds?
« on: May 01, 2006, 03:21:01 pm »
Is there a way to get the bounds of an Object3D in world space? I need to draw a rectangle around an object in my gui. It's supposed to simulate a target tracking system. But I can't seem to find and bounds information. Java 3D had a getBoundingBox() method but I can't find a similar method in jpct.

Support / Simulate "camera.lookAt(SimpleVector)" for an Obje
« on: April 27, 2006, 04:11:33 pm »
I have a gun turret in my application which is made up of two moving parts: 1) the base 2) the gun. The base rotates on the y-axis and the gun rotates on the x-axis. I have a flying target in my scene and I'd like the turret to track the target using the same principle of the camera "lookAt()" function. What's the simplest way to get this done keeping in mind that the base of the turrent and the gun on the turret rotate on two different axis. I've tried several methods involving vector math but my linear algebra is a little rusty  :oops: . That's why I was thinking of the camera "lookAt()" function.

Support / Calculate distance to an object3D
« on: March 23, 2006, 03:43:50 pm »
This my be a stupid question but does anyone know of a simple way to calculate the distance from the camera's position to an Object3D in the scene?

I've tried the following but the resulting values don't seem right:

Code: [Select]

SimpleVector v = object.getOrigin();
distance = v.calcSub(camera.getPosition()).length();

Any suggestions :?:

Support / Dynamic brightness and contrast adjustment
« on: March 21, 2006, 05:12:03 pm »
I'm trying to implement a way of changing the brightness and contrast of the rendered image dynamically through user controls (GUI). This is proving to be a difficult task. It seems that the only way to post-process a rendered image is by using the getPixels() of the framebuffer and modifying those values. The problem is that this solution only works for software rendering, is there any way to do this for hardware rendering?

Here's the code which effectively plays with the brightness of the rendered framebuffer:

Code: [Select]

// this is in the rendering loop
Image image = frameBuffer.getOutputBuffer();
BufferedImage buffImage = new BufferedImage(image.getWidth(null),
                            image.getHeight(null), BufferedImage.TYPE_INT_RGB);
Graphics g = buffImage.getGraphics();
g.drawImage(image, 0, 0, null);

// gainAdjustment is the brightness; where 1.0 is 100%            
RescaleOp op = new RescaleOp(gainAdjustment, 0, null);
buffImage = op.filter(buffImage, null);
int [] pixels = frameBuffer.getPixels();
buffImage.getRGB(0, 0, buffImage.getWidth(),
                       buffImage.getHeight(), pixels, 0,

I still haven't found a way to play with the contrast... but I think my biggest problem is that playing with the FrameBuffer's pixels has no effect in hardware mode :cry:

I'm opened to any suggestions

Support / Turn off jPCT output messages?
« on: February 16, 2006, 02:36:34 pm »
Is there any way to turn off the output that gets generated while jPCT is initializing :?:  My application also prints output and it's sometimes tough to see with all the jPCT output on the screen.

Support / Texture color inconsistent
« on: February 13, 2006, 02:01:59 pm »
I'm using .gif files to blit this GUI. It looks different in software and hardware mode. For some reason it only renders properly in software mode. In hardware, the colors seem to fade.



Any idea why this may be happening?

Feedback / What does "jPCT" stand for?
« on: February 02, 2006, 03:37:30 pm »
Sorry if this sounds like a dumb question but I've tried searching and have not found an answer. Has no one asked this before? I'm assuming the "j" in "jPCT" is for "Java" but what's "PCT" :?:

Support / Using enableGLCanvasRenderer
« on: January 18, 2006, 05:18:30 pm »
I need to render into a JPanel component, so I'm using the following code:
Code: [Select]

Canvas myCanvas = frameBuffer.enableGLCanvasRenderer(IRenderer.MODE_OPENGL);
JPanel panel = new JPanel();

Now if I want to switch to a software renderer I can do the following:
Code: [Select]

frameBuffer.enableRenderer(IRenderer.RENDERER_SOFTWARE, IRenderer.MODE_OPENGL);

My question is what's the difference, when using software rendering, to render to a Canvas or to a Graphics object such as:
Code: [Select]

Graphics g = panel.getGraphics();

Is one method better than the other in terms of performance?

Support / Help with Camera movement
« on: January 13, 2006, 05:37:58 pm »

I'm a new user of the jpct engine, but I've worked with Java3D for about a year, so I have some experience with the scenegraph paradigm. I find there are some significant differences with camera manipulation; with Java3D a camera could be attached to any node in the scenegraph and it's movement would be dictated by the inherited rotaions/translations of its ancestor nodes. In jpct, however, the camera movement needs to be manually controlled. My question is how can I ensure that the camera mimics the exact same motion as an Object3D in the scene? It's important to note that I'm not rotating/translating the Object3D directly, but insted it's being moved through inherited motions from it's ancestor nodes (other Object3Ds). I hope my question is understandable, if not I will try to clarify.

Btw, great work with the jpct engine :!:

Pages: [1]