Main Menu
Menu

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.

Show posts Menu

Messages - kakashi

#1
Support / Inverted Y axis coordinated system
June 15, 2009, 07:57:59 PM
Hi,

Is normal that the Y axis is positive goes downwards??
is this a bad configuration in the camera or is the engine coordinated system??
which is the coordinated system?
How can I configure to Y positive goes Up and X positive goes right??

Thanks a lot!!
#2
the bullets points 1-4 was an idea of how to do it, but it doesnt work  :'( .

By "paint it in the whole canvas" I mean for example, when you create a 320x240 Framebuffer then a canvas, then attach it to a Panel In a window (every one with 320x240) and then you resize the canvas, panel, window etc to 640x480, everything is resized but the 3D renders in a 320x240 section inside the canvas that is 640x480, so I need to rescale the rendered image I guest, but I dont know how to do It, any idea????
#3
Hi,

How can I resize FrameBuffer when the canvas get resized (or emulate this painting the Frame buffer in the whole resized canvas)??,

Im creating a thread per created panel to update the objects, I was thinking about:
1-Remove the canvas from the panel
2-Destroy the FrameBuffer,
3-Recreate the Frame buffer with the new size
4-add the canvas again to the panel.

I dont know how to paint it in the whole resized canvas, it is possible??

Here is the main parts of my Panel code:





public class PointCloudPanel extends javax.swing.JPanel {

    public void initCanvas()
    {
        world = new World();
        world.setAmbientLight(255, 255, 0);

TextureManager.getInstance().addTexture("box", new Texture("c:\\1191.jpg"));
        box = Primitives.getBox(13f, 2f);
        box.setTexture("box");
        box.setEnvmapped(Object3D.ENVMAP_ENABLED);
        box.build();
        world.addObject(box);
        world.getCamera().setPosition(50,50, 50);
        world.getCamera().lookAt(box.getTransformedCenter());

        this.setSize(320, 240);
        buffer = new FrameBuffer(this.getWidth(), this.getHeight(), FrameBuffer.SAMPLINGMODE_GL_AA_4X);
        canvas = buffer.enableGLCanvasRenderer();
        buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
        this.add(canvas);

        IPaintListener listener = new IPaintListener() {
            public void finishedPainting() {}
        };


        buffer.setPaintListener(listener);
        canvas.addComponentListener(new ComponentAdapter() {
            @Override
            public void componentResized(ComponentEvent ce) {
                System.out.println("RESIZED");
            }
        });


        Thread thread = new LoopThread(this);
        thread.start();

       
    }

    public PointCloudPanel() {
        initComponents();
        initCanvas();     
    }

    class LoopThread extends Thread {


        LoopThread(PointCloudPanel jp) {
        }

        @Override
        public void run() {


            while (true) {
                box.rotateY(0.01f);
                world.getCamera().lookAt(box.getTransformedCenter());
                buffer.clear(java.awt.Color.GRAY);
                world.renderScene(buffer);
                world.draw(buffer);
                buffer.update();
                buffer.displayGLOnly();
                canvas.repaint();
                try {
                    LoopThread.sleep(10);
                    increment += 1;
                } catch (InterruptedException ex) {
                }
            }
        }
    }
           
    private World world;
    private FrameBuffer buffer;
    private Object3D box;
    private Canvas canvas;
    private float increment = 0;
}







Let me know if you know another method please.

Thanks for any help!
#4
Thanks a lot!!, it worked very well!  :)
#5
Hi,

I want to know how to use the world camera and projection matrix with the glBegin, glVertex3f, glEnd functions to render a list of points with GL_POINTS, but I want to use the same camera and projection of the world object.
Any idea of how to do this?

Thanks a lot for any help  :)