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 - ErDetEnAnd?

Pages: 1 ... 3 4 [5] 6
61
Support / Re: GLCanvasRender performance and mouse events
« on: September 30, 2008, 09:24:19 pm »
Render method:

Code: [Select]
public void render() {
   buffer.clear(backgroundColor);
   world.renderScene(buffer);
   world.draw(buffer);
   buffer.update();
   buffer.displayGLOnly();
   glCanvas.repaint();
}

Counting FPS:
Code: [Select]
long time;
int frames = 0;

while (true) {
    matrix.rotateY(0.1f);
    renderScene();
    frames++;
    if (time+1000<System.currentTimeMillis()) {
        time = System.currentTimeMillis();
        System.out.println("FPS: "+frames);
        frames = 0;
    }
}

62
Support / Re: Access canvas in GLCanvasRender from LWJGL
« on: September 30, 2008, 09:19:46 pm »
Drawing on canvas in IPaintListener.finishedPainting() using the graphics from the canvas, doesn't have any effect. However, using another canvas is sufficient.

63
Support / GLCanvasRender performance and mouse events
« on: September 30, 2008, 09:17:01 pm »
Hello.

The following code gives many fps when using the GLCanvasRender:

Code: [Select]
while (true) {
            matrix.rotateY(0.1f);
            renderScene();
}

But when the rotating is done by using the mouse (drag event), the fps I get is somewhat opposit the mouse speed. To avoid unnecessary rendering drag events are ignored if mouse point equals previous mouse point. Test shows that the mouse speed does not affect the number of events. So why the low fps when using the mouse? Any ideas?

64
Support / Re: Access canvas in GLCanvasRender from LWJGL
« on: September 29, 2008, 04:32:50 pm »
Some AWT/Swing.

65
Support / Access canvas in GLCanvasRender from LWJGL
« on: September 28, 2008, 10:06:25 pm »
Hello!

I need to paint on the canvas after it has been painted in lwjgl (when the canvas has been displayed and repainted from jpct). Does anyone have any ideas?

 - Lwjgl suggests that one overrides the paint/paintGL method, but since the JPCT render gives the canvas this approach is not possible.

Thanks in advance.

66
Support / Transform regardsless of earlier transformation or rotation
« on: September 04, 2008, 01:21:30 pm »
Hi.

I have 3 objects. 1 parent and 2 children. The parent should always be in the middle of the screen, and when clicking on a child, the clicked child center should transform to the parent center. The children share the same matrices, thus the children are transformed by same vector.

My approach only works when the objects are neither transformed nor rotated.
I calculate the subvector between the parent and the clicked child, then translates their matrix, but the result is dependant on ealier transformation and rotation. I dont think I have the correct understance of the two.

Where am I wrong?

67
Support / Re: Software rendering and swing components
« on: September 03, 2008, 10:30:59 am »
Exactly, the rendering is done when updating the frame buffer.

68
Support / Re: Software rendering and swing components
« on: September 01, 2008, 04:21:05 pm »
As far as I can see the sample you referred to does not mix swing components on the jpct frame (image a JButton right in the middle of your scene). I did something like that sample before (as a temp. solution), and it worked fine without using the swing utilities. Maybe because I dont have a busy thread.

Swing components are double buffered as default, but we cant benefit from this here; we want JPCT to do its work and all components to be drawn but not shown before the last components is drawn, respectively. JPCT is using a double buffer which is updated entirely before shown. Now I'm drawing the component to that buffer, and it takes no unnecessary cpu time.

69
Support / Re: Software rendering and swing components
« on: September 01, 2008, 01:10:05 pm »
Thank you for your replies. This makes this engine even more advantageous to use.

The problem using the event queue is, that the runnable object is called after all pending events are processed, and this is causing flicker.

The solution I found is using the existing jpct buffered image, and by creating a new graphic object from the buffer, swing components can be drawn before displaying the contents. This lets me have swing components on the same pane as the rendered scene, but like it was a normal jpanel.

Best regards!

70
Support / Software rendering and swing components
« on: August 28, 2008, 10:26:26 am »
Hi.

By using the software render, how is it possible to add swing components on the same pane you're drawing the world on. The swing components should be on top of the rendered scene. Is there a right way to do this?

Regards.

71
Support / Re: Reprojection in world space down camera axis
« on: May 22, 2008, 09:52:41 am »
If I click right in the center of the awt frame, the coordinates are 0;0;0. This is not world coordinates, rather the camera's. I know where the world origin lies, and according to that position the coordinates should be ca. -50;0;-300, since the camera is 300 away down the axis.
The camera z-axis is a new axis in the world, and I want to move up this axis.

72
Support / Reprojection in world space down camera axis
« on: May 21, 2008, 06:24:38 pm »
Hello.

A click on the awt frame gives me a screen coordinate. How do I reproject that coordinate into world space simplevector, and move it down the camera z-axis?

Tried long time now multiply the reprojected vector with a world matrix with no luck.

Thank you.

73
Support / Re: Mouse selection using vertex information
« on: May 19, 2008, 07:50:44 pm »
Thank you for your fast reply - that's excellent.

74
Support / Mouse selection using vertex information
« on: May 19, 2008, 06:04:56 pm »
Hello.

How do I access the transformed vertex information? I understand a IVertexController implementation operates in object space, but could it somehow work in the world? The PolygonManager delivers the transformed vertex, but it assumes that one is operating on polygons. I wouldn't expect the PolygonManager is the obviously choise for this kind of job - the current approach would then give 3x CPU overhead (for triangles).

By custom selection the transformed mesh should be directly accessible, but I can't figure out how...

Thanks in advance!

75
Support / Re: Vertex optimization?
« on: May 18, 2008, 05:11:29 pm »
Thanks Egon.

Pages: 1 ... 3 4 [5] 6