Java 3D with .obj files

Hi,
I'm pretty new to Java3D and so on a bit of an unphill struggle right now. I am trying to load a 3d obj file (that i created myself) into my program. It is a simple boat with a sail and a hull, I am trying to animate these parts of the object separately.
I have added the two different components to seperate TransformGroups (one called "boat" one called "sail") and the sail is a child of boat. I can move the boat around with my mouse, but when i try and rotate the sail (using .rotY(20D)) the sail rotates from the centre of its location in the object (i.e it moves away from the mast)
so my question is, how do i rotate this part of the object from one side only? is there a way to find out the length of it? then i could use the rotate "around the corner" method possibly.
Any help or theories on how to do this would be greatly appreciated - as i said, i'm trying to learn the basics so i can get on to some trickier things, and seem to be hitting hurdle after hurdle!.
thanks

hi,
j3d supports these file formats:
3DS 3D-Studio
COB Caligari trueSpace
DEM Digital Elevation Map
DXF AutoCAD Drawing Interchange File
IOB Imagine
LWS Lightwave Scene Format
NFF WorldToolKit NFF format
OBJ Wavefront
PDB Protein Data Bank
PLAY PLAY
SLD Solid Works (prt and asm files)
VRT Superscape VRT
VTK Visual Toolkit
WRL Virtual Reality Modeling Language
for more info look at j3d tutorial, chapter 3, section 3.2. the .obj loader in j3d is not a full implementation of the file format, but you can extend it (it's possible to add colors in j3d program directly or extend the loader) and add what you need or you can write your own loader. i recommend to search the web for better implementation of obj. file loader written in java.

Similar Messages

  • Whats is the the problem with OBJ files in Photoshop CC 2014?

    What is up my fellow adobinites"!? Well I want to start off with, "I Have A Dilemma". When I open a .obj file in Photoshop CC 2014 There is an error every time but in reaction to the outcome, I torrented Photoshop Cs6 for educational and testing purposes and it worked flawlessly. It was the "Plus" version so yeah. Also the .obj file worked in After Effects CC 2014 and on the other hand I think Photoshop just got 3d features in I am correct.
    Also if you have any obj file websites please teem me. I will love you for ever.

    Process:         Adobe Photoshop CC 2014 [435]
    Path:            /Applications/Adobe Photoshop CC 2014/Adobe Photoshop CC 2014.app/Contents/MacOS/Adobe Photoshop CC 2014
    Identifier:      com.adobe.Photoshop
    Version:         ???
    Code Type:       X86-64 (Native)
    Parent Process:  launchd [187]
    Responsible:     Adobe Photoshop CC 2014 [435]
    User ID:         501
    Date/Time:       2014-09-12 23:50:23.045 -0400
    OS Version:      Mac OS X 10.9.4 (13E28)
    Report Version:  11
    Anonymous UUID:  1CB21A1B-9929-377B-BB77-969F8AD3E6DC
    Crashed Thread:  0
    Exception Type:  EXC_BREAKPOINT (SIGTRAP)
    Exception Codes: 0x0000000000000002, 0x0000000000000000
    Application Specific Information:
    dyld: launch, loading dependent libraries
    Dyld Error Message:
      Library not loaded: @executable_path/../Frameworks/amtlib.framework/Versions/A/amtlib
      Referenced from: /Applications/Adobe Photoshop CC 2014/Adobe Photoshop CC 2014.app/Contents/MacOS/Adobe Photoshop CC 2014
      Reason: image not found
    Binary Images:
        0x7fff69eb7000 -     0x7fff69eea817  dyld (239.4) <042C4CED-6FB2-3B1C-948B-CAF2EE3B9F7A> /usr/lib/dyld
        0x7fff8aeda000 -     0x7fff8af28ff7  com.apple.opencl (2.3.59 - 2.3.59) <044485A4-A50C-34CE-A1F9-35A50CC68313> /System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL
    Model: MacBookPro10,1, BootROM MBP101.00EE.B03, 4 processors, Intel Core i7, 2.3 GHz, 8 GB, SMC 2.3f36
    Graphics: Intel HD Graphics 4000, Intel HD Graphics 4000, Built-In
    Graphics: NVIDIA GeForce GT 650M, NVIDIA GeForce GT 650M, PCIe, 1024 MB
    Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54333531533642465238432D50422020
    Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54333531533642465238432D50422020
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xEF), Broadcom BCM43xx 1.0 (5.106.98.100.22)
    Bluetooth: Version 4.2.6f1 14216, 3 services, 15 devices, 1 incoming serial ports
    Network Service: Wi-Fi, AirPort, en0
    Serial ATA Device: APPLE SSD SM256E, 251 GB
    USB Device: Backup+  Mac SL
    USB Device: Hub
    USB Device: FaceTime HD Camera (Built-in)
    USB Device: Hub
    USB Device: Hub
    USB Device: Apple Internal Keyboard / Trackpad
    USB Device: BRCM20702 Hub
    USB Device: Bluetooth USB Host Controller
    USB Device: USB Optical Mouse
    Thunderbolt Bus: MacBook Pro, Apple Inc., 23.4

  • Display problems with .OBJ files

    Hi everybody,
    I load some .OBJ files with the objectfile loader, it works good, but when I look at the objects, there's some polygons error : the display is not really good. When I use the zoom, the polygons seems to move : I think that there is a problem of z-ordering, because sometimes polygons which are behind, pass over front polygons...
    There's 2 links to see what I mean :
    First, normal view, I don't do any moves with the mouse : http://mfrac10.free.fr/GIF/Capture1.jpg
    Second, I rotate the model, and you can see that some hidden walls pass over others : http://mfrac10.free.fr/GIF/Capture2.jpg
    If somebody knows about this kind of problem, it would be very great !
    Thanks !

    Thank for your answer and sorry for the pictures, but if I zoom in on the buildings, the display errors disappear...
    The normals are not set properly, because those .obj files are from a .dxf where the normals are sometimes clockwised, sometimes anti-clockwised : the solution I use is on the .obj to enumerate points for a face on one way and on the other way (f 1 2 3 and f 3 2 1).
    With the mouse, I rotate the view : I use a custom Behavior, at the beginning to have many views, but now it's the same file as the one from the API.
    I repeat, but maybe it is important : when I am closed from an object, the default seems to disappear. It's when I go far from the objects that I see those defaults...

  • Anybody know how to use jave work with mapping file? help!

    mapping file are somehow those...
    <db-insert root-element>
    .....<map-info>
    something like that, and I dont know how java code can use with them..my database is mysql...
    or any reference site is good.?
    Thank you very much

    urm...thanks..
    my job is about to write a transformation tool to transform XML documents into a database. The tools is written for users to extract data in XML format and store it into a database. But i would choose MYSQL. Mapping files are used to store information correctly into database to avoid the need to write new code for each type of XML files. And can choose any programing langugage for implementation such as Java and C#.........and currently still looking on Java or VB

  • Java mail with attach file

    Hi , I need a example with java send mail can attach a file
    thnak you

    Hey cool... thanking you phdk. Ta.
    package krc.utilz;
    import java.util.Properties;
    import java.io.File;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.Message;
    import javax.mail.Multipart;
    import javax.mail.BodyPart;
    import javax.mail.MessagingException;
    import javax.mail.internet.MimeMessage;
    import javax.mail.internet.MimeMultipart;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.InternetAddress;
    import javax.activation.DataHandler;
    import javax.activation.FileDataSource;
    import javax.mail.PasswordAuthentication;
    public class Emailz
      private static class MyAuthenticator extends javax.mail.Authenticator {
        @Override
        protected PasswordAuthentication getPasswordAuthentication(){
          return new PasswordAuthentication("#########", "#########" ); // <<<<<<<<<<<<<<<<<<<
      private static final Properties props = new Properties();
      static {
        props.put("mail.smtp.host", "smtp.googlemail.com");
        props.put("mail.smtp.port", "465");
        props.put("mail.smtp.user", "########"); // <<<<<<<<<<<<<<<<<<<
        //props.put("mail.smtp.starttls.enable", "true");
        props.put("mail.smtp.auth", "true");
        props.put("mail.smtp.debug", "true");
        props.put("mail.smtp.socketFactory.port", "465");
        props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
        props.put("mail.smtp.socketFactory.fallback", "false");
      public static void send(String subject, String message, String from, File[] attachments, String... recipients)
        throws MessagingException
        Session session = Session.getDefaultInstance(props, new MyAuthenticator());
        session.setDebug(true);
        // head
        Message msg = new MimeMessage(session);
        msg.setFrom(new InternetAddress(from));
        InternetAddress[] addressTo = new InternetAddress[recipients.length];
        for (int i=0; i<recipients.length; i++) {
          addressTo[i] = new InternetAddress(recipients);
    msg.setRecipients(Message.RecipientType.TO, addressTo);
    msg.setSubject(subject);
    // body
    Multipart multipart = new MimeMultipart();
    // message
    BodyPart msgPart = new MimeBodyPart();
    msgPart.setText(message);
    multipart.addBodyPart(msgPart);
    // attachments
    for ( File attachment : attachments ) {
    MimeBodyPart attPart = new MimeBodyPart();
    attPart.setDataHandler(new DataHandler(new FileDataSource(attachment)));
    attPart.setFileName(attachment.getName());
    multipart.addBodyPart(attPart);
    msg.setContent(multipart);
    Transport.send(msg);
    public static void main(String[] args) {
    try {
    //send(String subject, String message, String from, File[] attachments, String... recipients)
    send(
    "Testing attachments" // subject
    , "This is an email with an attachment" // message
    , "########@gmail.com" // from // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    , new File[] {new File("C:/Java/home/src/krc/utilz/Emailz.java")} // attachments
    , "########@gmail.com" // to // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    } catch (Exception e) {
    e.printStackTrace();
    Cheers. Keith.

  • Distributing a java application with fewer files

    I'd like to distribute an application with the JRE but would like to reduce the number of files in the distribution. The JRE alone requires several JARs and other license files. Can the JRE be repackaged into a consolidated JAR with my application without breaking the licensing rules?
    thanks,
    Paul

    This does not sound like a Java problem. Go into your W7 control panel and make sure the ODBC driver is correct. Make a new DSN for your system and see if you can connect. You may have to reinstall the ODBC, it souds like something there is having a problem.

  • Java Webstart with Config Files

    Hi,
    Whats the best way to deploy a 3rd party jar program with a config file in the same dir level? Do I need to jar it all up into another jar again?
    Cheers,
    John.

    The normal practice qould be to jar up the config. file.
    You might jar it along qith the classes, but I
    would tend to give it a separate jar and simply
    add a call to the 'config.jar' to the resources
    element along with the main jar.

  • Use ProcessBuilder to execute a java program with a file piped as input

    Hi,
    I am trying to execute a java program passing in input file as argument. I have to do this by forking a process and am using Processbuilder.
    I have a main function which calls the executeCliTopologyDesigner method. I get a Java I/O exception
    Caught IOException: Cannot run program "$JAVA_HOME/bin/java oracle.apps.fnd.provisioning.cli.TopologyDesigner ": java.io.IOException: error=2, No such file or directory
    Can you please let me know if I am missing something?
    Thanks,
    pkrish
    Code Snippet:
    private synchronized void executeCliToplogyDesigner(String cliCommand, File tmp)
    throws IOException, InterruptedException
    {    File temp= writeDataInTemp(compDefName);
    cliCommand = "$JAVA_HOME/bin/java oracle.apps.fnd.provisioning.cli.TopologyDesigner ";
    ProcessBuilder pb = new ProcessBuilder(cliCommand,"<",temp.getCanonicalPath());
    executeProcess(pb);
    Edited by: pkrish on Mar 2, 2009 3:56 PM
    Edited by: pkrish on Mar 2, 2009 3:57 PM
    Edited by: pkrish on Mar 2, 2009 3:58 PM
    Edited by: pkrish on Mar 2, 2009 3:59 PM

    Hi,
    I printed out the system environment variables PATH and CLASSPATH and it is as below:
    Classpath :/ade/prprasa_prov_latest/fmwtest/tools/orajtst/home/lib/orajtst.jar:/ade/prprasa_prov_latest/jdev/src/abbot/dist/EXTENSIONS
    Path :/ade/prprasa_prov_latest/fxtn/util/tools/ant/bin:/ade/prprasa_prov_latest/fmwtest/tools/orajtst/home/bin:/ade/prprasa_prov_latest/oracle/jdeveloper/jdev/bin:/ade/prprasa_prov_latest/javahome/jdk/bin:/usr/kerberos/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/usr/local/ade/bin:/OracleProd/oracle10g/bin:/OracleProd/oracle10g/bin:/OracleProd/oracle10g/bin
    The Path does contain java.
    I changed my command as I need a different classpath.
    cliCommand = "/ade/prprasa_prov_latest/javahome/jdk/bin/java -classpath .:/ade/prprasa_prov_latest/oracle/provisioning/tools/lib/*:/ade/prprasa_prov_latest/oracle/provisioning/configframework/lib/*:/ade/prprasa_prov_latest/oracle/provisioning/framework/lib/*"
    Caught IOException: Cannot run program "/ade/prprasa_prov_latest/javahome/jdk/bin/java -classpath .:/ade/prprasa_prov_latest/oracle/provisioning/tools/lib/*:/ade/prprasa_prov_latest/oracle/provisioning/configframework/lib/*:/ade/prprasa_prov_latest/oracle/provisioning/framework/lib/*": java.io.IOException: error=2, No such file or directory
    Any ideas? Please let me know where do I post it if not here.

  • Collision with obj imported file problem....help!

    Hi .... excuse me for my english... i'm new....
    I have created a imported file with OBJ Loader.
    The geometry is modeled in Maya... is very complicated mesh.
    The problem is:.... when i walk on... the camera walking through the imported object!!
    Can I stop che camera when enter in collision with obj file??
    Thanks!!

    An applet is not allowed to write files.
    But you can use a signed applet.

  • Is there a way to import .obj files into Motion so that motion can see the object as a 3D object?

    I would like to import 3D objects with .obj file extensions into Motion. Is there a plug in or add on that allows you to do this? Is there any way of getting Motion to recognise 3D images? Other programs such as Adobe's After Effects (AE) achieves this easily and allows you to manipulate the image in 3D space.

    http://www.motionvfx.com/mplugs-33.html#1
    state-of-the-art plugin, just awesome!

  • Printing problem with ads on as java when printing large files

    hi all
    we have an wd for java application running on as java 7.0 sp18 and adobe document service if we print
    small files everything works fine with large files it fails with the following error (after arround 2 minutes)
    any ideas
    #1.5^H#869A6C5E590200710000092C000B20D000046E16922042E2#1246943126766#com.sap.engine.services.servlets_js
    p.server.HttpHandlerImpl#sap.com/tcwddispwda#com.sap.engine.services.servlets_jsp.server.HttpHandlerImp
    l#KRATHHO#8929##sabad19023_CHP_5307351#KRATHHO#63a60b106ab311de9cb4869a6c5e5902#SAPEngine_Application_Thr
    ead[impl:3]_15##0#0#Error#1#/System/Server/WebRequests#Plain###application [webdynpro/dispatcher] Process
    ing HTTP request to servlet [dispatcher] finished with error.^M
    The error is: com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.base.core.PDFDocumentRuntimeException:
    Failed to  UPDATEDATAINPDF^M
    Exception id: [869A6C5E590200710000092A000B20D000046E1692201472]#

    Hello
    on which support package level is the java stack  ?
    kr,
    andreas

  • Jar files download problems in Java Webstart with JRE 1.6

    We have encountered a few problems in Java Webstart with JRE 1.6
    In JRE 1.5, the jar files are getting downloaded onto the client
    machine with it's original names.
    Example :
    Server File Name : acm.jar
    Client File Name : RMacm.jar
    But in JRE 1.6, the jar files are getting downloaded with improper file names.
    Example :
    Server File Name : acm.jar
    Client File Name : 4fb074cc-66fc7407
    Moreover the path itself seems to be invalid.
    Example Path :
    JRE 1.5 path:
    C:\Documents and Settings\Administrator\Application
    Data\Sun\Java\Deployment\cache\javaws\https\D17.16.23.11\P443\DMtest\DMwebStart
    JRE 1.6 path:
    C:\Documents and Settings\Administrator\Application
    Data\Sun\Java\Deployment\cache\6.0\12
    Due to this, we are facing Classpath problems.
    What changes do we have to make to the code, for Java
    Webstart to work ?
    We are using JBoss 4.0.4 and JDK 1.5 in the Server
    On the client machine, we have IE 6 and JRE 1.6.01
    Help would be appreciated.

    Ask your Java Web Start question at:
    http://forum.java.sun.com/forum.jspa?forumID=38

  • Could java deal with shortcut/link files ?

    Hi all,
    We could often use the shortcut(.lnk) or link files on Windows or Unix.
    Could Java class deal with these files directly ? That is, could it got
    the target file of the shortcut link files? So that, we could use the target file exactly the same with other normal files.
    Any comments and help are welcome. Thanks.
    -GeorgeZ.

    Be aware that MS .lnk files are extremely different from what you use in Unix. In Unix, the OS resolves links automatically, and the application never even knows they are there. In Windows, this is absolutely not the case, and it takes a bit of work to get the windows shell to tell you where the link is pointing.
    If you absolutely have to dereference .lnk files in Java you'll need to use JNI. The JNI interface will be the absolute easiest part of this, though. Getting a resolved .lnk in C++ is a major pain in the neck (about 50 lines of code).
    - K

  • How to generate Java objects from XML files with out  scema compilation

    Dear participants,
    My name is Raghavendra , i have a requirement of reading XML files Dynamically and parse them and create java types for manipulation . i will not be provided with sxd files (no schema compilation )coz no one knows how many types of structures are there. i want a generic solution. Please Help.
    Thanks ,
    Raghavendra Ach
    you can mail me to " [email protected]"

    georgemc wrote:
    You could also look at something like Apache Digester, which will parse your XML and populate Java objects with the data. A slightly steeper learning curve than the lower-level APIs such as JDOM, but that's outweighed by the lesser development effortdon't think that would work for the original problem, which seemed to indicate that the xml had an unknown structure.

  • JSP compilation failed with java.lang.IllegalStateException: zip file close

    Hi,
    I have a web app successfully deployed on Weblogic7.0 and HP UX 11.0, which uses jdk 1.3.1_02
    In this application, when i invoke a jsp (this exception occurs on any jsp not to any specific jsp), i found the following exception trace on wl-domain.log file and server crashes: -
    java.lang.IllegalStateException: zip file closed
         at java.util.zip.ZipFile.getEntry(Unknown Source)
         at weblogic.servlet.internal.WarClassFinder.getSource(WarClassFinder.java, Compiled Code)
         at weblogic.servlet.internal.WarClassFinder.getSource(WarClassFinder.java, Compiled Code)
         at weblogic.utils.classloaders.MultiClassFinder.getSource(MultiClassFinder.java, Compiled Code)
         at weblogic.utils.classloaders.MultiClassFinder.getSource(MultiClassFinder.java, Compiled Code)
         at weblogic.utils.classloaders.MultiClassFinder.getClassSource(MultiClassFinder.java, Compiled Code)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.upToDate(ChangeAwareClassLoader.java, Compiled Code)
         at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java, Compiled Code)
         at weblogic.servlet.internal.ServletStubImpl.checkForReload(ServletStubImpl.java, Compiled Code)
         at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java, Compiled Code)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java, Compiled Code)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java, Compiled Code)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java, Compiled Code)
         at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java, Compiled Code)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java, Compiled Code)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java, Compiled Code)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java, Compiled Code)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
    Can anyone help me in figuring out this problem urgently?
    thanks in advance
    manoj

    Hi Manoj.I am also getting the same problem in the weblogicserver version-6.1 SP2.It is also using the jdk 1.31.
    here is my stack trace.Help i smuch appreciated.!!
    java.lang.IllegalStateException: zip file closed
         at java.util.zip.ZipFile.getEntry(ZipFile.java:141)
         at weblogic.servlet.internal.WarClassFinder.getSource(WarClassFinder.java:197)
         at weblogic.servlet.internal.WarClassFinder.getSource(WarClassFinder.java:106)
         at weblogic.utils.classloaders.MultiClassFinder.getSource(MultiClassFinder.java:53)
         at weblogic.utils.classloaders.MultiClassFinder.getSource(MultiClassFinder.java:53)
         at weblogic.utils.classloaders.MultiClassFinder.getClassSource(MultiClassFinder.java:45)
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:265)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:156)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:65)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
         at org.exolab.castor.xml.Unmarshaller.unmarshal(Unknown Source)
         at org.exolab.castor.xml.Unmarshaller.unmarshal(Unknown Source)
         at org.exolab.castor.xml.Unmarshaller.unmarshal(Unknown Source)
         at com.slfc.framework.service.ServiceMessageFactory.createServiceResult(ServiceMessageFactory.java:58)
         at sunlife.nexus.admin.SecPro.establishSupportSession(Unknown Source)
         at sunlife.nexus.admin.Page_secPro_extAppLoader.processPageRequest(Unknown Source)
         at sunlife.wis.servlets.WISServlet.redirect(WISServlet.java:63)
         at sunlife.wis.servlets.WISServlet.doExec(WISServlet.java:107)
         at sunlife.wis.servlets.WISServlet.doGet(WISServlet.java:70)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2495)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2204)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

Maybe you are looking for