Results 1 to 10 of 10

Thread: 3D primitives???

  1. #1
    Member Newbie
    Join Date
    Mar 2002
    Posts
    34

    3D primitives???

    Are there any 3D primitives using openGL. I know that all 3D primitives can be constructed from 2D primitives, I want a shape that is solid. For example, if I constructed a red cube from six squares, it would be hollow. And if I were to cut the tops and bottoms off with two clipping planes, i would see a hollow tunnel as a result. I want a shape that is completely coloured on the inside, and I want it such that if I were to specify different colours for each vertex, it would smoothen the colours across the shape in 3D just like for 2D primitives.

    And I can't just redraw two side of the shape after the cutting planes have been placed. I'm writing a program to view 2D cross sections of a 3D model (achieved using two clipping planes, very close to each other). And I allow the user to define the clipping plane, so I don't actually know where the clipping plane is going to be, and it would be way way way too complicated to figure out based on the plane equation and all the vertices of my model, what portions have been clipped and where to draw a new polygon to cover the region. So basically, I just want an easier way to do it, and I'm hoping that there are 3D primitives cause that would make it really easy.

    [This message has been edited by Rajveer (edited 04-23-2002).]

  2. #2
    Junior Member Newbie
    Join Date
    Apr 2002
    Posts
    28

    Re: 3D primitives???

    I don't know of any 3d primitives in opengl that behave in this manner. Are all your models meshes? It seems that for your purposes a volumetric model such as CSG or voxels would be more appropriate (and there is no direct support for these via opengl). What is your application?

    jimmi

  3. #3
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    653

    Re: 3D primitives???

    Nothing draws solidly, everything works in the same way as opengl in the beginning, They just implement some algorithm to close the ends of (such as whenm you clip)

  4. #4
    Senior Member Regular Contributor
    Join Date
    Mar 2001
    Posts
    184

    Re: 3D primitives???

    isn't the teapot implemented as a primitive? i seem to remember my Computer Graphics professor telling me this. but it may only exist in glut. however, you can see it in the 3d pipes screensaver, this may not have been written in glut.

    b

  5. #5
    Junior Member Newbie
    Join Date
    Apr 2002
    Posts
    28

    Re: 3D primitives???

    Originally posted by coredump:
    isn't the teapot implemented as a primitive?
    The teapot isn't solid, in the same way that quadrics (gluSphere, gluDisk etc.) aren't solid. These functions just render the surface of the relevant object. If you placed a clip plane which bisected the teapot you would see that it is hollow.

    jimmi

  6. #6
    Senior Member Regular Contributor
    Join Date
    Mar 2001
    Posts
    184

    Re: 3D primitives???

    oh, i never said it was solid...just that it's 3d. and the color plates in the red book show examples of a teapot with the side carved out, showing the insides. but yes, it has no thickness.

    b

  7. #7
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: 3D primitives???

    The teapot is basically a glut thing, as well. There is no

    glBegin(GL_TEAPOT);
    Deiussum
    Software Engineer and OpenGL enthusiast

  8. #8
    Junior Member Newbie
    Join Date
    Apr 2002
    Posts
    28

    Re: 3D primitives???

    Originally posted by Deiussum:
    The teapot is basically a glut thing, as well. There is no

    glBegin(GL_TEAPOT);

    I wish there were, then we could request glHandlef(...) and glSpoutf(...) calls in opengl 1.3

    jimmi

  9. #9
    Senior Member Regular Contributor
    Join Date
    Oct 2007
    Posts
    184

    Re: 3D primitives???

    How about using 3D Textures?

  10. #10
    Senior Member Regular Contributor
    Join Date
    Jul 2001
    Posts
    442

    Re: 3D primitives???

    Unfortunately, the solution to your problem is `advanced'. You need to slice your model and cap the ends - OpenGL won't be able to do this for you.

    A 3D texture wouldn't work (it would be way too big for your card).

    Voxel rendering might be a solution, but I figure thats just as difficult as the slice\cap option.

    I think you should check comp.graphics.algorithms for more information.

Similar Threads

  1. rotating primitives
    By phil67rpg in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-11-2012, 07:04 AM
  2. adjacency primitives
    By krecik1337 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-11-2011, 11:40 AM
  3. available primitives
    By curmudgeon42 in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 12-06-2003, 07:25 AM
  4. Which Primitives Should I Use?
    By rpminihan in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-27-2002, 03:08 PM
  5. new primitives??
    By Jeffry J Brickley in forum OpenGL: General
    Replies: 0
    Last Post: 06-25-2002, 07:47 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