Importing a .3ds file --- Can anyone help please

Here is a world i have written in java 3d
I can import a .obj file into this world but i want to import a file called Flipp.3ds but it keeps giving me an error
Here is the complete class ..... Can anyone help
Im pretty new to java 3d
import java.io.*;
import com.sun.j3d.utils.behaviors.vp.*;
import java.net.URL;
import java.net.MalformedURLException;
import javax.media.j3d.*;
import javax.vecmath.*;
import java.awt.*;
import java.awt.event.*;
import com.sun.j3d.utils.behaviors.keyboard.*;
import com.sun.j3d.utils.geometry.*;
import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.event.*;
import java.awt.GraphicsConfiguration;
import com.sun.j3d.utils.applet.MainFrame;
import com.sun.j3d.utils.geometry.*;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.image.*;
import com.sun.j3d.loaders.objectfile.ObjectFile;
import com.sun.j3d.loaders.ParsingErrorException;
import com.sun.j3d.loaders.IncorrectFormatException;
import com.sun.j3d.loaders.Scene;
import javax.vecmath.*;
public class Assign2 extends Frame implements ActionListener {
     protected Canvas3D myCanvas3D = new Canvas3D(null);
     protected Button exitBt = new Button("Exit");
        protected BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
     private boolean spin = true;
     private double creaseAngle = 60.0;
        private String filename;
// Lights
       * This adds a continuous background sound to the branch group.
       * @param b BranchGroup to add the sound to.
       * @param soundFile String that is the name of the sound file.
     protected void addBackgroundSound (BranchGroup b,String soundFile) {
         //Create a media container to load the file
          MediaContainer droneContainer = new MediaContainer(soundFile);
          //Create the background sound from the media container
          BackgroundSound drone = new BackgroundSound(droneContainer,1.0f);
          //Activate the sound
          drone.setSchedulingBounds(bounds);
          drone.setEnable(true);
          //Set the sound to loop forever
          drone.setLoop(BackgroundSound.INFINITE_LOOPS);
          //Add it to the group
          b.addChild(drone);
      protected void addLights(BranchGroup b) {
          Transform3D dirLightsXfm = new Transform3D();
          dirLightsXfm.set(new Vector3d(-1.5,0.0,0.0));
                   TransformGroup dirLights = new TransformGroup(dirLightsXfm);
          dirLights.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
          dirLights.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
                   // Create a bounds for the background and lights
                 // Set up the global lights
          Color3f ambLightColour = new Color3f(1.0f, 1.0f, 0.4f);
          AmbientLight ambLight = new AmbientLight(ambLightColour);
                 ambLight.setInfluencingBounds(bounds);
                 Color3f dirLightColour = new Color3f(0.0f, 1.0f, 0.0f);
                 Vector3f dirLightDir  = new Vector3f(-1.0f, -1.0f, -1.0f);
                 DirectionalLight dirLight = new DirectionalLight(dirLightColour, dirLightDir);
                 dirLight.setInfluencingBounds(bounds);
          dirLights.addChild(ambLight);
                 dirLights.addChild(dirLight);
        b.addChild(dirLights);
        if (spin)
          {     Transform3D yAxis = new Transform3D();
               Alpha rotationAlpha = new Alpha(-1, Alpha.INCREASING_ENABLE,
                                               0, 0,
                                               1500, 0, 0,
                                               0, 0, 0);
               //attach to lights
               RotationInterpolator rotator =
                    new RotationInterpolator(rotationAlpha, dirLights, yAxis,
                                               0.0f, (float) Math.PI*2.0f);
               rotator.setSchedulingBounds(bounds);
               b.addChild(rotator);
// Content Branch
      protected BranchGroup buildContentBranch() {
          //Create the appearance for the cube
          Appearance app1 = new Appearance();
                    Appearance app2 = new Appearance();
                  Color3f ambientColour1 = new Color3f(0.0f,0.0f,1.0f);
                    Color3f ambientColour2 = new Color3f(0.0f,0.0f,0.0f);
                    Color3f emissiveColour = new Color3f(0.0f,0.0f,0.0f);
                       Color3f specularColour = new Color3f(1.0f,1.0f,1.0f);
                   Color3f diffuseColour1 = new Color3f(1.0f,1.0f,0.0f);
                    Color3f diffuseColour2 = new Color3f(1.0f,1.0f,0.0f);
                   float shininess = 10.0f;
        app1.setMaterial(new Material(ambientColour1,emissiveColour,diffuseColour1,specularColour,shininess));
          app2.setMaterial(new Material(ambientColour2, emissiveColour,diffuseColour2,specularColour,shininess));
                //import the object...
          filename = "Flipp.max";
          int flags = ObjectFile.RESIZE;
          ObjectFile f = new ObjectFile(flags,
                 (float)(creaseAngle * Math.PI / 180.0));
               Scene s = null;
               try {
                 s = f.load(filename);
               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 contentBranch = new BranchGroup();
          addLights(contentBranch);
          //Position the Woman
          Transform3D groupXfm = new Transform3D();
          groupXfm.set(new Vector3d(0.0,0.0,0.0));
        TransformGroup group = new TransformGroup(groupXfm);
        group.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
          group.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
          // Adding to the Content Branch
          group.addChild(s.getSceneGroup());
          contentBranch.addChild(group);
          BoundingSphere movingBounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 300.0);
          BoundingLeaf boundLeaf = new BoundingLeaf(movingBounds);
          KeyNavigatorBehavior keyNav = new KeyNavigatorBehavior(group);
                    keyNav.setSchedulingBounds(movingBounds);
                    group.addChild(keyNav);
          Transform3D floorXfm = new Transform3D();
          floorXfm.set(new Vector3d(0.0,-1.5,-1.4));
        TransformGroup floor = new TransformGroup(floorXfm);
          floor.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
          floor.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
        Box theFloor = new Box(3.0f,0.0f,3.0f,app2);
        floor.addChild(theFloor);
        contentBranch.addChild(floor);
          return contentBranch;
// View Branch
     protected BranchGroup buildViewBranch(Canvas3D c) {
          BranchGroup viewBranch = new BranchGroup();
          Transform3D viewXfm = new Transform3D();
                 viewXfm.set(new Vector3f(0.0f,0.0f,10.0f));
          TransformGroup viewXfmGroup = new TransformGroup(viewXfm);
          viewXfmGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
          viewXfmGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
          BoundingSphere movingBounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 300.0);
          BoundingLeaf boundLeaf = new BoundingLeaf(movingBounds);
          ViewPlatform myViewPlatform = new ViewPlatform();
          viewXfmGroup.addChild(boundLeaf);
          PhysicalBody myBody = new PhysicalBody();
            PhysicalEnvironment myEnvironment = new PhysicalEnvironment();
          viewXfmGroup.addChild(myViewPlatform);
          viewBranch.addChild(viewXfmGroup);
          View myView = new View();
          myView.addCanvas3D(c);
          myView.attachViewPlatform(myViewPlatform);
                 myView.setPhysicalBody(myBody);
                 myView.setPhysicalEnvironment(myEnvironment);
          return viewBranch;
// Exit Button - dispose of system
     public void actionPerformed(ActionEvent e) {
               dispose();
               System.exit(0);
        public Assign2() {
          VirtualUniverse myUniverse = new VirtualUniverse();
          Locale myLocale = new Locale(myUniverse);
                myLocale.addBranchGraph(buildViewBranch(myCanvas3D));
                myLocale.addBranchGraph(buildContentBranch());
          setTitle("John (Sean) Gleeson 100437719");
          setSize(600,600);
          setLayout(new BorderLayout());
          Panel bottom = new Panel();
          bottom.add(exitBt);
                add(BorderLayout.CENTER, myCanvas3D);
                add(BorderLayout.SOUTH, bottom);
                exitBt.addActionListener(this);
                setVisible(true);
     public static void main(String[] args) {
                  Assign2 demo = new Assign2();
}Thanks,
Sean

You should repost in the 3D forums (just below this one). We are simple 2D folk :)

Similar Messages

  • I have imported a Zip file, mp3 music to desktop. How do I move it into iTunes?? I have tried drag/drop, import to library, both without success. Can anyone help, please.

    I have imported a Zip files, mp3 music to my Desktop. How do I move it into iTunes. I have tried d/drop and also Import to Library without success. Can anyone help, please?

    Many thanks to Limnos and King Penguin.
    I have discovered! I needed software to Unzip and was directed to Stuffit from the App Store. Suddenly it is simple.
    Download Zip File to Desktop.
    rt>  Zip        >Open with.....     >Stuffit     Progress Bar: 'Expanding' follows. Then a blue folder (manilla) returns to Desktop.
    Open iTunes     >File     >Import to Library      From drop down select  the now expanded contents of Zip file, then     >OPEN    
    iTunes takes over and imports -  Job's Done!! 
    Thanks again

  • IMovie imports only about 75% of the lenght of clips from my camcorder, I can`t find out how to import entire clips. can anyone help please?

    iMovie imports only about 75% of the lenght of clips from my camcorder, I can`t find out how to import entire clips. can anyone help please?

    '''''"... I have about 20 bookmark folders and about 100 bookmarks altogether. " '''''
    Firefox doesn't store bookmarks like that, sound like a Windows / IE favorites scheme used for '''''url''''' files and folders which isn't directly compatible with the way Firefox does things. Firefox uses a '''json''' file for bookmark backups, a '''bookmarks.html''' for import and export is bookmarks, and stores the users bookmarks in the '''places.sqlite''' file, along with browsing history.
    Put those folders and bookmarks in the '''\user\Favorites\''' folder so they are in IE and export your IE Favorites in HTML format, so you can import them into Firefox.
    In IE:
    File > Import/Export - Export to HTML file
    ''then in Firefox:'' <br />
    Bookmarks > Show All Bookmarks -> Import & Backup - Import HTML... = From HTML file

  • I need to export a photo at around 1meg file size,and dont seem to be able to do it in the presets can anyone help please ,I shoot on a canon 5d

    I need to export a photo at around 1meg file size,and dont seem to be able to do it in the presets can anyone help please ,I shoot on a canon 5d

    I believe Frank is referring to the end use (e.g., for print or on-screen use).
    Until he returns, I can tell you that I ran a quick test using an image from the Aperture 3 training book library which was as follows:
    Camera = Canon EOS 5D Mark II
    Master resolution = 5616 x 3744 (21 MP)
    I was able to export to a JPEG with end file size of 1 MB as follows:
    Export Presets drop-down > select 'Edit' option
    Selected preset name 'JPEG - 50% of Original Size' > change percentage value to 40% > change DPI value to '300' > click OK to set as current default > Export version to desktop.
    The exported JPEG has a resolution of 2246 x 1498 and appears on screen to have the same image quality of the original in Aperture.
    Note - I did not change the default Image Quality slider in the Export Preset dialog (which left it at 10).
    Basically, you will need to play around with the settings until you find the appropriate values to arrive at an image version you want.

  • I have uninstalled everything on my laptop, removed all my files to my external device and my laptop is still incredibly slow when opening any of the adobe applications, can anyone help please?

    I have downloaded the adobe student suite and whenever I open any of the adobe applications my laptop is incredibly slow, I cannot use any other application at the same time and often have to force quit. I have taken all my files off my laptop and added to my external hardrive. Can anyone help please?

    What about other non-Adobe programs on the machine - do they also run slowly?
    What are your system specifications?  How do they match up to the system requirements for the software?

  • Why can't I download from kuler, my computer doesn't recognise the .ase files its says its an unknown format, can anyone help please.  Thanks?

    why can't I download from kuler, my computer doesn't recognise the .ase files its says its an unknown format, can anyone help please?

    why can't I download from kuler, my computer doesn't recognise the .ase files its says its an unknown format, can anyone help please?

  • I backup to an external hdd with Time Machine, when it ran out of space it did not delete old backups, now my internal hdd says its full when before it had heaps of space. I have searched for extra files but cant find any. Can anyone help, please.

    I backup to an external hdd with Time Machine, when it ran out of space it did not delete old backups, now my internal hdd says its full when before it had heaps of space. I have searched for extra files but cant find any. Can anyone help, please.

    First, empty the Trash if you haven't already done so. Then reboot. That will temporarily free up some space.
    To locate large files, you can use Spotlight as described here. That method may not find large folders that contain a lot of small files.
    You can also use a tool such as OmniDiskSweeper (ODS) to explore your volume and find out what's taking up the space. You can delete files with it, but don't do that unless you're sure that you know what you're deleting and that all data is safely backed up. That means you have multiple backups, not just one.
    Proceed further only if the problem hasn't been solved.
    ODS can't see the whole filesystem when you run it just by double-clicking; it only sees files that you have permission to read. To see everything, you have to run it as root.
    Back up all data now.
    Install ODS in the Applications folder as usual.
    Triple-click the line of text below to select it, then copy the selected text to the Clipboard (command-C):sudo /Applications/OmniDiskSweeper.app/Contents/MacOS/OmniDiskSweeper
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    I don't recommend that you make a habit of doing this. Don't delete anything while running ODS as root. If something needs to be deleted, make sure you know what it is and how it got there, and then delete it by other, safer, means.
    When you're done with ODS, quit it and also quit Terminal.

  • I have just got a Nikon D810 but CC wont open my raw file, can anyone help me please?

    I have just got a Nikon D810 but CC wont open my raw file, can anyone help me please?

    Ah ok shall try that now, thank you very much for your help

  • When I back up my Mac Book Pro to an external hard drive not all files are backed up. Can anyone help please?

    When I try to back up my Mac Book Pro to an external hard drive some of the files are backed up but not all files are backed up. I don't understand. Can anyone help please?

    I've used time machine in the past and couldn't get to the bottom of the problem so I've recently downloaded and am using carbon copy cloner and I get the same problem. The files that are missing are just word and number documents. Seems so odd.
    Thanks for replying
    John

  • Corrupt Catalog Files. Can anyone help please?

    My computer shut down unexpectedly, and now Lightroom 5 is giving me and message stating Corrupt Catalog Files. When I try to repair as suggested it says it has encountered problems reading or writing from discs when attempting to repair. Can anyone help please?

    How recent is your backup?

  • Hi I can't see audiobooks on my library options? can anyone help please?

    Hi I copied my library to a hard disc and pointed iTunes to it via preferences and the audio books option doesn't now seem to exist in library. The audio books are still there, i can see the file if i go in though finder.
    Can anyone help please?

    Hello Paul and Claire,
    You want to drag that folder on top of iTunes to import it in. It will go through the import process again and should sort that out for you. I know the article below is for iTunes 11 but it is the same for the latest version of iTunes. 
    iTunes 11 for Mac: Import music and video already on your computer
    http://support.apple.com/kb/PH12285
    Regards,
    -Norm G.  

  • When I try to reset my iPad mini it keeps asking for  a passcode! have tried restoring, connecting to iTunes and looked for the 'set up as new iPad' notification, but nothing is working? can anyone help please?

    I know my passcode is correct but when I try to reset my iPad mini it keeps asking for  a passcode! have tried restoring, connecting to iTunes and looked for the 'set up as new iPad' notification, but nothing is working? can anyone help please?

    If the iPad was running iOS 7,  iCloud: Find My iPhone Activation Lock in iOS 7
    http://support.apple.com/kb/HT5818
    How can I unlock my iPad if I forgot the passcode?
    http://www.everymac.com/systems/apple/ipad/ipad-troubleshooting-repair-faq/ipad- how-to-unlock-open-forgot-code-passcode-password-login.html
    iOS: Device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    How can I unlock my iPad if I forgot the passcode?
    http://tinyurl.com/7ndy8tb
    How to Reset a Forgotten Password for an iOS Device
    http://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Device
    Using iPhone/iPad Recovery Mode
    http://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htm
    Saw this solution on another post about an iPad in a school environment. Might work on your iPad so you won't lose everything.
    ~~~~~~~~~~~~~
    ‘iPad is disabled’ fix without resetting using iTunes
    Today I met my match with an iPad that had a passcode entered too many times, resulting in it displaying the message ‘iPad is disabled – Connect to iTunes’. This was a student iPad and since they use Notability for most of their work there was a chance that her files were not all backed up to the cloud. I really wanted to just re-activate the iPad instead of totally resetting it back to our default image.
    I reached out to my PLN on Twitter and had some help from a few people through retweets and a couple of clarification tweets. I love that so many are willing to help out so quickly. Through this I also learned that I look like Lt. Riker from Star Trek (thanks @FillineMachine).
    Through some trial and error (and a little sheer luck), I was able to reactivate the iPad without loosing any data. Note, this will only work on the computer it last synced with. Here’s how:
    1. Configurator is useless in reactivating a locked iPad. You will only be able to completely reformat the iPad using Configurator. If that’s ok with you, go for it – otherwise don’t waste your time trying to figure it out.
    2. Open iTunes with the iPad disconnected.
    3. Connect the iPad to the computer and wait for it to show up in the devices section in iTunes.
    4. Click on the iPad name when it appears and you will be given the option to restore a backup or setup as a new iPad (since it is locked).
    5. Click ‘Setup as new iPad’ and then click restore.
    6. The iPad will start backing up before it does the full restore and sync. CANCEL THE BACKUP IMMEDIATELY. You do this by clicking the small x in the status window in iTunes.
    7. When the backup cancels, it immediately starts syncing – cancel this as well using the same small x in the iTunes status window.
    8. The first stage in the restore process unlocks the iPad, you are basically just cancelling out the restore process as soon as it reactivates the iPad.
    If done correctly, you will experience no data loss and the result will be a reactivated iPad. I have now tried this with about 5 iPads that were locked identically by students and each time it worked like a charm.
    ~~~~~~~~~~~~~
    Try it and good luck. You have nothing more to lose if it doesn't work for you.
     Cheers, Tom

  • Btinternet has changed since 21st Nov and it no longer works on the ipad. Can anyone help please?

    Can anyone help please, btinternet have changed their servers on e mail since 21st Nov and I can no longer send or receive e mails. BT say set to the following but I cannot get it to work, any suggestions please.
    Go to your iPhone/iPad home screen and tap Settings.
    Scroll down to Mail, Contacts, Calendars.
    Tap Add Account.
    Scroll down and tap Other.
    Tap Add Mail Account.
    Put the name you want people to see when they get mail from you in the Name field.
    Enter your BT Business username in the Address field. For example, [email protected] or, where you have registered a custom domain, [email protected]
    Enter your BT Business password in the Password field.
    In the Description field enter the name you want to use to identify the account.
    Tap Next. If you get an error message at this point, tap OK.
    Make sure that POP is selected at the top of the screen.
    In the Incoming Mail Server section, change the Host Name to pop.outlook.com.
    Scroll down to the Outgoing Mail Server section and change the Host Name to smtp.outlook.com.
    Tap Save.

    Hello Kitty Galore,
    It sounds like your your photos that you take on your phone are not showing in your iPad Photo Stream.
    I would check both devices to make sure that they both have Photo Stream turned on in the iCloud settings.
    iCloud: My Photo Stream FAQ
    http://support.apple.com/kb/HT4486
    How do I turn on My Photo Stream?
    After your devices are up-to-date and you have set up your iCloud account, it’s easy to turn on My Photo Stream on any of your devices:
    iOS devices: Go to Settings > iCloud > Photos (Photo Stream in iOS 6), then turn on My Photo Stream.
    Mac: Go to System Preferences > iCloud, then select the checkbox for Photo Stream. Click the Options button and verify that the My Photo Stream checkbox is selected. Open the application you want to use with Photo Stream (iPhoto or Aperture) and confirm that My Photo Stream is turned on in that application. You can also adjust your my Photo Stream settings in iPhoto or Aperture Preferences.
    If it is enabled, then I would check to make sure Automatic Upload is enabled with this article:
    iCloud: My Photo Stream troubleshooting
    http://support.apple.com/kb/TS3989
    I imported photos to iPhoto or Aperture from my camera, but I do not see them uploaded to the My Photo Stream album, though the service is enabled.
    In iPhoto or Aperture, navigate to Preferences > Photo Stream. Ensure that Automatic Upload is enabled under My Photo Stream and that you have an active Wi-Fi or Ethernet connection.
    If Automatic Upload is not enabled, you can either enable it and import again, or manually add the newly imported photos to My Photo Stream in iPhoto or Aperture by dragging them into the My Photo Stream album in your Library.
    Cheers,
    Sterling

  • How can I edit my website from another computer? and how can I create a new website next to the one, I have already? Can anyone help, please?

    How can I edit my website from another computer? and how can I create a new website next to the one, I already have? Can anyone help, please?

    Move the domain.sites file from one computer to the other.
    The file is located under User/Library/Application Support/iWeb/domain.sites.  Move this file to the same location on the other computer and double click and iWeb will open it.  Remember, it is your User Library that you want and not your System Library, as you will not find iWeb there.
    Just create a new site on the same domain file and it will appear below the other site.  If you want them side by side then duplicate your domain file and have one site per a domain file and they can then be side by side.

  • Since having installed Yosemite my adobe acrobat X crashs as soon as I want to open a file, can anyone help on this issue?

    Since having installed Yosemite my adobe acrobat X crashs as soon as I want to open a file, can anyone help on this issue?

    Please try the steps below and let me know if it worked for you
    Delete all the files from following folders:
    [Home]/Library/Application Support/Adobe/SLStore
    [Home]/Library/Application Support/Adobe/SLCache
    And, delete all files from following folder except cache.db
    [Home]/Library/Application Support/Adobe/AdobePCD
    Then launch Acrobat and try to activate and check.
    Regards,
    Rave

Maybe you are looking for

  • Cannot open ddms.bat on android sdk because Java is not in my path

    I'm trying to open the ddms.bat (Dalvik Debug Monitor) but it won't let me because Java is not in my path. Some things you should know: 1. I barely know what I'm talking about so please walk me through any advice you give me, I'm brand new to all of

  • Switching from OS to Windows

    I own an 80gB iPod classic that I used to sync with a Mac. I have recently lost access to the Mac and have had to back to using my laptop with windows XP. I can't sync it because that would involve having to format my iPod and therefore lose all my l

  • How to bindmodel values to calendar in sap.me

    I want to bind values to calendar. (i.e) i want to show the scheduled dates in calendar. How to do dat?? I used overlap calendar but its view is single row. I want the view of one month with scheduled date as shown in attached image Thanks in advance

  • N- step SC Approval Workflow

    Hi Experts, I'm new to SRM. We have requirment for N-Level Approvals Sequentially at item based for the SC . The Approval Level needs to be determined dynamically , by comparing the Total value of the SC with the Approval limit maintined in the Custo

  • How to load 2 sub on QuickTime?

    Hi mac experts how how, really how? I will appreciate for help this and i have bad language for load persian(farsi) sub on QT how fix it ? for end how load 2 sub (EN&PN) on QT Simultaneously tanx tanx tanx