POV-Ray : Newsgroups : povray.binaries.images : [3D Geometry] Projection of points on plane (34k+23k+6k) Server Time
5 Nov 2024 20:18:48 EST (-0500)
  [3D Geometry] Projection of points on plane (34k+23k+6k) (Message 1 to 1 of 1)  
From: Simon
Subject: [3D Geometry] Projection of points on plane (34k+23k+6k)
Date: 16 May 2005 17:15:14
Message: <42890d62@news.povray.org>
Hi there,
  I've started learning 3D geometry and as an exercise, I made this C++ 
function that takes a point in 3D and projects it on a plane given its 
normal, in easy english this would mean take any point anywhere and make 
them all "fall" on an invisible surface.

  Basically, in the images you see bellow, all points were randomly 
generated with coordinates (x,y,z) within [-1,1].  With no 
transformation, this gives a box filled with points.  After applying the 
geometric transformation, all points lies on the plane that the normal 
points.

  Graphically speaking, the images on the left were rendered with povray 
3.6 on linux, I did not take rendering times, as it's pretty quick 
(using spheres and cylinders). Images on the right were screenshots of 
my OpenGL render (using points and lines).  Both images were resized to 
320x240 and the OpenGL images (right) had to go through a 
brightness/contrast work to show the details.

  In this scene, the 3 axes X, Y and Z are drawn with the lines in Red, 
Green and Blue.  The Grey line represents the normal of the imaginary 
plane.  The White dots represent the dots After transformation.  Also, 
the first image shows the scene looking at the origin, with a camera 
position approx. like <10,10,10>, the normal(white line) = <1,1,1>.  The 
second image shows same origin with camera position approx. like 
<0,2,10>.  The last image shows same origin with camera position approx. 
like <-10, 0, 10>.

PROOF:
First image shows an hexagon, a box looked from one of its corner looks 
like an hexagon, but last image shows that the box was correctly reduced 
to a simple plane in 3D space.

Hope you get it, hope you like it!

Simon


Post a reply to this message


Attachments:
Download 'point2plane_projection.gl2pov.1.jpg' (34 KB) Download 'point2plane_projection.gl2pov.2.jpg' (23 KB) Download 'point2plane_projection.gl2pov.3.jpg' (7 KB)

Preview of image 'point2plane_projection.gl2pov.1.jpg'
point2plane_projection.gl2pov.1.jpg

Preview of image 'point2plane_projection.gl2pov.2.jpg'
point2plane_projection.gl2pov.2.jpg

Preview of image 'point2plane_projection.gl2pov.3.jpg'
point2plane_projection.gl2pov.3.jpg


 

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