Announcement

Collapse
No announcement yet.

Collada models with lighting

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    OBJ Loader Works For Me With NASA 2.0 Release

    He guys,

    Thanks for this thread. It saved my bacon.

    I successfully used robotfire's OBJ loader in the unmodified WW 2 drop. That is, with JOGL 2.1; not the fork where the WW 2 code was modified for JOGL 2.3.

    Works like a champ. Took a very short time to integrate. I only needed the OBJ loader, so it was 4 files. Very understandable.

    I owe you a beer, robotfire. At least one. Maybe a case or three.

    Thanks.

    Comment


    • #17
      Do you have any examples of the files you've gotten to work? I tried a few different models, but only one loaded. Also, it looks like you have to have some textures for it be able to load? I'm trying to figure out why some models will work, but others won't.

      Comment


      • #18
        Originally posted by cliebl View Post
        Do you have any examples of the files you've gotten to work? I tried a few different models, but only one loaded. Also, it looks like you have to have some textures for it be able to load? I'm trying to figure out why some models will work, but others won't.
        I can send you a file that works for me. How is the best way? I think my profile contains my email address so you can send me a private message as to how to get you the file. The OBJ and DAE files together are 2.4 MB zipped.


        Mine do not have textures, although that free Collada -> Wavefront converter that robotfire mentioned creates a texture folder. Mine have "materials", so there are 2 files.

        -reilly.

        Comment


        • #19
          Got it working! That open3mod app did the trick. Exporting an OBJ out of Cinema 4D doesn't seem to create a material file, so that was some of it. Moreover, some other models even with material and textures like that Blackhawk model in the thread didn't work until I loaded it into open3mod and exported back out as OBJ. Thanks for pointing that out!

          Comment


          • #20
            I noticed that my model worked when I exported it as obj from Blender as well. Also, the parser doesn't like files with spaces in it. Any files specified in the material file should have the spaces removed for the current parser to work.

            Comment


            • #21
              FWIW, I added the ability to draw a bbox for selection purposes and to load models from the classpath to RobotFire's loader:
              https://github.com/rrr6399/WorldWindObj

              Comment


              • #22
                Originally posted by cliebl View Post
                Got it working! That open3mod app did the trick. Exporting an OBJ out of Cinema 4D doesn't seem to create a material file, so that was some of it. Moreover, some other models even with material and textures like that Blackhawk model in the thread didn't work until I loaded it into open3mod and exported back out as OBJ. Thanks for pointing that out!
                The lack of material file would only be a problem if the OBJ says there is one but it can't be found.

                In playing around, we have found that open3mod doesn't work 100% of the time. For my team's purposes, we always export with 3DS Max, and that has worked every time. I bet Blender consistently works as well, but I can't say for sure. Ultimately, we would want to just fix bugs in the loader so no matter where the OBJ is written from (assuming it's formatted correctly), it won't break. I don't have time to do that for my team, but hopefully as a community we could get there.

                Also, I looked at the Collada loader in World Wind. I don't think it would be terribly hard to use that Collada parser with some modified code that's similar to the OBJ loader. Maybe some people would benefit from that approach, if anybody had time to give it a shot. Then you could have lighting, faster loading, etc, and not have to worry about redoing all your models.

                Comment


                • #23
                  robotfire,wobster - I have a clone of WWJ 2.1 (https://github.com/pcmehlitz/WorldWindJava-pcm), which mostly serves the purpose of publishing WWJ as a library on Maven Central, using the current JOGL and gdal versions as normal 3rd party dependencies (i.e. not re-distributed). Are you Ok with adding the code from wobsters repo to my WWJ clone so that it is part of my Maven Central artifact? If so, can you please tell me what license/copyright header and package names you would like me to use? Would you also be fine with using the NOSA license so that it stays compatible with the rest of WWJ? I am not affiliated with the WWJ project, but still want to stay as close and compatible as I can.

                  The ObjLoader works well for me and since it is so little code with such a generic purpose I don't think it warrants a separately published jar and its binary availability would simplify a lot of projects. However, please let me know if you changed/extended the code beyond what is on https://github.com/rrr6399/WorldWindObj, and/or you would prefer to publish it as a separate artifact.

                  Comment


                  • #24
                    pcmehlitz, sounds good to me. The more people use it, the more they might be inspired to find and fix bugs. You can put whatever header you want on it.

                    Comment


                    • #25
                      you can find it as part of https://github.com/pcmehlitz/WorldWindJava-pcm.git under src/osm/map/worldwind/gl/
                      Please note there are some minor changes that

                      * make ObjRenderable fields protected so that derived classes can access them
                      * propagate ObjLoader exceptions so that callers can handle them (e.g. for missing files)
                      * support gzipped *.obj files in ObjLoader

                      I make use of the library in https://github.com/NASARace/race.git, which has a config/local/aircraft-ww-model.conf example that renders a simulated airplane with an ObjRenderable if you zoom in closely enough (<2000m, use <alt> modifier key for small increment zoom)

                      Comment


                      • #26
                        Tested the OBJ Loader. It works great and I don't need the hole Ardor3D Project with all the problems getting it to work with the Jogl version used in WW. Thank's!!!!

                        Comment


                        • #27
                          Tested the OBJ Loader. It works great and I don't need the hole Ardor3D Project with all the problems getting it to work with the Jogl version used in WW. Thank's!!!!

                          Comment


                          • #28
                            ObjLoader worked and it is faster and better than JOGLUtils and Ardor3D. Thanks.

                            Comment

                            Working...
                            X