Why can't i position this object??

Hi All.
I'm having aslight problem. I'm trying to create a sphere and position it somewhere in my scene but everytime i run the code it automatically positions it back at (0,0,0).
Anyone got any ideas.
The code's below.
Thanks a lot.
Java_chic.
java.net.URL image_url = applet.getImageUrl( "Java3d.jpg" );
TransformGroup tg1 = new TransformGroup( );
tg1.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
Appearance app = new Appearance( );
Transform3D transform = new Transform3D();
Sphere sphere = new Sphere( 0.4f, Sphere.GENERATE_TEXTURE_COORDS, app);
Vector3f vector = new Vector3f(x,y,z );
Texture tex1 = new TextureLoader( image_url, applet ).getTexture();
app.setTexture( tex1 );
TextureAttributes texAttr = new TextureAttributes();
texAttr.setTextureMode( TextureAttributes.REPLACE );
app.setTextureAttributes( texAttr );
sphere.setAppearance(app);
transform.setTranslation(vector);
tg1.setTransform(transform);
tg1.addChild( sphere );
Transform3D yAxis = new Transform3D();
Alpha rotationAlpha = new Alpha(-1, Alpha.INCREASING_ENABLE,
                         0, 0,
                         4000, 0, 0,
                         0, 0, 0);
RotationInterpolator rotator =
     new RotationInterpolator(rotationAlpha, tg1, yAxis,
                    0.0f, (float) Math.PI*2.0f);
BoundingSphere bounds =
     new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
rotator.setSchedulingBounds(bounds);
tg1.addChild(rotator);
bg.addChild( tg1 );
/////////////////////////////////////////

Sharon,
you can try out the following code, it should work.
Regards,
Oliver
java.net.URL      image_url     = applet.getImageUrl( "Java3d.jpg" );
TransformGroup    tg1           = new TransformGroup( );
TransformGroup    tg2           = new TransformGroup( );
Appearance        app           = new Appearance( );
Transform3D       transform     = new Transform3D();
Sphere            sphere        = new Sphere( 0.4f, Sphere.GENERATE_TEXTURE_COORDS, app);
Vector3f          vector        = new Vector3f(x,y,z );
Texture           tex1          = new TextureLoader( image_url, applet ).getTexture();
TextureAttributes texAttr       = new TextureAttributes();
Transform3D       yAxis         = new Transform3D();
Alpha             rotationAlpha = new Alpha( -1, Alpha.INCREASING_ENABLE,
                                             0, 0,
                                             4000, 0, 0,
                                             0, 0, 0);
RotationInterpolator rotator    = new RotationInterpolator( rotationAlpha,
                                                            tg1, yAxis,
                                                            0.0f,
                                                            (float) Math.PI*2.0f);
rotator.setSchedulingBounds( new BoundingSphere (new Point3d(0.0,0.0,0.0), 100.0) );
texAttr.setTextureMode( TextureAttributes.REPLACE );
app.setTexture( tex1 );
app.setTextureAttributes( texAttr );
tg1.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
sphere.setAppearance(app);
// Look here:
transform.setTranslation(vector);
tg2.setTransform(transform);
tg2.addChild( tg1 );
tg1.addChild( sphere );
tg1.addChild(rotator);
bg.addChild( tg2 );
/////////////////////////////////////////

Similar Messages

  • I am unable to apply my downloaded update. When I try to apply it and restart firefox, it still says 'apply downloaded update now...'. Why can't I apply this update and what do I do about it?

    I am unable to apply my downloaded update. When I try to apply it and restart firefox, it still says 'apply downloaded update now...'. Why can't I apply this update and what do I do about it?

    Checked out that link and everything seems to be in order on this machine at this time.
    I only have CC installed on this one machine, not even my secondary machine like is permitted. it seems odd that I'm asked to re-accept the Licence Agreement as often as I am. If I had to guess, it's almost every week, if not multiple times some weeks, that all the software will decide I should have to view the licence agreement.
    Edit: I've never had any noticeable "errors" activating or anything like that. I just get asked to do it quite frequently.
    This activation screen isn't too annoying (it involves clicking one single button), but like I stated earlier, if I'm trying to launch the software by double-clicking on a PSD, AI, PPROJ, AEP, etc... that file will fail to open.
    I feel like that's probably not really a bug, but it is frustrating, since I did launch the application with the intent to edit that specific file I tried to open.
    Again, something that you guys may consider working on.
    Another annoyance is that: agreeing to the licence agreement is a per-application task, so if I see that Licence Agreement dialogue window by opening Photoshop (for example), I know that every other piece of software I have in the suite (Illustrator, Premiere, After Effects, Audition) will be showing me that screen on it's next launch. Probably deliberate for legal purposes that I can't just agree once for the whole suite, but heck, it would save me a lot of minor headaches if it was a unified agreement.

  • I want to change my primary email address, and use one already associated with my account why can I not do this ?, I want to change my primary email address, and use one already associated with my account why can I not do this ?

    I want to change my primary email address, and use one already associated with my account why can I not do this ?, I want to change my primary email address, and use one already associated with my account why can I not do this ?  I don't want to create another one if I really don't need to
    Any ideas ?

    I'm afraid that once an address has been associated with an Apple ID you can't re-use it in any way. You will have to create another address (such as a free on from GMail or Yahoo for example).

  • Whenever I modify a photo in Iphoto it puts it in a "modified" subfolder. Why can't I move this modified file (I changed name) back to the Iphoto main file so I can see it when I open my photos?

    Whenever I modify a photo in Iphoto it puts it in a "modified" subfolder. Why can't I move this modified file (I changed and saved file name) back to the Iphoto main file so I can see it when I open my photos?

    A good general step for strange issues is to renew the iPhoto preference file - quit iPhoto and go to "your user name" ==> library ==> preferences ==> com.apple.iPhoto.plist and trash it - launch iPhoto which creates a fresh new default preference file and reset any personal preferences you have changed and if you have moved the iPhoto library repoint to it. This may help
    This does not affect your photos or any database information (keywords, faces, places, ratings, etc) in any way - they are stored in the iPhoto library - the iPhoto preference file simply controls how iPhoto works - which is why renewing it is a good first step.
    If that does not cure it backup up your iPhoto library and rebuild it - depress the option and command keys and launch iphoto and use the options there - exact option depends on teh version you have
    And always remember - NEVER make any changes of any sort to the structure or content of the iPhoto library - nothing - no deletions - no name changes - nothing
    LN 

  • HT1528 Why can't I bookmark this page like I can with support.discussions pages?

    Why can't I bookmark this page like I can with support.discussions pages?

    Hi UI Guy,
    I can't provide the technical reason, however, I'm farilry certain it is a function of Forum structure itself.
    Don't know if you are interested in suggestions to meet your need to "bookmark pages within the Apple Support system so you can refer back to them easily", but I use them regularly, and do this one of two ways (I use both):
    If it is strictly an Apple Support page that I retrieved from Apple, I bookmark it with clear easy to find names, and put them in my Apple Support Folder in my bookmarks (I use Firefox). That way, when I need to provide a link to someone I'm replying to, I can quickly find the item I want them to be able to link to.
    I also bookmark discussions that have links in them that I may want to use, and tag them so I can find them later.
    I have to say, however, that for Apple Support Pages, the best solution for me has been to have my Apple Folder with my personally named bookmarks in Firefox. Easy to find, easy to cut and paste into a discussion on a separate window, easy to reference when I need to know something.
    Again, don't know if you even wanted to know any of that, but thought I'd share!
    Cheers,
    GB

  • A Playlist idiot. Why can't I get this to work?

    In iTunes I have music Playlists set to shuffle (blue double arrow button) and audio books Playlist set no shuffle. I have been unable to get my iPod to follow these settings. A suggested work around is to use the iPod Settings to set the shuffle function to "songs" when playing music and then switching to “off’ for audio books. There has to be a better way. How do I set the Playlists on my iPod to function the same as it does on iTunes?

    LeftyLucy,
    Using your process are you able to set your iPod to shuffle then listen to the audio book without it shuffling the chapters? I have tried your suggestion with the iPod setting set to shuffle and the chapters shuffled. This is the issue from my original post. I want to listen to music with the shuffle function and listen to audio books (no shuffle) without having to change the settings every time I switch.
    Keep in mind that is not a purchased audio nor a imported book.
    Using a tip from the following post:
    Tom Graves, "A Playlist idiot. Why can't I get this to work?" #11, 05:26pm Sep 28, 2005 CDT
    I have attempted to make the audio book file into an authenticate file but that did not help.

  • Why Can't Creative do thi

    Why can't Creative do this with the headphone jack problem?
    http://www.sony.co.uk/PageView.do?si...=en_GB_Support

    Do we need another thread on this? It could be that Sony's problem is a very serious fault like a fire hazard with the battery or something.

  • HT4009 I have a Ipad Mini and want to load Slotomania.  It will not let me do this. I currently have that game on my IPod Touch and my daughter has Slotomania on her IPad Mini.  Why can't I load this game on MY IPad Mini???????

    I have Slotomania on my IPod Touch and my daughter has Slotomania on her IPad Mini.  Why can't I get this game on my Mini??

    What happens when you try to install it?
    What happens when you try to redownload it directly to the iPad by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • Why can't I select an object from its center?  Direct selecttool will only select bounding box.

    Why can't I select an object from its center?  Direct selecttool will only select bounding box.

    You may have turned on "Object selection by path only" in the "Selection Options".

  • Why can't I add an Object[] to a Vector ? super Object[] ?

    I don't understand why javac rejects these two statements:
        Vector<? super Object[]> v= new Vector<Object[]>();
        v.add(new Object[0]);cannot find symbol
    symbol : method add(java.lang.Object[])
    location: class java.util.Vector<capture of ? super java.lang.Object[]>
    v.add(new Object[0]);
    ^
    The type of v can only be one of these 4:
    Vector<Object[]>, Vector<Object>, Vector<Serializable>, Vector<Cloneable>.
    Therefore, I should always be allowed to add an Object[] to it, right?
    The following example is very similar, but this one is accepted by javac.
        Vector<? super Number> v= new Vector<Number>();
        v.add(42);I didn't find a relevant difference to the first example, nor something in JLS3 that would forbid it. Is this a javac bug?

    There is a difference between legal and practical. Practical is a matter of opinion. I thought I should try the combinations to see which make sense.
    I don't find it intuative that list.add(list.get(0)) should fail to compile.
    While the definitions have a logic of their own, some are very hard to put it into english exactly what they really mean. This means finding a practical purpose for them even harder.
    For example List<? super Object>
    add(x) is legal for non-arrays
    method(list) is illegal for method(List<Object>) but is legal for method(List<? super Object[]>)
    public class A {
        public static void foo(List<? super Object[]> l) {    }
        public static void foo2(List<Object[]> l) {    }
        public static void foo3(List<? extends Object[]> l) {    }
        public static void bar(List<? super Object> l) {    }
        public static void bar2(List<Object> l) {    }
        public static void bar3(List<? extends Object> l) {    }
        public static void bar4(List<?> l) {    }
        public static void main(String[] args) {
            {   // can be { Object, Object[] }
                List<? super Object[]> l = new ArrayList<Object[]>();
                l.add(l.get(0));  // illegal
                l.add((Object) null);  // illegal
                l.add((Integer) null);  // illegal
                l.add((Object []) null); // illegal
                l.add((Integer []) null); // illegal
                l.add((Integer [][]) null); // illegal
                foo(l); // List<? super Object[]> - legal
                foo2(l); // List<Object[]> - illegal
                foo3(l); // List<? extends Object[]> - illegal
                bar(l); // List<? super Object> - illegal
                bar2(l); // List<Object> - illegal
                bar3(l); // List<? extends Object> - legal
                bar4(l); // List<?> - legal
            {   // can be Object[] or (? extends Object)[]
                List<Object[]> l = new ArrayList<Object[]>();
                l.add(l.get(0));  // legal
                l.add((Object) null);  // illegal
                l.add((Integer) null);  // illegal
                l.add((Object []) null); // legal
                l.add((Integer []) null); // legal
                l.add((Integer [][]) null); // legal
                foo(l); // List<? super Object[]> - legal
                foo2(l); // List<Object[]> - legal
                foo3(l); // List<? extends Object[]> - legal
                bar(l); // List<? super Object> - illegal
                bar2(l); // List<Object> - illegal
                bar3(l); // List<? extends Object> - legal
                bar4(l); // List<?> - legal
            {   // Only allows wildcards, Object is illegal.
                List<? extends Object[]> l = new ArrayList<Object[]>();
                l.add(l.get(0));  // illegal
                l.add((Object) null);  // illegal
                l.add((Integer) null);  // illegal
                l.add((Object []) null); // illegal
                l.add((Integer []) null); // illegal
                l.add((Integer [][]) null); // illegal
                foo(l); // List<? super Object[]> - illegal
                foo2(l); // List<Object[]> - illegal
                foo3(l); // List<? extends Object[]> - legal
                bar(l); // List<? super Object> - illegal
                bar2(l); // List<Object> - illegal
                bar3(l); // List<? extends Object> - legal
                bar4(l); // List<?> - legal
            {   // can add non-arrays but can only match ? super Object, ? super Object[], or ? extends Object, but not Object 
                List<? super Object> l = new ArrayList<Object>();
                l.add(l.get(0));  // legal
                l.add((Object) null);  // legal
                l.add((Integer) null);  // legal
                l.add((Object []) null); // illegal
                l.add((Integer []) null); // illegal
                l.add((Integer [][]) null); // illegal
                foo(l); // legal
                foo2(l); // illegal
                foo3(l); // illegal
                bar(l); // legal
                bar2(l); // illegal
                bar3(l); // legal
                bar4(l); // legal
            {   // can add array but cannot call a method which expects an array. 100% !
                List<Object> l = new ArrayList<Object>();
                l.get(0).toString();
                l.add(l.get(0));  // legal
                l.add((Object) null);  // legal
                l.add((Integer) null);  // legal
                l.add((Object []) null); // legal
                l.add((Integer []) null); // legal
                l.add((Integer [][]) null); // legal
                foo(l); // legal
                foo2(l); // illegal
                foo3(l); // illegal
                bar(l); // legal
                bar2(l); // legal
                bar3(l); // legal
                bar4(l); // legal
            {   // cannot add any type but can match ? or ? extends Object.
                List<? extends Object> l = new ArrayList<Object>();
                l.add(l.get(0));  // illegal
                l.add((Object) null);  // illegal
                l.add((Integer) null);  // illegal
                l.add((Object []) null); // illegal
                l.add((Integer []) null); // illegal
                l.add((Integer [][]) null); // illegal
                foo(l); // List<? super Object[]> - illegal
                foo2(l); // List<Object[]> - illegal
                foo3(l); // List<? extends Object[]> - illegal
                bar(l); // List<? super Object> - illegal
                bar2(l); // List<Object> - illegal
                bar3(l); // List<? extends Object> - legal
                bar4(l); // List<?> - legal
            {   // same as ? extends Object.
                List<?> l = new ArrayList<Object>();
                l.add(l.get(0));  // illegal
                l.add((Object) null);  // illegal
                l.add((Integer) null);  // illegal
                l.add((Object []) null); // illegal
                l.add((Integer []) null); // illegal
                l.add((Integer [][]) null); // illegal
                foo(l); // List<? super Object[]> - illegal
                foo2(l); // List<Object[]> - illegal
                foo3(l); // List<? extends Object[]> - illegal
                bar(l); // List<? super Object> - illegal
                bar2(l); // List<Object> - illegal
                bar3(l); // List<? extends Object> - legal
                bar4(l); // List<?> - legal
    }

  • Two Apple IDs Why can't you fix this?

    Why can't you fix the problem for those of us who ended up with multiple Apple IDs and permit us to merge just once? I understand that IDs are tied to software updates but surely you chave the capability tod o this?

    These are user-to-user forums, they are not monitored by Apple (there are too many forums/threads/messages for that to happen). It is not currently possible to merge, or transfer content between, iTunes accounts -  if you want to leave feedback for Apple then you can do so here : http://www.apple.com/feedback/itunesapp.html

  • Why Can't QuickTime Do This Anymore?

    About a year ago, I used to be able to create muxed MPEG-2 TS (transport streams) using Compressor and open them using QuickTime. Of course I have the MPEG-2 plugin for QuickTime too. However, it seems QuickTime can no longer open MPEG-2 TS files. I can still create them using Compressor, but only MPEG Streamclip can open them, QuickTime cannot. I can't believe this shareware program can do something Apple can't. It MUST be a legal issue involving QuickTime. Does anyone know for sure? I have spent a lot of time looking for the answer to this. Why can't QuickTime play TS files?????

    MPEG Streamclip is a better all around solution so instead of figuring out why Apple did something move on to a superior multipurpose and conveniently, free, application as you have found.

  • Why can't I delete this video file from my trash can?

    I have a video file that I will not disappear from my trash can when I click the "empty track" button. I managed to move the folder containing the video file from documents to the trash after a lot of effort, but it kept telling me that I didn't have the privileges necessary to delete the video permanently. Now the video file is sitting inside a folder inside the trash can where I can't move anywhere else. If I try to move it anywhere else, it simply copys to that folder but stays inside the original stays in the trash can as well, but I can still delete the copy and the original stays sitting in the trash can. Can anyone help me so I can get rid of this file once and for all.

    ho yeah .. i know that, but i tried even in a low quality and it's not worked.
    Maybe it's related to the TimeQuick?

  • Why can't I position a photo flush left?

    I'm an experienced Dreamweaver user but an iWeb novice. I just created a simple page containing just one large photo. I positioned this photo as close to the left edge of the page window as possible, but when the page is published, the page is indented (as though the space to its left is reserved for a column of links.
    Is there a way to tell iWeb that the photo should be positioned flush left (without a links column)? I just want to use this page as a reference url for a mailing. No one (except me) will ever visit this site. Here's the url: http://web.me.com/alansky/ContentedMac/Home.html
    Thanks!

    You might try this workaround courtesy of Cyclosaurus: http://discussions.apple.com/thread.jspa?threadID=1925916&tstart=0
    OT

  • What is local storage? Why can't I get this app?

    So I'm trying to get the sims free play app on my ipod4g. It requires 569MB. So I click download and it says I do not have enough local storage. Which I clear do cause I just deleted almost everything off my iPod. I have 1.0GB of free storage left. I don't get it??? Why can't I get the app???

    You do NOT have enough space.  Most apps require 2 or 3 thimes the space required in order to install the app.
    You will need 1.2 - 1.8 gb or so free

Maybe you are looking for

  • External hard disk for use with quicksilver 2002 and intel imac 24"

    i am wanting to purchase an external hard disk to be used with both a g4 and an intel imac 24". i am considering a seagate barracuda 500gb or 750gb and purchasing an external case separately. interfaces - usb2, firewire 400 and 800. Do I need a case

  • Blue j question

    i was just wondering if someone could help me out with a couple methods. i want to search through an array either using a for or while statement, in order to find both: -the busiest hour -the least busiest hour it needs to return the busiest hour and

  • Connecting a n78 to 2 macs

    hello, first post and perhaps a daft question? i work between 2 macpro's (one at work, one at home) and wonder if a can sync my address books and ical entries from both macs by connecting my phone? i want to have any additions to either mac on both a

  • Apps closing as soon as I open them on my 5s

    few of my apps have suddenly stopped working. They close automatically as soon as I open them.

  • Edit JNDI properties in Oracle9i Jdeveloper

    Hi All, When create a client for EJB in Oracle9i JDeveloper Version 9.0.3, adds in code in each client created to set the JNDI properties. I want to know from where and how does the OC4J server read these JNDI parameters from. Is there any file like