Help Please I can't get my .wrl into a Geometry array

Hello, I was hoping to get a quick fix for the problem I have with my code.
              Loader loader = new Loader(Loader.LOAD_ALL) ;
              // get the file names
              String[] srrFilenamen = null ;
              srrFilenamen = new String[]{ ("src/CarParts.WRL"), ("src/CarFlip.WRL"), ("src/CarShat.WRL")} ;
                // Several transform groops to put the objects where they should be
                TransformGroup objTrans[] = new TransformGroup[4] ;
                for (int i = 0 ; i < 4 ; i++)
                        objTrans[i] = new TransformGroup() ;
                        objScale.addChild(objTrans) ;
Transform3D tr = new Transform3D() ;
Transform3D rotX90 = new Transform3D() ;
rotX90.rotX(90.0 * Math.PI / 180.0) ;
objTrans[0].getTransform(tr) ;
tr.setTranslation(new Vector3d( -2.0, 1.5, -2.0)) ;
tr.mul(rotX90) ;
objTrans[0].setTransform(tr) ;
objTrans[1].getTransform(tr) ;
tr.setTranslation(new Vector3d(0.0, 1.5, -2.0)) ;
tr.mul(rotX90) ;
objTrans[1].setTransform(tr) ;
objTrans[2].getTransform(tr) ;
tr.setTranslation(new Vector3d(2.0, 1.5, -2.0)) ;
tr.mul(rotX90) ;
objTrans[2].setTransform(tr) ;
objTrans[3].getTransform(tr) ;
tr.setTranslation(new Vector3d(0.0, -2.0, -2.0)) ;
tr.mul(rotX90) ;
objTrans[3].setTransform(tr) ;
// Now load the object files
Scene srrMorpScene[] = new Scene[3] ;
GeometryArray g[] = new GeometryArray[3] ;
Shape3D shape[] = new Shape3D[3] ;
for (int i = 0 ; i < 3 ; i++)
srrMorpScene[i] = null ;
g[i] = null ;
shape[i] = null ;
for (int i = 0 ; i < 3 ; i++)
srrMorpScene[i] = loader.load(srrFilenamen[i]) ;
Group b = srrMorpScene[i].getSceneGroup() ;
objTrans[i].addChild(b) ;
// error
shape[i] = (Shape3D) objTrans[i].getChild(0); // this is where the problem lies
// the rest should be ok
g[i] = (GeometryArray) shape[i].getGeometry() ;
shape[i].setGeometry(g[i]) ;
Some of you might recognise this from the well used hand morph demo, however that demo works with .obj files.
.obj files are not loaded in the same way as .wrl files, there for I've had to change the loader a little, however they still load into scene.
But the error produced is:
java.lang.ClassCastException
     at SCU.<init>(SCU.java:207)
     at WMP_Quicktime.<init>(WMP_Quicktime.java:67)
     at WMP_Quicktime.main(WMP_Quicktime.java:33)
" A 'ClassCastException' means that I'm trying to type cast something as something it isn't.
I've been looking in the web, and on this site my findings have made me change           
            BranchGroup b = s.getSceneGroup();
     shape[i] = (Shape3D) b.getChild(0);
into:
            TransformGroup objTrans.addChild(b) ;
shape[i] = (Shape3D) objTrans[i].getChild(0);
Because someone on this site used it that that way(from a transformgroup) and had no problems converting to Shape3D apperantly.
Also I've tried
            Group b = s.getSceneGroup();
     shape[i] = (Shape3D) b.getChild(0);
Because I usually load a sene into a Group, not a branchgroup.
And I've tried.
            BranchGroup b = s.getSceneGroup();
     shape[i] = (Shape3D) b.cloneTree();
Because The input should and could only be a node, right?
In all cases
java.lang.ClassCastException
     at SCU.<init>(SCU.java:207)
     at WMP_Quicktime.<init>(WMP_Quicktime.java:67)
     at WMP_Quicktime.main(WMP_Quicktime.java:33)
"my .wrl files are a little on the larger side, as they are a car(in 3 states of destruction) and have quite a few triangles.
I'm using JDK 1.3 on Jbuilder 2005, this because as my laptop is broken thus I am forced to use the somewhat outdated software(not alowed to install programs).
I hope I've supplied enough information to get help.
Other wise could somone inform me of a alternate way to use the J3D morph function, or a function with similar effect.
(not making a each step a file and showing them 1 after another, that would take to much loading and memory time, I'm already strangeling the CPU at 89%)
Thank you in davance for your help.
Aditionally here is the original code with the .obj files.
  private java.net.URL[] objFiles = null;
     // Create the transform group nodes for the 3 original objects
     // and the morphed object.  Add them to the root of the
     // branch graph.
     TransformGroup objTrans[] = new TransformGroup[4];
     for(int i=0; i<4; i++) {
         objTrans[i] = new TransformGroup();
         objScale.addChild(objTrans);
     Transform3D tr = new Transform3D();
     Transform3D rotX90 = new Transform3D();
     rotX90.rotX(90.0 * Math.PI / 180.0);
     objTrans[0].getTransform(tr);
     tr.setTranslation(new Vector3d(-2.0, 1.5, -2.0));
     tr.mul(rotX90);
     objTrans[0].setTransform(tr);
     objTrans[1].getTransform(tr);
     tr.setTranslation(new Vector3d(0.0, 1.5, -2.0));
     tr.mul(rotX90);
     objTrans[1].setTransform(tr);
     objTrans[2].getTransform(tr);
     tr.setTranslation(new Vector3d(2.0, 1.5, -2.0));
     tr.mul(rotX90);
     objTrans[2].setTransform(tr);
     objTrans[3].getTransform(tr);
     tr.setTranslation(new Vector3d(0.0, -2.0, -2.0));
     tr.mul(rotX90);
     objTrans[3].setTransform(tr);
     // Now load the object files
     Scene s[] = new Scene[3];
     GeometryArray g[] = new GeometryArray[3];
     Shape3D shape[] = new Shape3D[3];
     ObjectFile loader = new ObjectFile(ObjectFile.RESIZE);
     for(int i=0; i<3; i++) {
     s[i] = null;
     g[i] = null;
     shape[i] = null;
     for(int i=0; i<3;i++) {
     try {
          s[i] = loader.load(objFiles[i]);
     catch (FileNotFoundException e) {
     System.err.println(e);
     System.exit(1);
     catch (ParsingErrorException e) {
     System.err.println(e);
     System.exit(1);
     catch (IncorrectFormatException e) {
     System.err.println(e);
     System.exit(1);
BranchGroup b = s[i].getSceneGroup();
     shape[i] = (Shape3D) b.cloneTree();
     g[i] = (GeometryArray) shape[i].getGeometry();
     shape[i].setGeometry(g[i]);
     objTrans[i].addChild(b);
public void init() {
if (objFiles == null) {
     objFiles = new java.net.URL[3];
     // the path to the image for an applet
     String path = getCodeBase().toString();
     try {
     objFiles[0] = new java.net.URL(path + "hand1.obj");
          objFiles[1] = new java.net.URL(path + "hand2.obj");
          objFiles[2] = new java.net.URL(path + "hand3.obj");
     catch (java.net.MalformedURLException ex) {
     System.out.println(ex.getMessage());
          System.exit(1);
Message was edited by:
System_Crush
[EDIT] made the error mesages a little more eye catching
null

I'd suggest installing any available updates for your computer. To ensure the drivers are up to date.

Similar Messages

  • Urgent help please. Can't get image on LED cinema display.

    My husband has a traumatic brain injury. His existing monitor went kaput yesterday, &amp; I've been trying desperately to set up a new LED cinema display with his Mac Pro that was purchased May 2007 for the past 4.5 hrs without success. Can't get any image on it &amp; don't know what else to try. Any suggestions please?

    Can we assume that the graphics card has been replaced with one that has a mini display port, such as the Radeon HD 5770 or the Geforce GT 120? The originally shipped graphics card options for the 2007 Mac Pro do NOT have the Mini Display Port.
    Does my computer have a Mini DisplayPort connector?
    If not, one will either need an Atlona AT-DP400 adapter to connect the LED Cinema Display to a dual link DVI port of the graphics card OR to replace the graphics card with one that is equipped with the Mini Display Port.
    Review of the Atlona AT-DP400.
    Also, does the Mac Pro have OS X 10.6.4 or later?

  • I need help please!  Can pictures get on your icloud other ways?  Can something be put on there by someone other than yourself, liked public wifi or hacked?  Got a big problem h some **** on an iPod and I am to knowledgeble about the ipod...thanks

    .         Can pictures get on your icloud other ways?  Can something be put on there by someone other than yourself, liked public wifi or hacked?  Got a big problem with some **** on an iPod and I am to knowledgeble about the ipod...thanks

    You're not confusing this with a shared Photo Stream...?
    Because the short answer is no, photos don't appear unless they were put there by someone with your Apple ID credentials. To rule out that possibility, change your Apple ID password by carefully following all these instructions:
    iCloud: Change your iCloud account password
    If you decide to change your password, and you also want to change your Apple ID, I recommend you do not concurrently change your Apple ID until sufficient time has passed and you are confident the password change has been effected on all your iOS devices. 24 hours ought to be more than enough.
    It is not necessary to change your Apple ID unless it is an email address you no longer wish to use.

  • Help please I can't get my photos off my phone

    My 4s used to show in my computer and I used to be able to get the photos off the device there but now it doesn't show up since the new upgrade.  I have tried to get the computer to recognise the device but it won't but it still syncs and shows in iTunes and charges from my computer. Could it be my virus protection? I can't figure it out it never used to be a problem
    Please help

    I'd suggest installing any available updates for your computer. To ensure the drivers are up to date.

  • Need Help Please - I can't get Java to compile my programs

    Hi, I'm taking a programming course in college and want to be able to compile my java programs at my home laptop instead of just at the lab...
    However, when I write my code and try to compile with TextPad, there is no "Compile" option....Instead there is a grayed-out option of "User-tool"...
    I have installed the J2SE Developmental Kit 5.0 Update 11 and the JavaRuntime Environment 5.0 Update 11....In the labs, the computers have the exact same thing except they are the Update 9 versions....
    What am I missing? Thanks for any help you can offer....

    > TextPad isn't part of the JDK nor runtime of Java,
    and this isn't a TextPad product support site.
    (Edit: Except when yawmark is around)
    Pish. I pointed himmer to the proper place. ;o)
    It would be advisable to lose your addiction to IDE's
    anyway (like TextPad)
    Pish. TextPad isn't an IDE. It's a feature-rich text editor that happens to let you run commands from within the program (though I don't argue with the benefit of compiling/executing from the CL when learning).
    ~

  • Help please, I can't get select list behavior correct

    I have a demo application at apex.oracle.com http://apex.oracle.com/pls/apex/f?p=71968:1 username is demo, password is demo
    I have a form with multiple fields
    field1 (Text Field)
    field2 (Text Field)
    field3 (Text Field)
    field4 (Text Field)
    Status (Select List)
    The select list has the following options:
    Open
    Working
    Closed
    Process flow is as follows:
    Ticket created and status is defaulted to Open
    Analyst does their work and if they save the ticket they move the status to working and apply changes so now Working is stored in the database as the status
    When the work is complete, they select Closed and Apply Changes and the ticket is complete.
    What I am trying to do here is set it up so that the analyst cannot select Closed or they receive a message when they select closed if field1, field2, field3, or field4 are empty.
    I tried a dynamic action and I can get it to hide the close selection in the list and it will only appear when the fields are filled in, but say the ticket is in Working Status, after I fill in the fields, I see the Status selection list updating but then it changes the value to Open. All three options are now available, but the analyst may not want to close the ticket even though they have all the fields filled in. So I would want the status to stay in working but this automatically goes to Open.
    So I guess in the end, I need a select list that maintains its current value but the option to see closed is only available when the three fields are all not null.
    I have a demo application at apex.oracle.com http://apex.oracle.com/pls/apex/f?p=71968:1 username is demo, password is demo
    You can see what I am referring to if you select the record in the Report section with the status of working. Then when it comes up, remove one of the values from the fields and you will see that instead of keeping the value as working it changes it to open. I want it to keep its current value unless that value was closed, in that case it can go back to open.
    Any suggestions as to how to acoomplish this would be appreciated.
    Thanks
    Wally

    Hi Wally,
    You can change your lov as cascading lov and in the parent lov items, give the names of all that 4 fields. Also change your lov query as below
    select DVALUE as display_value, RVALUE as return_value from STATUS
    where ((vValue = 1 and (:PXXX_FIELD2 IS NULL OR :PXXX_FIELD2 IS NULL OR :PXXX_FIELD2 IS NULL OR :PXXX_FIELD2 IS NULL))
    OR (:PXXX_FIELD2 IS NULL AND :PXXX_FIELD2 IS NULL AND :PXXX_FIELD2 IS NULL AND :PXXX_FIELD2 IS NULL).
    Regards,
    Natarajan
    Edited by: Nattu on Mar 20, 2013 8:27 AM

  • Help please I can't get into my computer, asking for a password I do not know

    When I push the start up bottom, the screen pops up "ENTER ADMINISTRATOR PASSWORD OR POWER ON PASSWORD" I have no clue why it's doing this and the pass word it won't even let me put in a windows cd to reboot the system without a password my laptop is only 3-4years old

     When asked for the password just hit enter 3 times. Post any code. REO

  • Can anyone help please. how do i get the home button to appear on the touch screen my home button has stopped working?

    can anyone help please. how do i get the home button to appear on the touch screen my home button has stopped working?

    I have same problem.
    However, I am unable to turn on Assistive Touch.
    At one time I was able to activate it, but it went away and now I cant reactivate.
    What is the solution?

  • Please help. How can i get my mic to work??

    + Hi all
    I have a creative inspire 5. 5700 hooked up to my X-FI extreme music via Digital I/O port.
    However im a bit pissed off because i cant get a microphone to work, it seems that the port i use my speakers for is the same port as the microphone..
    Any ideas how to get my mic to work without unplugging the digital I/O?
    Cheers

    /Re: Please help. How can i get my mic to work? The only solution that I can think of is to get the?X-Fi I/O Dri've. Unfortunately, Creative does not sell this anymore on their store. You can buy it online, though most places I find it at, it is refurbished.
    This is what it looks like: http://us.creative.com/products/prod...5&product=4659#
    The other alternati've is the X-Fi I/O Console. This, however is rather expensi've (I think it is anyways).
    http://us.creative.com/products/prod...duct=47&listby=
    Unfortunately those are the only ways I know of. The X-Fi Xtreme Music does not hook into normal front panel solutions.

  • HT1414 I had a new phone and I clicked some pictures and then I restore my new phone with the old back up and I lost my new clicked photos...please help me how can I get back those photos?

    I had a new phone and I clicked some pictures and then I restore my new phone with the old back up and I lost my new clicked photos...please help me how can I get back those photos?

    You were already provided the answer. If you do not have a backup of the phone while the photos were on the phone, they are gone. When you restore your phone from an old backup, anything that has been saved to the phone since that backup is deleted. Sorry.

  • Help please - I can't update my ipad software as always get network connections issues - have turned off security!!

    help please - I can't update my ipad software as always get network connections issues - have turned off security!!

    I would try updating through a computer. Just make sure that your computer has the latest itunes

  • Hi i want to upgrade my iMac from Snow Leopard 10.6.8 to OS X Mavericks or OS X Yosemite. My software update menu dosnn´t find any updates available. Help please, what can i do to upgrade to OS X Mavericks or newer version?

    Hi i want to upgrade my iMac from Snow Leopard 10.6.8 to OS X Mavericks or OS X Yosemite. My software update menu dosnn´t find any updates available. Help please, what can i do to upgrade to OS X Mavericks or newer version?

    Open the Mac App Store and try downloading Yosemite. If you get told it's incompatible, the computer's also incompatible with Mountain Lion and Mavericks; if desired, choose About this Mac from the Apple menu, check if the computer has at least a Xeon or Core 2 Duo(not Core Duo) CPU and 2GB of RAM, and if it does, click here and order a download code for Lion 10.7.
    Back up your data and check your applications for compatibility before upgrading. In particular, Mac OS X 10.7 and newer don't support PowerPC programs such as versions of Microsoft Office prior to 2008.
    (123636)

  • Help please what can i do i have a apple id that i have had scince i was in year 6 i have recently been unable to buy music or apps unless they are free because it asks for these security questions that i have no idea what the awnser is

    help please what can i do i have a apple id that i have had scince i was in year 6 i have recently been unable to buy music or apps unless they are free because it asks for these security questions that i have no idea what the awnser is help me please

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then the steps half-way down this page should let you reset them : http://support.apple.com/kb/HT5312
    If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then you will need to contact iTunes Support / Apple to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the HT5312 link above to add a rescue email address for potential future use

  • I made a dumb decision to 'Erase Free Space' on my drive. I now have no free space, I realize because it wrote 0's over all my free space. Is there a way to undo this??? Help please I can't save any documents now! Thanks in advance all, it is truly apprec

    I made a dumb decision to 'Erase Free Space' on my drive. I now have no free space, I realize because it wrote 0's over all my free space. Is there a way to undo this??? Help please I can't save any documents now! Thanks in advance all, it is truly appreciated. how can find the hidden temporary files using the terminal what do i type in?

    It's more likely a failed Erase Free Space, which creates a huge temporary file; that's why it looks like you have no more available drive space. You can recover from this. See these links
    https://discussions.apple.com/message/10938738#10938738
    http://www.macgeekery.com/tips/quickie/recovering_from_a_failed_secure_erase_fre e_space 
    Post back if you need any help with this.

  • I am residing in India and have purchased Ipad 3 from US, I have lost my invoice and also the small pin which helps in inserting sim card, Can anyone help me how can I get a copy of duplicate invoice from India and a PIN for my Ipad 3

    Dear Friends,
    I have purchased Ipad 3 from the US but unfortunately while returning back to India I have lost in transit the copy of Invoice and a tiny PIN which helps in inserting 3G card.
    Can anyone help me how can I get the duplicate copy of my invoice and an extra PIN from India and whether any Apple Store in India can issue me the duplicate copy of Invoice for the product purchased from US and also are the require to issue me an extra PIN on request.
    Thanking you all in anticipation....
    Regards,
    Bankim Mehta

    You can use a paper clip instead of the PIn that came with the iPad.
    http://support.verizonwireless.com/clc/devices/knowledge_base.html?id=54813
     Cheers, Tom

Maybe you are looking for