Ok.....
I've added the following code to the ColorCube class. It should provide a
valid graphics Configuration for the Canvas3D. Everything compiles without
errors or warnings. There are no warnings or errors at runtime either.
Recent experience though, has shown that this doesn't mean the program is
right, only that it runs on my machine : )
I've re-uploaded the zip file again:
http://dcasteel.freeservers.com/ColorCube.html
//--------------[Set up graphics configuration]---------------------------
GraphicsConfiguration gc;
GraphicsConfiguration[] gcfg;
GraphicsConfigTemplate3D graphicsConfigTemplate3D = new
GraphicsConfigTemplate3D();
GraphicsEnvironment ge =
GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gdev = ge.getScreenDevices();
gcfg = gdev[0].getConfigurations();
int numDev = Array.getLength(gdev);
java.util.ArrayList gcfgList = new java.util.ArrayList();
for(int d=0; d<numDev; d++)
{
gcfg = gdev[d].getConfigurations();
for(int g=0; g<Array.getLength(gcfg); g++)
{
gcfgList.add(gcfg[g]);
};
};
gcfgList.toArray(gcfg);
gc = graphicsConfigTemplate3D.getBestConfiguration(gcfg);
canvas = new PrintCaptureCanvas3D(gc);// <------- pass
the configuration to the canvas
//------------------------------------------------------------------------
-----Original Message-----
From: Casteel, Don
Sent: Tuesday, February 20, 2001 6:43 AM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Problems! disregard FW: [JAVA3D] Volume example
Now I'm puzzled.....
I do have a null graphics configuration (WARNING: Canvas3D constructed with
a null GraphicsConfiguration.)
But should that cause this:
java.lang.IllegalStateException: GeometryArray: must be in COLOR_3 mode to
use this method
I've set the QuadArray to COLOR_3:
xPlaneGeometry = new QuadArray(xquadPoints.length,
QuadArray.COORDINATES|QuadArray.NORMALS|QuadArray.COLOR_3);
I'm not passing normals in, so that setting could be skipped, but it doesn't
seem likely that the lack of normals would cause the error.
The wierd thing is it works great on my system with no errors or warnings at
compile or runtime.
I'll try to fix the null graphics configuration warning, but I don't know
where to look for the problem with the GeometryArray.
-----Original Message-----
From: Doug Johnson [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 19, 2001 5:20 PM
To: Casteel, Don
Subject: RE: [JAVA3D] Problems! disregard FW: [JAVA3D] Volume example
Don:
No joy. This is ColorCube.java, modified 2/19/01, 4:38PM.
===================
Starting application D:\finson\java3d\colorcube\ColorCube.class
Command line: "d:\apps\jdk1.3\bin\javaw.exe" -classpath
"D:\finson\java3d\colorcube" ColorCube
The current directory is: D:\finson\java3d\colorcube
16 16 16 4096
WARNING: Canvas3D constructed with a null GraphicsConfiguration.
Particles Created
java.lang.IllegalStateException: GeometryArray: must be in COLOR_3 mode to
use this method
at javax.media.j3d.GeometryArray.setColor(GeometryArray.java:1163)
at ColorCube.mapParticles(ColorCube.java:171)
at ColorCube.graph(ColorCube.java:421)
at ColorCube.createGraph(ColorCube.java:380)
at ColorCube.objectGraph(ColorCube.java:338)
at ColorCube.init(ColorCube.java:135)
at ColorCube.main(ColorCube.java:481)
Exception in thread "main"
Interactive Session Ended
=================
Doug
=================
At 04:58 PM 2/19/01 -0500, you wrote:
>Doug,
>
>I really apologize for the problems. I think it's all corrected now, and
>I've re-uploaded the zip file to the previous address.
>
>Again, it had been running fine at this end, but once I saw the errors you
>posted, and looked, I did see bugs in the code that wouldn't show up for
me.
>
>Anyway I think they're fixed, and it's running fine here. please let me
know
>how it goes.
>http://dcasteel.freeservers.com/ColorCube.html
>
>Thanks
>Don
>
>-----Original Message-----
>From: Doug Johnson [mailto:[EMAIL PROTECTED]]
>Sent: Monday, February 19, 2001 4:32 PM
>To: Casteel, Don
>Subject: Re: [JAVA3D] Problems! disregard FW: [JAVA3D] Volume example
>
>
>Oops. I got this note just as I was sending the response to the previous
>one. I will await further updates. Thx.
>
>Doug
>
>==========
>
>At 04:16 PM 2/19/01 -0500, you wrote:
>>Please disregard my last post. The problems go a little deeper.
>>
>>I'll re-visit the code, correct the errors and re-publish it once it's
>>fixed.
>>It runs fine on my system, but I can see now that some of the "bugs" won't
>>show up.
>>
>>The main problem is in the way I've used the GeometryInfo object. The
>>missing class would have caused another error altogether.
>>
>>How embarrassing : (
>>Don
>>
>>-----Original Message-----
>>From: Casteel, Don
>>Sent: Monday, February 19, 2001 4:05 PM
>>To: 'Doug Johnson'; '[EMAIL PROTECTED]'
>>Subject: RE: [JAVA3D] Volume example
>>
>>
>>My mistake, I'm referencing a class that's not there, and is also not
>>needed. (I think)
>>
>>MatrixQuadArray is a Class I've re-used for many projects. It's looking
for
>>another recycled class called ColorMapper. However the colors are
>>pre-determined, so ColorMapper isn't needed.
>>
>>I'm including the corrected class and source in this e-mail (they're
small)
>>
>>I apologize for the mistake.
>>Please let me know if it works out, so I can change the posted code.
>>
>>==========================================================================
=
>>To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
>>of the message "signoff JAVA3D-INTEREST". For general help, send email to
>>[EMAIL PROTECTED] and include in the body of the message "help".
>
>
>Doug Johnson
>[EMAIL PROTECTED]
>
Doug Johnson
[EMAIL PROTECTED]
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".