PDA

View Full Version : how to express a sphere w.r.t a quad *urgent pls*



brett01
11-23-2008, 05:33 PM
I want to represent a sphere w.r.t a quad i.e,My glutsolidsphere is on the quad.when the quad is rotated it should remain on it.Thank u in advance.

trinitrotoluene
11-23-2008, 06:00 PM
Try this:


glPushMatrix();
glTranslatef(...) and/or glRotatef(...)
glBegin(...)
//Drawing quad command
glEnd(...)

glTranslatef(...) and/or glRotatef(...)
glutsolidsphere(...)
glPopMatrix();


So if you move the quad (translate,rotate), the sphere will translate and rotate too. Is that what you need?