Problem with GL object placement



  • Hello,

    I'm finding a problem in placing an object in the viewing volume created with gluperspective(60.0,w/h,0.1,50.0); It has a glwidget full size. If glTranslatef(0.0,0.0,-1.0); is provided, shows the object. Whereas if glTranslatef(0.0,0.0,-2.0); doesnt shows the object.
    Please anyone help me out.

    [I split this question into its own thread, as it was not directly related to the old thread. Please open new threads for new questions -- mlong]



  • Hi,
    In gluperspective, the last 2 parameters you set is the near plane and far plane. Without looking at your code, I guess your object is located somewhere near the far plane. So when you translate it on z axis, it is clipped by the far plane.
    Try to increase the last parameter to 1000 and see if it works.



  • thanks for the reply.



  • Hi,
    I'm trying to place gluSphere in the viewing volume created inside gluperspective. But its coming in an elongated form. So, May i know what is the reason?



  • Created volume with gluperspective(60.0,w/h,1.0,1000);



  • I met this problem before because I didn't implement the resizeGL() function. The reason should be drawing with wrong perspective.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.