|
JCanvas3DYUp | |||||||||
PREV NEXT | FRAMES NO FRAMES |
JCanvas3DYUp speeds up the lightweight 3D rendering of JCanvas3D.
See:
Description
Packages | |
---|---|
com.interactivemesh.j3d.community.gui | GUI components which Java 3D renders into. |
JCanvas3DYUp speeds up the lightweight 3D rendering of JCanvas3D.
The java.awt.Graphics class provides a 'drawImage()' method which flips the image vertically on the fly while drawing.
This allows to choose an off-screen buffer in 'yUp' mode. In consequence the memory for an image is saved as well as the time to copy it within the ImageComponent2D object which Java 3D is directly rendering into.
This results in a faster running Java 3D rendering loop.
JCanvas3D and JCanvas3DYUp are both not fully synchronized with the Swing painting loop. Therefore, visual artifacts might appear on the display in case of a large off-screen buffer/panel and a fast rendered 3D scene. Alternatively, the double buffered JCanvas3DOB should be chosen.
JCanvas3DYUp is a derived work of the Java 3D™ utility class JCanvas3D. Changes were made in:
private void createOffScreenBuffer(int width, int height) { ... // JCanvas3D : byReference & !yUp // ImageComponent2D image = new ImageComponent2D(ImageComponent2D.FORMAT_RGBA8, bImage, true, false); // JCanvas3DYUp : byReference & yUp ImageComponent2D image = new ImageComponent2D(ImageComponent2D.FORMAT_RGBA8, bImage, true, true); ... } public void paintComponent(Graphics g) { ... // JCanvas3D // g.drawImage(canvas.bi, 0, 0, getWidth(), getHeight(), null); // JCanvas3DYUp // Draw & flip g.drawImage(canvas.bi, // destination: Graphics g, flip lowerY and upperY // dx1 dy1 dx2 dy2 0, getHeight(), getWidth(), 0, // source: BufferedImage canvas.bi // sx1 sy1 sx2 sy2 0, 0, getWidth(), getHeight(), null); ... }
Version: 1.0
Date: 2009/03/09
Author:
August Lammersdorf, InteractiveMesh e.K.
Kolomanstrasse 2a, 85737 Ismaning
Germany / Munich Area
www.InteractiveMesh.com/org
License:
Redistribution and use are permitted according to the following license notice.
com.sun.j3d.exp.swing.JCanvas3D.java
Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Neither the name of Sun Microsystems, Inc. or the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.
This software is provided "AS IS," without a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
You acknowledge that this software is not designed, licensed or intended for use in the design, construction, operation or maintenance of any nuclear facility.
Revision: 1.10
Date: 2007/04/11 02:08:56
State: Exp
Trademarks:
Java and Java 3D are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
|
JCanvas3DYUp | |||||||||
PREV NEXT | FRAMES NO FRAMES |