Results 1 to 5 of 5
  1. #1
    xael is offline Member
    Join Date
    Sep 2010
    Posts
    31
    Rep Power
    0

    Default Most efficient data structure for a 3d model?

    Hey guys,
    So, I've used JOGL before, and now I'm trying to make a program where I use my own model class- a simple class storing a set of 3d points and all the points they are connected to. What is the most efficient data structure to store those points in considering that to render a model I'm planning on iterating through the entire thing, drawing each triangle formed by the vertex connections; an prototype model class I made used arrays since accessing each vertex has O(1) but I wasn't sure if Java had something better suited or if there was a datastruc better suited- any thoughts would be hugely appreciated!

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default Re: Most efficient data structure for a 3d model?

    A simple class with the three points and an arraylist of the connections.

  3. #3
    xael is offline Member
    Join Date
    Sep 2010
    Posts
    31
    Rep Power
    0

    Default Re: Most efficient data structure for a 3d model?

    So, I'm assuming that's for a single triangle since you said three points; should I just do something similar for all those triangles (array/arraylist)?
    Thanks

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default Re: Most efficient data structure for a 3d model?

    The class could contain all the data needed for a point and then a list of the points it connects to.

  5. #5
    xael is offline Member
    Join Date
    Sep 2010
    Posts
    31
    Rep Power
    0

    Default Re: Most efficient data structure for a 3d model?

    sweet, thanks

Similar Threads

  1. Replies: 4
    Last Post: 08-05-2011, 05:10 PM
  2. Which data structure to use?
    By malaguena in forum New To Java
    Replies: 4
    Last Post: 04-05-2011, 05:41 PM
  3. deleting the data in the column model
    By bigj in forum New To Java
    Replies: 0
    Last Post: 02-08-2010, 09:15 AM
  4. Dynamic data model in JComboBox
    By agreed in forum AWT / Swing
    Replies: 5
    Last Post: 11-15-2009, 09:30 PM
  5. data structure and data base??
    By ahmed13 in forum Advanced Java
    Replies: 8
    Last Post: 03-27-2009, 06:48 AM

Posting Permissions

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