/* * $RCSfile$ * * 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: * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 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$ * $Date$ * $State$ */ package org.jdesktop.j3d.examples.sound; import java.awt.GraphicsConfiguration; import java.net.URL; import org.jdesktop.j3d.examples.Resources; import org.jdesktop.j3d.examples.sound.audio.JOALMixer; import org.jogamp.java3d.AmbientLight; import org.jogamp.java3d.Appearance; import org.jogamp.java3d.BackgroundSound; import org.jogamp.java3d.BoundingSphere; import org.jogamp.java3d.Bounds; import org.jogamp.java3d.BranchGroup; import org.jogamp.java3d.Canvas3D; import org.jogamp.java3d.ColoringAttributes; import org.jogamp.java3d.DirectionalLight; import org.jogamp.java3d.LineArray; import org.jogamp.java3d.LineAttributes; import org.jogamp.java3d.Material; import org.jogamp.java3d.PolygonAttributes; import org.jogamp.java3d.Shape3D; import org.jogamp.java3d.Sound; import org.jogamp.java3d.Transform3D; import org.jogamp.java3d.TransformGroup; import org.jogamp.java3d.utils.behaviors.keyboard.KeyNavigatorBehavior; import org.jogamp.java3d.utils.geometry.ColorCube; import org.jogamp.java3d.utils.geometry.Sphere; import org.jogamp.java3d.utils.universe.SimpleUniverse; import org.jogamp.java3d.utils.universe.Viewer; import org.jogamp.java3d.utils.universe.ViewingPlatform; import org.jogamp.vecmath.Point3d; import org.jogamp.vecmath.Vector3f; /** * This is a test for a BackgroundSound. * This program is ported from an earlier version of BackgroundSoundTest, in the j3d-incubator project, * contributed by David Grace (dave@dutchie.net). * */ public class BackgroundSoundTest extends javax.swing.JFrame { private JOALMixer mixer = null; private URL url = null; private SimpleUniverse univ = null; private BranchGroup scene = null; //The activation radius for the ViewPlatform private float activationRadius = 1; private Shape3D getDefaultGrid(int noOfLines, double size, double height){ Shape3D shape = new Shape3D(); double lineLength = noOfLines * size / 2; LineArray la = new LineArray(noOfLines * 4, LineArray.COORDINATES); int count = 0; for (int i=0; i//GEN-BEGIN:initComponents private void initComponents() { drawingPanel = new javax.swing.JPanel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("BackgroundSoundTest"); drawingPanel.setLayout(new java.awt.BorderLayout()); drawingPanel.setPreferredSize(new java.awt.Dimension(800, 600)); getContentPane().add(drawingPanel, java.awt.BorderLayout.CENTER); pack(); }// //GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) {System.setProperty("sun.awt.noerasebackground", "true"); java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new BackgroundSoundTest().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JPanel drawingPanel; // End of variables declaration//GEN-END:variables }