PDA

View Full Version : create and manipulate 3D world



adityask
03-16-2002, 02:45 AM
hello,
how to create 3d world in opengl+MFC? how to move objects in 3d space like placing one over another? can anybody guide? any good links on the net?
thanx in advance.

immy
03-16-2002, 03:00 AM
hi
Sorry am using win32 api but i think the core code shall be the same in MFC & win32.
1st u get a DC then check if the pixel format u wanna use is supported on VGA card or you can find a closet match of ur required pixel format. Then u choose it as the current pixel format into the Device context by calling the function

SetPixelFormat(hDC,pixel format structure)

then u create an opengl rendering context from the DC. Make the redering context as current rendering context & thats it.I recommend you to go to beginner's forum for detailed information.
bye

adityask
03-16-2002, 03:09 AM
hey
thanks for the info but i have already done it. my main query was how to manipulate objects in the world like dragging with the mouse, rotating, placing one object on top of another etc.? can u guide me?



Originally posted by immy:
hi
Sorry am using win32 api but i think the core code shall be the same in MFC & win32.
1st u get a DC then check if the pixel format u wanna use is supported on VGA card or you can find a closet match of ur required pixel format. Then u choose it as the current pixel format into the Device context by calling the function

SetPixelFormat(hDC,pixel format structure)

then u create an opengl rendering context from the DC. Make the redering context as current rendering context & thats it.I recommend you to go to beginner's forum for detailed information.
bye

Nutty
03-16-2002, 03:16 AM
Stop bloody cross-posting!!

Why dont you actually _look_ for links on the net, or is that just a stupid idea?!

immy
03-16-2002, 07:51 AM
hi
for rotation u can use
glRotatef(value,x,y,z);
you can place one object on top of another by just translating
glTranslatef(x,y,z);
the third dragging i havn't tried but you can use
gluProject(...) to do that
hope you the best bye bye