POV-Ray : Newsgroups : povray.binaries.scene-files : Graphical projection comparison : Re: Graphical projection comparison Server Time
23 Feb 2024 01:55:56 EST (-0500)
  Re: Graphical projection comparison  
From: Mike Horvath
Date: 4 May 2017 11:25:36
Message: <590b47f0$1@news.povray.org>
On 5/4/2017 8:43 AM, Bald Eagle wrote:
> Mike Horvath <mik### [at] gmailcom> wrote:
>> I created four new scenes comparing different types of graphical
>> projection. You can see the results here:
>>
>> https://commons.wikimedia.org/wiki/File:Various_projections_of_cube_above_plane.svg
>>
>> What I did was this:
>>
>> 1. model the scenes in POV-Ray
>> 2. using "screen.inc" export the important points to a text file
>> 3. import the points into GeoGebra
>> 4. connect in GeoGebra the points using segments and polygons
>> 5. export to SVG
>
> eek.
> I think that some of us have worked out a few rudimentary tools for making SVG
> files that mimic some basic lines and shapes.
> If and when I have the time and motivation, I could probably pair that with what
> I've learned - and haven't forgotten - from the whole view frustum project, and
> then use trace() to get screen coordinates.
>
> Maybe a little macro could be worked out that - given the constants for defining
> the image plane, the camera, and the viewing vector, would project a set of
> given points onto that plane...
>
>> This was the easiest way I could think of for creating SVG files using
>> perspective projection.
>
> "... fastest way, using what I had, and what I already knew"
> Yep - I often have to do that as an expedient, just to _get it done._
>
> Nice little project though.  :)
>
>> Mike
>
>
>


I forgot that in my version of "screen.inc" I added a macro called 
"Get_Screen_XY" that takes any 3D scene coordinate as input and outputs 
the 2D screen coordinate, normalized between 0 and 1. This makes things 
super simple! I just list whatever points I want to project, and then 
write the 2D locations to a text file.

I've attached "screen.inc" to this post.

Mike


Post a reply to this message


Attachments:
Download 'utf-8' (8 KB)

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