sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Is there a model exporter plugin that writes C++ files?

    Scheduled Pinned Locked Moved Plugins
    15 Posts 6 Posters 547 Views 6 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • OricAtmosO Offline
      OricAtmos
      last edited by

      @thomthom said:

      I don't quite understand the request.
      You want a 3d model written as a C++ file?

      Yes. πŸ˜„

      @unknownuser said:

      If so, would it not then depend in the data structure you use in your C++ app?

      I would use the data structures the exporter gave me. All I really needed would be some arrays with vertex, face and normal data for the given model. Then I could easily render the models with OpenGL. Face colors would be nice, but not really neccessary.

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        Why do you need C++ ?
        If you search for exporters there are several Ruby-based ones - for DXF, OBJ, STL, KML, CSV, TSV etc as well as the built-in ones...
        If you know the format you need and there isn't an existing one then see how it might be similar to an existing one and modify it... 'Binary' format files are NOT easy to write but 'text' based ones are... πŸ˜•

        TIG

        1 Reply Last reply Reply Quote 0
        • OricAtmosO Offline
          OricAtmos
          last edited by

          @tig said:

          Why do you need C++ ?

          Because it would be quick and easy.

          @unknownuser said:

          If you search for exporters there are several Ruby-based ones - for DXF, OBJ, STL, KML, CSV, TSV etc as well as the built-in ones...
          If you know the format you need and there isn't an existing one then see how it might be similar to an existing one and modify it... 'Binary' format files are NOT easy to write but 'text' based ones are... πŸ˜•

          I don't need any specific format, I just need to be able to use the models in my C++ program and render them with OpenGL. I could start looking for C++ libraries that import collada for example, because that's built-in. But experience tells me, getting to know my way around a new library can be a lot of work.

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            @oricatmos said:

            @thomthom said:

            I don't quite understand the request.
            You want a 3d model written as a C++ file?

            Yes. πŸ˜„

            @unknownuser said:

            If so, would it not then depend in the data structure you use in your C++ app?

            I would use the data structures the exporter gave me. All I really needed would be some arrays with vertex, face and normal data for the given model. Then I could easily render the models with OpenGL. Face colors would be nice, but not really neccessary.

            If you got C++ skills then I'd think there'd be little work for you to write a small ruby script that exports the model data the way you want. Ruby gives you all you just mentioned. And then you could easily output it in the exact format you want.

            Thomas Thomassen β€” SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • bigstickB Offline
              bigstick
              last edited by

              I'm told, by someone that knows a lot about this stuff, that C++ is 10x faster (or so) than Ruby for exporting geometry.

              1 Reply Last reply Reply Quote 0
              • OricAtmosO Offline
                OricAtmos
                last edited by

                @bigstick said:

                I'm told, by someone that knows a lot about this stuff, that C++ is 10x faster (or so) than Ruby for exporting geometry.

                I think there's a misunderstanding. I don't care whether the exporter is written in Ruby or in C++. I want the output to be C or C++ that I can compile in my C++ project. But since there doesn't seem to be an exporter like that, I'll have to write my own.

                1 Reply Last reply Reply Quote 0
                • Chris FullmerC Offline
                  Chris Fullmer
                  last edited by

                  You want the model to output as a text file that happens to be in C++ syntax, right? That is simple enough if you know C++, and you have your own syntax your are trying to tie into. But no one else would be able to write it for you very well, since no one else knows exactly how you would want to handle the C++ file structure.

                  OBJ is just a text file, for example. Why not just learn how to parse their structure instead of making up your own file structure?

                  Lately you've been tan, suspicious for the winter.
                  All my Plugins I've written

                  1 Reply Last reply Reply Quote 0
                  • thomthomT Offline
                    thomthom
                    last edited by

                    I'm sure there is a very simple light weight OBJ importers in C++. Such a common format.

                    Thomas Thomassen β€” SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

                    1 Reply Last reply Reply Quote 0
                    • OricAtmosO Offline
                      OricAtmos
                      last edited by

                      @chris fullmer said:

                      You want the model to output as a text file that happens to be in C++ syntax, right?

                      That was the idea, yes.

                      @unknownuser said:

                      That is simple enough if you know C++, and you have your own syntax your are trying to tie into. But no one else would be able to write it for you very well, sine no one else knows exactly how you would want to handle the C++ file structure.

                      I don't want anyone to write anything for me. I just wanted to know if there already was an exporter like this. πŸ˜„

                      @unknownuser said:

                      OBJ is just a text file, for example. Why not just learn how to parse their structure instead of making up your own file structure?

                      Basically I wanted to save me the step of parsing an input file and just let the compiler do it. I just want to have two 3D models in my program, no more.

                      1 Reply Last reply Reply Quote 0
                      • OricAtmosO Offline
                        OricAtmos
                        last edited by

                        @thomthom said:

                        I'm sure there is a very simple light weight OBJ importers in C++. Such a common format.

                        Thanks for the suggestion, I will have a look into the OBJ format. I don't know much about 3D file formats so I wasn't aware that OBJ is very common.

                        1 Reply Last reply Reply Quote 0
                        • OricAtmosO Offline
                          OricAtmos
                          last edited by

                          Hey,

                          I just wanted to say that I'm using the Open Asset Import Library (http://assimp.sourceforge.net/) now to load my two models. It can do a lot more than I need but it's not that hard to use.

                          1 Reply Last reply Reply Quote 0
                          • J Offline
                            Jim
                            last edited by

                            @oricatmos said:

                            Open Asset Import Library

                            Thanks, I was not aware of this library, but it looks like a nice thing.

                            Hi

                            1 Reply Last reply Reply Quote 0
                            • 1 / 1
                            • First post
                              Last post
                            Buy SketchPlus
                            Buy SUbD
                            Buy WrapR
                            Buy eBook
                            Buy Modelur
                            Buy Vertex Tools
                            Buy SketchCuisine
                            Buy FormFonts

                            Advertisement