Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

java3D scene updation

2 views
Skip to first unread message

atul....@gmail.com

unread,
Oct 8, 2005, 3:47:34 PM10/8/05
to
How one can go on adding polygons to a scenegraph.
What I am doing is as follows.
1. I take polygon data from an applet.
2. I use the data to make polygons in J3D. I use a button to add a
polygon

Button render = new Button("Show Model");
render.addActionListener;
public void actionPerformed(ActionEvent event){
cause = event.getSource();
.
.
.
if (cause == render)
{
u = new SimpleUniverse(c) ;
scene = createSceneGraph(c);
u.addBranchGraph(scene);

}
}
createSceneGraph() is method that add the polygon to scene.
3. Now when I add the new polygon and press button "show model" I get
following exception

javax.media.j3d.RestrictedAccessException: Cannot modify capability
bits on a li
ve or compiled object
at
javax.media.j3d.SceneGraphObject.setCapability(SceneGraphObject.java:
101)
at Main.createSceneGraph(Main.java:367)
at Main.actionPerformed(Main.java:523)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:17
86)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1839)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:420)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258
)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
istener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483
)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)

at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

at
java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
wglCreateContext Failed: The handle is invalid.

Kindly suggest some way to solve tgis problem.

0 new messages