Some parts of my 3d engine (I might release the sources sometime, it's a frozen project anyway)..
'Position camera
glRotatef(NCam.Pitch,1.0,0,0)
glRotatef(NCam.Yaw,0,1.0,0)
glRotatef(NCam.Roll,0,0,1.0)
glTranslatef(NCam.X,NCam.Y,NCam.Z)
...
'Loop entities
For Local NEnt:NEntity = EachIn NEntity.NEntityList
If NEnt.Parent = Null Then RenderEntity(NEnt,NCam)
Next
...
Method RenderEntity(NEnt:NEntity,NCam:NCamera)
glPushMatrix()
glTranslatef(NEnt.X,NEnt.Y,NEnt.Z)
glRotatef(NEnt.Pitch,1.0,0,0)
glRotatef(NEnt.Yaw,0,1.0,0)
glRotatef(NEnt.Roll,0,0,1.0)
glCallList(NEnt.DisplayList[NEnt.Frame])
For Local Chi:NEntity = EachIn NEnt.ChildList
RenderEntity(Chi,NCam)
Next
glPopMatrix()
End Method
Of course, I left out most of the code in the render routine etc, but should give you the idea. That also shows how parent/child system works.