Results 1 to 3 of 3

Thread: HOW TO CREATE 3D MODEL FROM 2D HORIZENTAL POLYGONS

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2009
    Posts
    1

    HOW TO CREATE 3D MODEL FROM 2D HORIZENTAL POLYGONS

    Hi folks,

    I have some horizontal 2D polygons with different z (elevation), different shapes and different number of vertices. I'm going to construct a 3d object from this polygons (contours), such that each 2d polygon is the boundary of 3d object at that elevation. How can I do that?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Los Angeles
    Posts
    374

    Re: HOW TO CREATE 3D MODEL FROM 2D HORIZENTAL POLYGONS

    Quote Originally Posted by mishani99
    I have some horizontal 2D polygons with different z (elevation), different shapes and different number of vertices. I'm going to construct a 3d object from this polygons (contours), such that each 2d polygon is the boundary of 3d object at that elevation. How can I do that?
    Sounds like you don't want to change the vertex coordinates of these polygons. In that case you have to apply translations to each polygon, which would look something like -

    glPushMatrix; glTranslate(x1,y1,z1); Draw_Poly1; glPopMatrix;
    glPushMatrix; glTranslate(x2,y2,z2); Draw_Poly2; glPopMatrix;
    glPushMatrix; glTranslate(x3,y3,z3); Draw_Poly3; glPopMatrix;
    glPushMatrix; glTranslate(x4,y4,z4); Draw_Poly4; glPopMatrix;
    glPushMatrix; glTranslate(x5,y5,z5); Draw_Poly5; glPopMatrix;

    This approach would not reorient your polys at all. Is that sufficient to build your 3D object? This is a cumbersome way to build a 3D model.
    Am I doing your homework for you?

  3. #3
    Senior Member Regular Contributor
    Join Date
    Jun 2006
    Location
    Edinburgh - Scotland
    Posts
    146

    Re: HOW TO CREATE 3D MODEL FROM 2D HORIZENTAL POLYGONS

    I think what they require is a way to build triangles that would form the "vertical sides" of the 3D shape. i.e. imagine the simple case of two 2D polygons (squares). These are stacked on top of each other each at a different height (Y), but I presume parallel to each other i.e. the Y coord is the same for each vertex in each polygon.

    So need a method to generate the triangles that connect the bottom polygon to the polygon above. In this simple case, if the 2 polygons were the same orientation and size it would form a box.

    I think that's what they want...but I've no idea how to solve it

Similar Threads

  1. How can i create 3D human body model
    By AmrRamadan in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-24-2011, 03:25 PM
  2. Create Multiple Polygons (Bar chart)
    By wannabeAGeek in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 03-17-2009, 01:03 PM
  3. How to create a cross-section of a model?
    By Yarmy in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-22-2008, 11:50 PM
  4. Counting polygons in a LOD filled model
    By TriangleMan in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 07-26-2003, 04:19 PM
  5. how can i create global lighting model?
    By bala in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-08-2002, 12:06 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
  •  
Proudly hosted by Digital Ocean