Hi David,
I set a high value to the z-coordinates and it worked well.
Thanks for the smart trick.
Best Regards
--
Lorenzo
email: email@hidden
> From: David Spooner <email@hidden>
> Date: Sat, 17 Nov 2007 09:13:42 -0700
> To: Lorenzo <email@hidden>
> Cc: email@hidden
> Subject: Re: Drawing 2D icons from 3D point
>
>
> On 17-Nov-07, at 4:48 AM, Lorenzo wrote:
>
>> Hi,
>> I have to draw the icon of a light source. The light is in a 3D
>> space, but
>> if I draw the icon on a 3D space too, the icon looks smaller when
>> the light
>> is far away. So I calculate its 2D point on the screen and I draw it
>> with
>> the Ortho projection with the depth test disabled
>
> As an alternative, once you have the screen coordinates for the
> corners of your icon you
> can use gluUnproject to find world coordinates which will project
> there. It's not the most
> efficient technique, but it can be optimized if necessary...
>
>> It works well. The only
>> problem is that I have to draw this icon "after" all the objects
>> have been
>> drawn, otherwise it gets covered by the objects. Instead I need to
>> draw it
>> immediately when I display the light. Is a way to do that e.g.
>> writing a
>> high value to the depth buffer?
>
> Can't you supply z-coordinates when you draw the vertices of your
> icon? For example, using
> something slightly greater than what you specified to be the near
> distance in glOrtho().
>
> Cheers,
> dave
>
>> Best Regards
>> --
>> Lorenzo
>> email: email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden
This email sent to email@hidden