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 - madhava.s

Pages: [1]
1
Support / ClassCastException while using AWTGL renderer
« on: February 14, 2013, 03:35:35 pm »
Below is the exception i'm getting.

I'm spanning a separate thread for rendering as Below.
Code: [Select]

     new Thread(){
        @Override
        public void run(){
         while(true){   
            buffer.clear(java.awt.Color.WHITE);
            world.renderScene(buffer);
            world.draw(buffer);
            buffer.update();
            buffer.displayGLOnly();
            canvas.repaint();
            try {
                sleep(100);
            } catch (InterruptedException ex) {
                //do nothing     
            }
         }
        }
     }.start();
   
Getting the below exception
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: java.lang.ClassCastException: com.threed.jpct.Camera cannot be cast to com.threed.jpct.World
   at com.threed.jpct.AWTJPCTCanvas.paintGL(AWTJPCTCanvas.java:233)
   at org.lwjgl.opengl.AWTGLCanvas.paint(AWTGLCanvas.java:339)
   at org.lwjgl.opengl.AWTGLCanvas.update(AWTGLCanvas.java:368)
   at sun.awt.RepaintArea.updateComponent(RepaintArea.java:239)
   at sun.awt.RepaintArea.paint(RepaintArea.java:216)
   at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:310)
   at java.awt.Component.dispatchEventImpl(Component.java:4727)
   at java.awt.Component.dispatchEvent(Component.java:4481)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
   at java.awt.EventQueue.access$000(EventQueue.java:84)
   at java.awt.EventQueue$1.run(EventQueue.java:602)
   at java.awt.EventQueue$1.run(EventQueue.java:600)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
   at java.awt.EventQueue$2.run(EventQueue.java:616)
   at java.awt.EventQueue$2.run(EventQueue.java:614)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.ClassCastException: com.threed.jpct.Camera cannot be cast to com.threed.jpct.World
   at com.threed.jpct.AWTGLRenderer.executeGL(AWTGLRenderer.java:125)
   at com.threed.jpct.AWTJPCTCanvas.paintGL(AWTJPCTCanvas.java:190)
   ... 25 more






2
Support / PolyLine update
« on: February 10, 2013, 04:38:29 am »
I'm using PolyLine to draw line between 2 cubes. But updating the position of polyline after cubes are translated& rotated isnot taking effect.

Initial set up -- works fine
Code: [Select]
bounds=toy.getMesh().getBoundingBox();
                SimpleVector vec1=SimpleVector.create(
                        (bounds[0]+bounds[1])/2,
                        (bounds[2]+bounds[3])/2,
                        (bounds[4]+bounds[5])/2
                        );
                bounds=toy3.getMesh().getBoundingBox();
                SimpleVector vec2=SimpleVector.create(
                        (bounds[0]+bounds[1])/2,
                        (bounds[2]+bounds[3])/2,
                        (bounds[4]+bounds[5])/2
                        );
Polyline line1=new Polyline(new SimpleVector[]{vec1,vec2}, Color.GREEN);


Code used to update line position
Code: [Select]
line1.update(new SimpleVector[]{toy.getTransformedCenter(),toy3.getTransformedCenter()});
[attachment deleted by admin]

3
i was experimenting with rotation plane around it's geometric center with mathematical X,Y,Z axis(not default Y Z axis of ) , I needed to do trial and error to get the position. Tried searching documentation, couldn't find it. Pls anybody shed some light on this, if it's already there in documentation n I have missed pls point me towards that.

4
setTexture on Object3D with a texture name that doesn't exist in Texturemanager logs an error and object doesn't showup is it expected behaviour.

Pages: [1]