POV-Ray : Newsgroups : povray.programming : Setting POVRay camera to duplicate OpenGL settings Server Time
3 Jul 2024 06:09:31 EDT (-0400)
  Setting POVRay camera to duplicate OpenGL settings (Message 1 to 3 of 3)  
From: herb
Subject: Setting POVRay camera to duplicate OpenGL settings
Date: 16 Jul 2003 11:25:01
Message: <web.3f156e36d4296feb2cb61ace0@news.povray.org>
Has anyone any experience with setting the POVRay camera to coincide with a
given OpenGL perspective view ?

Basically the problem is as follows

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

Any help will be appreciated - thanks


Post a reply to this message

From: ABX
Subject: Re: Setting POVRay camera to duplicate OpenGL settings
Date: 16 Jul 2003 11:31:11
Message: <hprahvs6b0srtu74bgtagasou6ho671q5a@4ax.com>
On Wed, 16 Jul 2003 11:24:38 EDT, "herb" <nomail@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


Post a reply to this message

From: herb
Subject: Re: Setting POVRay camera to duplicate OpenGL settings
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.