I'm just starting to learn JAVA 3D, and I can't even get a simple example running.
Here is the code:
import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.Frame;
import java.awt.GraphicsConfiguration;
import java.awt.event.*;
import javax.media.j3d.*;
import javax.vecmath.*;
import com.sun.j3d.utils.applet.MainFrame;
import com.sun.j3d.utils.geometry.ColorCube;
import com.sun.j3d.utils.universe.*;
public class Cube3D extends Applet {
public Cube3D() {
setLayout(new BorderLayout());
GraphicsConfiguration config =
SimpleUniverse.getPreferredConfiguration();
Canvas3D canvas3D = new Canvas3D(config);
add("Center", canvas3D);
BranchGroup scene = createSceneGraph();
SimpleUniverse simpleU = new SimpleUniverse(canvas3D);
simpleU.getViewingPlatform().setNominalViewingTransform();
simpleU.addBranchGraph(scene);
}
public BranchGroup createSceneGraph() {
BranchGroup objRoot = new BranchGroup();
objRoot.addChild(new ColorCube(0.4));
return objRoot;
}
public static void main(String[] args) {
Frame frame = new MainFrame(new Cube3D(), 256, 256);
}
}
Here Is the error:
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x693F6683
Function=DrvSetContext+0x12883
Library=C:\WINDOWS\system32\atioglxx.dll
Current Java thread:
at sun.awt.windows.WToolkit.eventLoop(Native Method)
at sun.awt.windows.WToolkit.run(WToolkit.java:262)
at java.lang.Thread.run(Thread.java:534)
Dynamic libraries:
0x00400000 - 0x0040B000 C:\j2sdk1.4.2_06\bin\java.exe
0x7C900000 - 0x7C9B0000 C:\WINDOWS\system32\ntdll.dll
0x7C800000 - 0x7C8F4000 C:\WINDOWS\system32\kernel32.dll
0x77DD0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll
0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll
0x77C10000 - 0x77C68000 C:\WINDOWS\system32\MSVCRT.dll
0x08000000 - 0x08139000 C:\j2sdk1.4.2_06\jre\bin\client\jvm.dll
0x77D40000 - 0x77DD0000 C:\WINDOWS\system32\USER32.dll
0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll
0x76B40000 - 0x76B6D000 C:\WINDOWS\system32\WINMM.dll
0x66500000 - 0x6650A000 C:\WINDOWS\system32\wbsys.dll
0x66600000 - 0x66617000 C:\Program Files\Stardock\Object Desktop\WindowBlinds\wbhelp.dll
0x10000000 - 0x10007000 C:\j2sdk1.4.2_06\jre\bin\hpi.dll
0x003C0000 - 0x003CE000 C:\j2sdk1.4.2_06\jre\bin\verify.dll
0x003D0000 - 0x003E9000 C:\j2sdk1.4.2_06\jre\bin\java.dll
0x003F0000 - 0x003FD000 C:\j2sdk1.4.2_06\jre\bin\zip.dll
0x02E80000 - 0x02F92000 C:\j2sdk1.4.2_06\jre\bin\awt.dll
0x73000000 - 0x73026000 C:\WINDOWS\system32\WINSPOOL.DRV
0x76390000 - 0x763AD000 C:\WINDOWS\system32\IMM32.dll
0x774E0000 - 0x7761C000 C:\WINDOWS\system32\ole32.dll
0x66000000 - 0x660A2000 C:\Program Files\Stardock\Object Desktop\WindowBlinds\WBlind.dll
0x5AD70000 - 0x5ADA8000 C:\WINDOWS\system32\UXTHEME.DLL
0x76380000 - 0x76385000 C:\WINDOWS\system32\msimg32.dll
0x031D0000 - 0x03221000 C:\j2sdk1.4.2_06\jre\bin\fontmanager.dll
0x73760000 - 0x737A9000 C:\WINDOWS\system32\ddraw.dll
0x73BC0000 - 0x73BC6000 C:\WINDOWS\system32\DCIMAN32.dll
0x73940000 - 0x73A10000 C:\WINDOWS\system32\D3DIM700.DLL
0x74720000 - 0x7476B000 C:\WINDOWS\system32\MSCTF.dll
0x03520000 - 0x03577000 C:\j2sdk1.4.2_06\jre\bin\J3D.dll
0x6D9A0000 - 0x6DAC8000 C:\WINDOWS\system32\d3d8.dll
0x6D990000 - 0x6D996000 C:\WINDOWS\system32\d3d8thk.dll
0x77C00000 - 0x77C08000 C:\WINDOWS\system32\VERSION.dll
0x5D090000 - 0x5D127000 C:\WINDOWS\system32\COMCTL32.dll
0x036A0000 - 0x036A5000 C:\j2sdk1.4.2_06\jre\bin\jawt.dll
0x69000000 - 0x6963F000 C:\WINDOWS\system32\atioglxx.dll
0x5ED00000 - 0x5EDCC000 C:\WINDOWS\system32\OPENGL32.dll
0x68B20000 - 0x68B40000 C:\WINDOWS\system32\GLU32.dll
0x76C90000 - 0x76CB8000 C:\WINDOWS\system32\imagehlp.dll
0x59A60000 - 0x59B01000 C:\WINDOWS\system32\DBGHELP.dll
0x76BF0000 - 0x76BFB000 C:\WINDOWS\system32\PSAPI.DLL
Heap at VM Abort:
Heap
def new generation total 576K, used 318K [0x10010000, 0x100b0000, 0x104f0000)
eden space 512K, 53% used [0x10010000, 0x100549b8, 0x10090000)
from space 64K, 68% used [0x10090000, 0x1009af48, 0x100a0000)
to space 64K, 0% used [0x100a0000, 0x100a0000, 0x100b0000)
tenured generation total 1408K, used 224K [0x104f0000, 0x10650000, 0x14010000)
the space 1408K, 15% used [0x104f0000, 0x10528200, 0x10528200, 0x10650000)
compacting perm gen total 5120K, used 5086K [0x14010000, 0x14510000, 0x18010000)
the space 5120K, 99% used [0x14010000, 0x14507a70, 0x14507c00, 0x14510000)
Local Time = Wed Dec 15 14:31:49 2004
Elapsed Time = 7
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode)
#
Here is the code:
import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.Frame;
import java.awt.GraphicsConfiguration;
import java.awt.event.*;
import javax.media.j3d.*;
import javax.vecmath.*;
import com.sun.j3d.utils.applet.MainFrame;
import com.sun.j3d.utils.geometry.ColorCube;
import com.sun.j3d.utils.universe.*;
public class Cube3D extends Applet {
public Cube3D() {
setLayout(new BorderLayout());
GraphicsConfiguration config =
SimpleUniverse.getPreferredConfiguration();
Canvas3D canvas3D = new Canvas3D(config);
add("Center", canvas3D);
BranchGroup scene = createSceneGraph();
SimpleUniverse simpleU = new SimpleUniverse(canvas3D);
simpleU.getViewingPlatform().setNominalViewingTransform();
simpleU.addBranchGraph(scene);
}
public BranchGroup createSceneGraph() {
BranchGroup objRoot = new BranchGroup();
objRoot.addChild(new ColorCube(0.4));
return objRoot;
}
public static void main(String[] args) {
Frame frame = new MainFrame(new Cube3D(), 256, 256);
}
}
Here Is the error:
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x693F6683
Function=DrvSetContext+0x12883
Library=C:\WINDOWS\system32\atioglxx.dll
Current Java thread:
at sun.awt.windows.WToolkit.eventLoop(Native Method)
at sun.awt.windows.WToolkit.run(WToolkit.java:262)
at java.lang.Thread.run(Thread.java:534)
Dynamic libraries:
0x00400000 - 0x0040B000 C:\j2sdk1.4.2_06\bin\java.exe
0x7C900000 - 0x7C9B0000 C:\WINDOWS\system32\ntdll.dll
0x7C800000 - 0x7C8F4000 C:\WINDOWS\system32\kernel32.dll
0x77DD0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll
0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll
0x77C10000 - 0x77C68000 C:\WINDOWS\system32\MSVCRT.dll
0x08000000 - 0x08139000 C:\j2sdk1.4.2_06\jre\bin\client\jvm.dll
0x77D40000 - 0x77DD0000 C:\WINDOWS\system32\USER32.dll
0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll
0x76B40000 - 0x76B6D000 C:\WINDOWS\system32\WINMM.dll
0x66500000 - 0x6650A000 C:\WINDOWS\system32\wbsys.dll
0x66600000 - 0x66617000 C:\Program Files\Stardock\Object Desktop\WindowBlinds\wbhelp.dll
0x10000000 - 0x10007000 C:\j2sdk1.4.2_06\jre\bin\hpi.dll
0x003C0000 - 0x003CE000 C:\j2sdk1.4.2_06\jre\bin\verify.dll
0x003D0000 - 0x003E9000 C:\j2sdk1.4.2_06\jre\bin\java.dll
0x003F0000 - 0x003FD000 C:\j2sdk1.4.2_06\jre\bin\zip.dll
0x02E80000 - 0x02F92000 C:\j2sdk1.4.2_06\jre\bin\awt.dll
0x73000000 - 0x73026000 C:\WINDOWS\system32\WINSPOOL.DRV
0x76390000 - 0x763AD000 C:\WINDOWS\system32\IMM32.dll
0x774E0000 - 0x7761C000 C:\WINDOWS\system32\ole32.dll
0x66000000 - 0x660A2000 C:\Program Files\Stardock\Object Desktop\WindowBlinds\WBlind.dll
0x5AD70000 - 0x5ADA8000 C:\WINDOWS\system32\UXTHEME.DLL
0x76380000 - 0x76385000 C:\WINDOWS\system32\msimg32.dll
0x031D0000 - 0x03221000 C:\j2sdk1.4.2_06\jre\bin\fontmanager.dll
0x73760000 - 0x737A9000 C:\WINDOWS\system32\ddraw.dll
0x73BC0000 - 0x73BC6000 C:\WINDOWS\system32\DCIMAN32.dll
0x73940000 - 0x73A10000 C:\WINDOWS\system32\D3DIM700.DLL
0x74720000 - 0x7476B000 C:\WINDOWS\system32\MSCTF.dll
0x03520000 - 0x03577000 C:\j2sdk1.4.2_06\jre\bin\J3D.dll
0x6D9A0000 - 0x6DAC8000 C:\WINDOWS\system32\d3d8.dll
0x6D990000 - 0x6D996000 C:\WINDOWS\system32\d3d8thk.dll
0x77C00000 - 0x77C08000 C:\WINDOWS\system32\VERSION.dll
0x5D090000 - 0x5D127000 C:\WINDOWS\system32\COMCTL32.dll
0x036A0000 - 0x036A5000 C:\j2sdk1.4.2_06\jre\bin\jawt.dll
0x69000000 - 0x6963F000 C:\WINDOWS\system32\atioglxx.dll
0x5ED00000 - 0x5EDCC000 C:\WINDOWS\system32\OPENGL32.dll
0x68B20000 - 0x68B40000 C:\WINDOWS\system32\GLU32.dll
0x76C90000 - 0x76CB8000 C:\WINDOWS\system32\imagehlp.dll
0x59A60000 - 0x59B01000 C:\WINDOWS\system32\DBGHELP.dll
0x76BF0000 - 0x76BFB000 C:\WINDOWS\system32\PSAPI.DLL
Heap at VM Abort:
Heap
def new generation total 576K, used 318K [0x10010000, 0x100b0000, 0x104f0000)
eden space 512K, 53% used [0x10010000, 0x100549b8, 0x10090000)
from space 64K, 68% used [0x10090000, 0x1009af48, 0x100a0000)
to space 64K, 0% used [0x100a0000, 0x100a0000, 0x100b0000)
tenured generation total 1408K, used 224K [0x104f0000, 0x10650000, 0x14010000)
the space 1408K, 15% used [0x104f0000, 0x10528200, 0x10528200, 0x10650000)
compacting perm gen total 5120K, used 5086K [0x14010000, 0x14510000, 0x18010000)
the space 5120K, 99% used [0x14010000, 0x14507a70, 0x14507c00, 0x14510000)
Local Time = Wed Dec 15 14:31:49 2004
Elapsed Time = 7
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode)
#