• Lucid Dreaming - Dream Views




    Results 1 to 16 of 16

    Hybrid View

    1. #1
      Ex Tech Admin Achievements:
      Created Dream Journal Tagger First Class Veteran First Class 10000 Hall Points Populated Wall Referrer Gold Made lots of Friends on DV
      slash112's Avatar
      Join Date
      Nov 2008
      Gender
      Location
      Sunny Scotland
      Posts
      5,113
      Likes
      1567
      DJ Entries
      29

      is there a way to do this on C++?

      ive got 3d modelling software. ive modelled a car.

      is there a way to get that 3d model into a game?

      like using the .c4d file and call it into the program?

      or would you have to render it in a special way, or would you have to get the model file into a different format? (.obj?)


      p.s. im not saying i could program a game, i just want to know if it is possible, and how to do it.
      its just i might learn C++ at some point in my life and it would be great if i could use my own models and put them in games when the time comes

    2. #2
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      Yes, it's possible

      What you would need to do is write a library to render 2D images from the 3D model, depending on the camera position
      (\_ _/)
      (='.'=)
      (")_(")

    3. #3
      Ex Tech Admin Achievements:
      Created Dream Journal Tagger First Class Veteran First Class 10000 Hall Points Populated Wall Referrer Gold Made lots of Friends on DV
      slash112's Avatar
      Join Date
      Nov 2008
      Gender
      Location
      Sunny Scotland
      Posts
      5,113
      Likes
      1567
      DJ Entries
      29
      oh right. so i couldnt just call up the .c4d file?

      although, i saw this thing one time, and its like rendering every possible angle or something. cause you can open it up in realplayer or something and you can move it about and look at it from what ever angle you want. i though maybe that would have something to do with it.

      so what you are saying is i would render images of the angles i may need in the game, like the back of the car, and slightly angled to the side for turning etc?

    4. #4
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      What I'm saying, is you'll need to write (or use something already written) to load in the model files and manipulate the information programatically

      Code:
      class 3d_model
      {
      public:
          3d_model();
          ~3d_model();
      
          void open(const char *file);
          void close();
      
          2d_image *render(int camera_x, int camera_y, int camera_z);
      
      }
      Ninja's probably the best person to speak to
      I hardly ever deal with graphics
      (\_ _/)
      (='.'=)
      (")_(")

    5. #5
      Ex Tech Admin Achievements:
      Created Dream Journal Tagger First Class Veteran First Class 10000 Hall Points Populated Wall Referrer Gold Made lots of Friends on DV
      slash112's Avatar
      Join Date
      Nov 2008
      Gender
      Location
      Sunny Scotland
      Posts
      5,113
      Likes
      1567
      DJ Entries
      29
      oh right ok. so you would use the model file.

    6. #6
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Quote Originally Posted by Ynot View Post
      Ninja's probably the best person to speak to
      I hardly ever deal with graphics
      Yay, my first plug.

      Yes, however you don't want to do the rendering in C++, you want to let the graphics card do it for you. The number of vertices on screen at any given time in most renders is in the thousands and all of those calculations would take ages to do in software.

      The best way to talk to your graphics card is OpenGL. Unfortunately, OpenGL has no standard file format and has no file loaders. They were supposed to in 3.0, but it didn't happen, so for a beginner, DirectX might be better.

      I'll stick with OpenGL because that's what I know. You need to load your file in, the obj file is easiest, but they're all pretty similar, and put in in a Vertex Array. This is what OpenGL uses to render things.

      Google NeHe, those guys have a lot of great OpenGL tutorials.
      The steps that are required for your situation is this:

      Set up your OpenGL canvas (GLUT is the standard, but 12 years old.)
      Turn on texturing, lighting, and other effects that you want
      Load your data
      Set up your camera (glProjection is the mode that you want)
      Position your camera
      Render


    7. #7
      Ex Tech Admin Achievements:
      Created Dream Journal Tagger First Class Veteran First Class 10000 Hall Points Populated Wall Referrer Gold Made lots of Friends on DV
      slash112's Avatar
      Join Date
      Nov 2008
      Gender
      Location
      Sunny Scotland
      Posts
      5,113
      Likes
      1567
      DJ Entries
      29
      cool thanks a lot.

      ill see if i can get openGL, ive heard so much about it

    Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •