Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. 3D architecture

3D architecture

Scheduled Pinned Locked Moved Design and Architecture
graphicsgame-devarchitecturetutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • 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.
  • R Offline
    R Offline
    rsaint27
    wrote on last edited by
    #1

    Hello, For this project I'm going to develop, I have to implement the base structure of a system that holds data taken from 3D files. The basic structure I've implemented is: class 3DPoint { //Point data } class 3DLine { List<3DPoint>... // class methods } class 3DModel { List<3DLine>... // class methods } So far this works well, and it suits my needs. Now I want to derive these classes to allow drawing with OpenGl, because I need some specific fields like "visibility, selected, ...", and that's when I ran into some troubles, because when I derive 3DModel (gl3DModel), I'm forced to use the class 3DLine, and not the derived class (gl3DLine), and the same with 3DPoint. Does any of you have any suggestion on how to do this? Thanks!

    T 1 Reply Last reply
    0
    • R rsaint27

      Hello, For this project I'm going to develop, I have to implement the base structure of a system that holds data taken from 3D files. The basic structure I've implemented is: class 3DPoint { //Point data } class 3DLine { List<3DPoint>... // class methods } class 3DModel { List<3DLine>... // class methods } So far this works well, and it suits my needs. Now I want to derive these classes to allow drawing with OpenGl, because I need some specific fields like "visibility, selected, ...", and that's when I ran into some troubles, because when I derive 3DModel (gl3DModel), I'm forced to use the class 3DLine, and not the derived class (gl3DLine), and the same with 3DPoint. Does any of you have any suggestion on how to do this? Thanks!

      T Offline
      T Offline
      Tristan Rhodes
      wrote on last edited by
      #2

      I think you should seperate the functionality from the data objects, similar to the way you would seperate database records from the actual database provider logic / queries. Instead, implement a renderer base class that takes the above primitives, then derive that for OpenGL / D3D. That way you could do: Renderer r = new D3DRenderer(); r.Render(myModels); Hope that helps Tris

      ------------------------------- Carrier Bags - 21st Century Tumbleweed.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups