POV-Ray : Newsgroups : povray.general : from an opengl scene to a povray scene Server Time
28 Nov 2024 03:02:30 EST (-0500)
  from an opengl scene to a povray scene (Message 1 to 3 of 3)  
From: Dav shef
Subject: from an opengl scene to a povray scene
Date: 28 Aug 2007 07:05:00
Message: <web.46d400a5c01d8011699678ae0@news.povray.org>
Hi All,

I have a opengl (with GLUT) scene with spheres and boxes which I'd
like to make a nice snapshot of with povray.

I can easily "translate" my objects into povray commands but I have trooble
with the definition of the camera.

In opengl, all rotation and translation are stored into a 4x4 matrix called
the modelview matrix. I couldn't, however, find useful information about
how to use it  properly.

From this matrix, I would need to determine the different vectors necessary
for the camera parameters such as location, right, up, look_at..etc...
But I have no idea how to do this

Has anyone had the same issue ? any ideas are welcome.

Cheers

Dav


Post a reply to this message

From: ingo
Subject: Re: from an opengl scene to a povray scene
Date: 28 Aug 2007 12:41:48
Message: <Xns999ABE311E0A4seed7@news.povray.org>
in news:web.46d400a5c01d8011699678ae0@news.povray.org Dav_shef wrote:

> I have a opengl (with GLUT) scene with spheres and boxes which I'd
> like to make a nice snapshot of with povray.
> 
> 

Ray Gardner did a patch that does it the other way around (pov>opengl), 
but maybe the code can help you, 
http://www.daylongraphics.com/other/povray/patches/

ingo


Post a reply to this message

From: Ray Gardener
Subject: Re: from an opengl scene to a povray scene
Date: 31 Aug 2007 05:12:40
Message: <46d7db88@news.povray.org>
> I have a opengl (with GLUT) scene with spheres and boxes which I'd
> like to make a nice snapshot of with povray.


If you can, define your OpenGL camera in terms of FOV, world position, 
cam up vector, look_at point (or a direction from which the look_at 
point can easily be computed), and use GLUT routines like gluLookAt and 
gluPerspective to build the projection and modelview matrices. You'll 
then have the basic camera attributes from which to define a POV-Ray 
camera statement. If you don't already have the cam's right vector you 
can build it from cross product of the up and fwd vectors.

Ray


Post a reply to this message

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