POV-Ray : Newsgroups : povray.programming : Setting POVRay camera to duplicate OpenGL settings : Re: Setting POVRay camera to duplicate OpenGL settings Server Time
5 Jul 2024 15:31:58 EDT (-0400)
  Re: Setting POVRay camera to duplicate OpenGL settings  
From: herb
Date: 18 Jul 2003 09:55:01
Message: <web.3f17fbca198699c32cb61ace0@news.povray.org>
ABX wrote:
>On Wed, 16 Jul 2003 11:24:38 EDT, "herb" <nomail[at]nomail> wrote:
>> 1. Given a openGL view defined by the GL_PROJECTION and the GL_MODELVIEW
>> matrix
>> 2. Find the POVRAY camera setting that corrispond to the same view
>
>Ray Gardener made it in oposite direction. See at function
>daylon_CameraChanged() in package
>http://www.daylongraphics.com/other/povray/patches/povgl.zip
>
>ABX
>

Thanks for the help. In the meantime,I have solved the question like this

camera {
perspective
direction <0,0,-1> // This is to account for POV begin RHR
angle 45.000000 // FOV from OPenGL
transform {
matrix <
1.000000,0.000000,0.000000, // Rotation from MODELVIEW
0.000000,1.000000,0.000000, // Rotation from MODELVIEW
0.000000,0.000000,1.000000, // Rotation from MODELVIEW
0,0,0                       // Translation from MODELVIEW
>
 inverse } //Needed as we are moving the camera in POV and not the MODEL as
in OGL
}

The MODELVIEW matrix is obtained from OpenGL by
glGetDoublev(GL_MODELVIEW_MATRIX,&m);

This is now working fine for me, as far as I can see there is no reason why
orthographic should not be as easy.

- Herb


Post a reply to this message

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