Methoden Was genau macht die Methode light.setInfluencingBounds ?

Ich meine dass du damit die Region festlegst (bzw. die Grenzen setzt) wo das Licht Einfluss drauf hat.

[h=3]setInfluencingBounds[/h] public void setInfluencingBounds(Bounds region) <dl><dd>Sets the Light's influencing region to the specified bounds. This is used when the influencing bounding leaf is set to null.
</dd><dd><dl><dt>Parameters:</dt><dd><code>region</code> - the bounds that contains the Light's new influencing region. </dd><dt>Throws: </dt><dd><code>CapabilityNotSetException</code> - if appropriate capability is not set and this object is part of live or compiled scene graph</dd></dl> </dd></dl>

Quelle: Light (Java 3D API)
 
Heißt das, dass wenn ich diese Grenze nicht setzte, dass Licht aufs ganze virtuelle Universum fällt ?

Hier ist mein Code, der ist nicht falsch aber ich muss es verstehen

Java:
package thebox;


import com.sun.j3d.utils.universe.SimpleUniverse;    
import com.sun.j3d.utils.geometry.Sphere;         
import javax.media.j3d.BranchGroup;                    
import javax.media.j3d.BoundingSphere;                
import javax.media.j3d.DirectionalLight;
import javax.vecmath.Color3f;
import javax.vecmath.Point3d;
import javax.vecmath.Vector3f;


public class Sphere1
{
    public static void main( String[] args ) {
        new Sphere1();
    }
        
    
    public Sphere1() 
    {
        SimpleUniverse universe = new SimpleUniverse(); 
        BranchGroup group = new BranchGroup();     
        group.addChild(new Sphere(0.5f)); 
         Color3f light1Color = new Color3f(3.9f, 0.1f, 8.1f);
           BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
           Vector3f light1Direction = new Vector3f(4.0f, -7.0f, -12.0f);
           DirectionalLight light1 = new DirectionalLight(light1Color, light1Direction);
           light1.setInfluencingBounds(bounds);
           group.addChild(light1); 
        universe.getViewingPlatform().setNominalViewingTransform();    
        universe.addBranchGraph(group);           
    }
}
 
Zuletzt bearbeitet von einem Moderator:

Neue Themen


Zurück
Oben