|
|
On 11/02/2023 18:48, Bald Eagle wrote:
>
> screen.inc doesn't do anything except organize things into a well-defined box
> that exactly matches the view frustum of the camera. The box is squished very
> thin, and positioned so that it fills the entire camera from edge to edge.
>
> So no, it still doesn't "convert 3D coordinates to 2D coordinates". What it
> does allow you to do is use <u, v> values of the image plane to place 3D objects
> at that location. That's why those values are in the -0.5 to 0.5 range But all
> that does is define the image plane as a constant z-value (or some distance
> along whatever vector the view the direction is defined as).
>
Sorry Bald, but I don't agree with you.
Look at the image in this message. Render at 800x600.
The yellow point is at <4,5,3>. They are indeed 3d coordinates.
Now the black text says that this same point has the coordinates x=428
(from left to right) and y=163 (top to bottom).
This is a 2d coordinate in the image.
Of corse, if the image is render at 1024 by 768, the 2D coordinate is
548 and 208.
So, the macro Get_Screen_XY(Loc) in screen.inc convert 3d to 2d coordinates.
After that, it may not meet your need, I agree ;)
--
Kurtz le pirate
Compagnie de la Banquise
Post a reply to this message
Attachments:
Download 'getscreen.jpg' (84 KB)
Preview of image 'getscreen.jpg'
|
|