POV-Ray : Newsgroups : povray.advanced-users : Pixel Mapping : Re: Pixel Mapping Server Time
1 Jul 2024 05:47:13 EDT (-0400)
  Re: Pixel Mapping  
From: SharkD
Date: 15 Nov 2009 18:47:30
Message: <4b009312$1@news.povray.org>
On 11/13/2009 9:56 AM, Captain Jack wrote:
> That'd be great... it seems like it should be a simple thing, I don't know
> why I'm having so much trouble with it.
>
> Historically, though, every time I think something should be easy, it turns
> out that I've completely missed the subtelties of the problem. :D
>
> --
> Jack

I've been working on a macro that can be used with "screen.inc" to get 
the screen coordinates. It is based on this thread:

http://news.povray.org/povray.advanced-users/thread/%3Cweb.48d9c9c6b4e5a4f9220734020@news.povray.org%3E/

The results aren't accurate however. Not sure what the problem is.

Mike



//BEGIN MACRO
#macro Get_Screen_Position(Loc)
	#declare Screen_Position = vinv_transform(Loc, Camera_Transform);
	#declare Screen_Position = <1/2 + 
Screen_Position.x/vlength(CamR)/Screen_Position.z, 1/2 - 
Screen_Position.y/vlength(CamU)/Screen_Position.z, 0,>;
	#declare Screen_Position = Screen_Position * <image_width, 
image_height, 0,>;
#end
//END MACRO


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.