Results 1 to 3 of 3

Thread: Group Objects

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2009
    Posts
    6

    Group Objects

    Is it possible to group objects together so they act as one?

  2. #2
    Junior Member Newbie
    Join Date
    Oct 2009
    Posts
    2

    Re: Group Objects

    There are no objects in OpenGL.
    There are only triangle and quad faces, points and lines.
    It's up to your program to manage these as objects, and there you can do what you want.

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

    Re: Group Objects

    PushMatrix and PopMatrix are useful when it comes to 'grouping' objects for the purpose of applying transformations. For example, let's say you have 5 objects, each of which is drawn by a separate subroutine (another important step). The pseudo code below applies a Translate to all 5 objects, a Rotate to objects 1,2,3 (but NOT 4,5), and a Scale to objects 4 and 5, (but not 1,2,3).

    Code :
    glLoadIdentity
    glTranslate
     
       glPushMatrix
          glRotate
          Draw_Object1
          Draw_Object2
          Draw_Object3
       glPopMatrix
     
       glPushMatrix
          glScale
          Draw_Object4
          Draw_Object5
       glPopMatrix
    Am I doing your homework for you?

Similar Threads

  1. Replies: 1
    Last Post: 02-17-2015, 11:38 AM
  2. Replies: 5
    Last Post: 03-16-2011, 12:33 PM
  3. Do Vertex Array Objects 'group' also glUniform?
    By imported_tobindax in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 01-23-2011, 07:45 AM
  4. How to group objects together?
    By jing_ntu in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 09-04-2007, 11:26 PM
  5. Replies: 17
    Last Post: 06-15-2006, 12:25 PM

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