place a 3d object of size 50 pixels at (x,y)

I am trying to track an object in the image. I need to place a 3d object at the image coordinates (x,y), and it must cover a certain pixel size (eg 50 pixels in width). The pixel size can vary during execution time.

But i realise that the opengl command is: glutSolidCube(radius). How do i relate the number of pixels to radius, and place the cube at row x and column y of the image?

[The image is displayed via orthogonal projection while the cube is using perspective projection]

Please help! Thank you…Ü

Originally posted by meahmeah:
How do i relate the number of pixels to radius, and place the cube at row x and column y of the image?

Use the frustum and window dimensions to calculate how large an object will be.

If you’re using a parallel projection, the radius-to-pixel size is a direct calculation. If you’re using a perspective projection also take into consideration the perspective division.

thanks brcain! I manage to do it via glOrtho.