Results 1 to 2 of 2
  1. #1
    Addez is offline Senior Member
    Join Date
    Aug 2009
    Posts
    294
    Rep Power
    0

    Default I get CapabilityNotSet Exception, and I cant change that :(

    Hai!
    I just started using java3d to make 3d games.
    If you dont have it just use this site to get an easy exe installer to install it in notime for you: https://java3d.dev.java.net/binary-builds-old.html

    Anyways, I get that error when I try set a new direction for the light.
    And if I try to do:
    Java Code:
    light.setCapability(1);
    then it still gives me same error when I try change its direction...
    I dont know how to fix this, can you help me?

    Heres my code, it's all of it =)
    PHP Code:
    import com.sun.j3d.utils.geometry.*;
    import com.sun.j3d.utils.universe.SimpleUniverse;
    import javax.media.j3d.*;
    import javax.vecmath.*;
    
    /**
     *
     * @author Andreas
     */
    public class Main {
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            SimpleUniverse uni = new SimpleUniverse();
            BranchGroup bg = new BranchGroup();
            Sphere sphere = new Sphere(0.5f);
            bg.addChild(sphere);
            
            BoundingSphere bound = new BoundingSphere(new Point3d(0,0,0),1000);
            Vector3f dir = new Vector3f(0,-1,1);
            DirectionalLight light = new DirectionalLight(new Color3f(0,0,2),dir);
            light.setInfluencingBounds(bound);
            bg.addChild(light);
            uni.addBranchGraph(bg);
            uni.getViewingPlatform().setNominalViewingTransform();
            
            while (true){
                for (int x = 0;x<10;x++){
                    try{Thread.sleep(100); } catch (Exception e){}
                    light.setDirection(x,-1,1);
                }
                
    
            }
        }
    
    }
    Thanks for taking your time :)

  2. #2
    [RaIdEn] is offline Senior Member
    Join Date
    Oct 2009
    Location
    California,US
    Posts
    201
    Rep Power
    5

    Default

    i dnt see any setcapability in the code?..or am i understanding it wrng.

Similar Threads

  1. Replies: 4
    Last Post: 10-25-2010, 07:42 PM
  2. Change in O/p
    By shiv_122 in forum Advanced Java
    Replies: 4
    Last Post: 12-22-2008, 02:37 AM
  3. ip change
    By iiggoorr in forum Networking
    Replies: 9
    Last Post: 11-05-2008, 07:11 PM
  4. Replies: 1
    Last Post: 03-08-2008, 06:41 PM
  5. Is it possible to change the '\n' into ' ' ...
    By johnny7white in forum New To Java
    Replies: 1
    Last Post: 11-15-2007, 02:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •