POV-Ray : Newsgroups : povray.general : Is this an effective approach for large projects? Server Time
1 Nov 2024 01:23:47 EDT (-0400)
  Is this an effective approach for large projects? (Message 1 to 10 of 10)  
From: Brendan Ryan
Subject: Is this an effective approach for large projects?
Date: 14 Feb 2005 21:29:31
Message: <42115e8b$1@news.povray.org>
I'm going to work on a project to create a virtual museum and render 
images from many points within it with a spherical camera to view on the 
inside surface of a sphere in an OpenGL program.
Would it be effective to have macros to create scene files with their 
contents depending on the location of the camera rather than having 
scene files that each contain an entire floor of the museum?
I'm thinking of making data files with information about rooms that 
macros could read. Then the code that the macros write would depend on 
the given location of the spherical camera. That way, only the rooms and 
objects that are visible from the current location are parsed and 
rendered. What those macros would do is to use the data files to 
determine what room the camera would be in and check for things like 
doorways and windows other rooms could be visible through. Then a scene 
file that includes the include files for those rooms would be written.
Had anyone done something like this before?

Brendan


Post a reply to this message

From: Rafal Maj Raf256
Subject: Re: Is this an effective approach for large projects?
Date: 15 Feb 2005 16:39:53
Message: <2559882.U0UYy4bKFR@raf256com>
Brendan Ryan wrote:

> I'm going to work on a project to create a virtual museum and render
> images from many points within it with a spherical camera to view on the
> inside surface of a sphere in an OpenGL program.
> Would it be effective to have macros to create scene files with their
> contents depending on the location of the camera rather than having
> scene files that each contain an entire floor of the museum?

I would suggest to use a shell script to render all scenes, script could
write some temporary file (based on current timestamp) and pass name of
such configuration file to POV-Ray using -Ddeclare=... command line option.

> I'm thinking of making data files with information about rooms that
> macros could read. Then the code that the macros write would depend on
> the given location of the spherical camera. That way, only the rooms and
> objects that are visible from the current location are parsed and
> rendered. What those macros would do is to use the data files to
> determine what room the camera would be in and check for things like
> doorways and windows other rooms could be visible through. Then a scene
> file that includes the include files for those rooms would be written.

Seems like another good approach. Or, perhaps, it would be best to write a
small C program to generate POV-Ray syntax list of locations to some
location.inc? I suggest to use with programming language You find most
comfortable :)



-- 
Rafal Maj Raf256


Post a reply to this message

From: Slime
Subject: Re: Is this an effective approach for large projects?
Date: 16 Feb 2005 20:48:33
Message: <4213f7f1$1@news.povray.org>
> Would it be effective to have macros to create scene files with their
> contents depending on the location of the camera rather than having
> scene files that each contain an entire floor of the museum?


Go ahead and split the building up into different rooms, but don't write
complicated code to only draw visible parts. If you find that it's too slow
to render, *then* you can write that code to speed things up, but it might
not be a problem.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Zeger Knaepen
Subject: Re: Is this an effective approach for large projects?
Date: 17 Feb 2005 19:00:54
Message: <42153036$1@news.povray.org>
"Brendan Ryan" <bjr### [at] ritedu> wrote in message
news:42115e8b$1@news.povray.org...
> I'm going to work on a project to create a virtual museum and render
> images from many points within it with a spherical camera to view on the
> inside surface of a sphere in an OpenGL program.

You do know that a sky box is faster and more accurate than a sky sphere in
opengl, right?  You only have 6 quads and because they are squares, you have
less distortion on your textures.

cu!
--
camera{location-z*3}#macro G(b,e)b+(e-b)*(C/50)#end#macro L(b,e,k,l)#local C=0
;#while(C<50)sphere{G(b,e),.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1
;#end#end L(y-x,y,x,x+y)L(y,-x-y,x+y,y)L(-x-y,-y,y,y+z)L(-y,y,y+z,x+y)L(0,x+y,
<.5,1,.5>,x)L(0,x-y,<.5,1,.5>,x)               // ZK http://www.povplace.be.tf


Post a reply to this message

From: Brendan Ryan
Subject: Re: Is this an effective approach for large projects?
Date: 17 Feb 2005 22:35:36
Message: <42156288$1@news.povray.org>
Zeger Knaepen wrote:
> 
> You do know that a sky box is faster and more accurate than a sky sphere in
> opengl, right?  You only have 6 quads and because they are squares, you have
> less distortion on your textures.
> 

If I make images for a sky box, I'd use orthographic cameras pointed in 
six directions from each location. Maybe I could do experiments to see 
the difference.

Brendan


Post a reply to this message

From: Brendan Ryan
Subject: Re: Is this an effective approach for large projects?
Date: 17 Feb 2005 22:37:33
Message: <421562fd$1@news.povray.org>
Slime wrote:
> 
> Go ahead and split the building up into different rooms, but don't write
> complicated code to only draw visible parts. If you find that it's too slow
> to render, *then* you can write that code to speed things up, but it might
> not be a problem.
> 

Ok, I don't have a complete list of the stuff I'll put into the museum, 
so I don't know how big each room and floor would be yet. So, I'll wait 
to see if it grows large and slow.

Brendan


Post a reply to this message

From: Brendan Ryan
Subject: Re: Is this an effective approach for large projects?
Date: 17 Feb 2005 22:40:40
Message: <421563b8$1@news.povray.org>
Rafal Maj Raf256 wrote:
> Brendan Ryan wrote:
> 
> I would suggest to use a shell script to render all scenes, script could
> write some temporary file (based on current timestamp) and pass name of
> such configuration file to POV-Ray using -Ddeclare=... command line option.
> 
Ok, I'll need to experiment with passing command line options to the 
windows version of povray because I haven't done that before.

> Seems like another good approach. Or, perhaps, it would be best to write a
> small C program to generate POV-Ray syntax list of locations to some
> location.inc? I suggest to use with programming language You find most
> comfortable :)
> 
If the projects becomes large and slow even after being divided into 
multiple files and too large to easily manage by hand, I'll try writing 
a C++ program to read the data files about the rooms and generate the code.

Brendan


Post a reply to this message

From: Slime
Subject: Re: Is this an effective approach for large projects?
Date: 17 Feb 2005 22:45:30
Message: <421564da$1@news.povray.org>
> If I make images for a sky box, I'd use orthographic cameras pointed in
> six directions from each location. Maybe I could do experiments to see
> the difference.

No; it's important to use perspective cameras. The idea is to map each point
on the "sky box" to the color you see when you look from the center of the
box in that direction. This can only be achieved with perspective cameras.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Brendan Ryan
Subject: Re: Is this an effective approach for large projects?
Date: 23 Feb 2005 06:48:54
Message: <421c6da6$1@news.povray.org>
Slime wrote:
> 
> No; it's important to use perspective cameras. The idea is to map each point
> on the "sky box" to the color you see when you look from the center of the
> box in that direction. This can only be achieved with perspective cameras.
> 

I read something about having to use a 90 degree field of view for this 
purpose. Would the default values for the camera parameters work? I'll 
need to review the stuff on the camera in the manual.

Brendan


Post a reply to this message

From: Slime
Subject: Re: Is this an effective approach for large projects?
Date: 23 Feb 2005 18:20:21
Message: <421d0fb5@news.povray.org>
> I read something about having to use a 90 degree field of view for this
> purpose. Would the default values for the camera parameters work? I'll
> need to review the stuff on the camera in the manual.


You do need a 90 degree field of view. (Think about it like this: 4 sides of
a cube = 360 degrees, so 90 degrees for each side.) Also, you need square
images (since they'll be sides of a cube). The default camera is made for a
4:3 aspect ratio, so this needs to be changed. This should work:

camera {
location 0
direction z
up y
right x

look_at z // set to which side of the "cube" you want to render. (+-x, +-y,
+-z)
}

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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