ColorCube  -  Donald Casteel 2/20/01
 

Click here to download my Java3D program "ColorCube"


Revision 4...
Changeed line 435 in the ColorCube class from:
pointArray = new PointArray(length*width*height, PointArray.COORDINATES|PointArray.COLOR_4);
to:
pointArray = new PointArray(length*width*height, PointArray.COORDINATES|PointArray.COLOR_3);

ColorCube.zip updated Feb 20 2001 9:45am EST

Third revision. Added GraphicsConfiguration to the ColorCube class so it could be passed to the Canvas3D
ColorCube.zip updated Feb 20 2001 8:00am EST

Second edition, turns out the first one had bugs which I did not catch. This one I hope has addressed those issues. Please let me know how it works.

Thank You
Don
Feb 19 2001 5:00pm EST


I've posted this file by request for people interested in working with volumes in Java3D. This application does not directly produce an image slice along the cutting planes. In this case, to keep it small and simple, I've created QuadArrays for the slicing planes, which are colored-by-vertex using the volume information.

The volume is an array[][][] of points, each point having a color determined by it's position along the x, y, or z axis (xyz == rgb).

The int "step" divides the space into more manageable pieces. As posted step=16 which makes each division in the cube 256/16 resulting in 16 divisions along each axis. If you wish to change this value and re-compile it to run faster with fewer divisions, or slower with more divisions, feel free to try it.

Be warned, a step value of 1 will attempt to display 256*256*256 points and 255*255*3 quads (16,777,216 points and 195,075 quads).

The scrollbars move the slicing planes along their respective axies, the current value for each axis is displayed to the left of the scrollbar. The three values together is the color where the slicing planes intersect, this color is displayed by updating the background color for the scene.

Disclamer:
This program is provided free of charge for use by anyone, for any purpose, it can be modified, changed, or otherwise played with anyway anyone sees fit. If you like it please let me know, constructive criticism will be appreciated, however I am not responsible for any physical, psychological, mental, or technical damages resulting from the use of this program.

: )

dcasteel@tac.textron.com