Rendering a single polygon

Hi guys,

I have a question relating to something we need to do in Radiance for our application.

Imagine you have a scene that describes a room. In that room you have a single polygon that represents, for instance, someone's desk top.

Now, we want to find the average illumination of that person's desk top.

So, our idea is to render from a view point and direction such that the view plane is exactly the bounding box of the polygon, using rtrace to output all the illuminance at each point.

This would be pretty easy if there is some way to tell Radiance to clip all but a named polygon, but still render the illuminance on that polygon taking into account the rest of the scene. Is there a way to do that?

Our pretty dodgy idea at the moment is to place a near and far clip plane just in front and behind of the target polygon, but that's dodgy to say the least :slight_smile:

Any ideas?

Thanks,

Chris

ps. check out http://www.radiance-wiki.org/

just an alternative approach:
why do not use points instead?

you can generate x y z coordinates for a grid on the desk (done with excel)
in the form
x y z nx ny nz

then you use:

rtrace -w- -h- -I+ option < grid | rcalc -e
'$1=179*($1*0.265+$2*0.67+$3*0.065)' > illuminance

at the end you can use excel for the chart.

OR

if you wish to improve the process:

-1-
use rcalc to generate the grid
something like:

#!/bin/csh -f
set spacingx = 0.1
set spacingy = 0.2
set numberofpointsx = 9
set numberofpointsy = 9
set height = 0.9
cnt $numberofpointsx $numberofpointsy | rcalc -e '$1=$1'"*spacingx"';
$2=$2'"*spacingx"'; $3='"$height;"' $4 =0; $5=0; $6=1' > grid

then

rtrace .... < grid | rcalc > illuminance

you should however improve it a little by using also rotation and
translation of grid...
(if you get in trouble just tell, I can provide further help)

-2-

at this point you can try opendx visualizer:
it's a superb software from IBM, now free.

run very well under MacosX (it's supposed to be good on Linux and windows
too).

you can import your data and visualize them being able to spin the dataset
and apply different filters.
admesh is a must program to import 3d formats.

-2-alternative

use VTK and mayaVI or Paraview to visualize data.

hope it helps
cheers,
giulio

···

___________________________________________________________________
Electronic mail messages entering and leaving Arup business
systems are scanned for acceptability of content and viruses.

you can generate x y z coordinates for a grid on the desk (done with excel)
in the form x y z nx ny nz

then you use:

rtrace -w- -h- -I+ option < grid | rcalc -e
'$1=179*($1*0.265+$2*0.67+$3*0.065)' > illuminance

at the end you can use excel for the chart.

Yes. What if it's an irregular polygon for instance? Perhaps even a concave polygon? Then we need to perhaps generate points in the bounding box of the polygon and then test each ray to ensure that it actually does hit the polygon before computing its illuminance.

Seems like it would be handy to have a way of getting what Radiance knows about the illumination of a specified polygon and outputting it directly?

Chris

Yes. What if it's an irregular polygon for instance? Perhaps even a concave polygon?

I doubt that radiance has something like that, afaik those polygons are "flattened".

Seems like it would be handy to have a way of getting what Radiance knows about the illumination of a specified polygon and outputting it directly?

Would still be nice because this could be used in a number of ways... e.g. output of prerendered polygons to vrml, opengl, ... ?

CU Lars.

you can use this simple grid to raytrace a 1st set of rays and get just
surface inersections and illuminances
(ir's an option of rtrace)
these data could be written to a file and used as a new grid for the
illuminance calculation
the resulting data could be displayed with opendx.

alternatively you could export point location to a file from the 3d,
if you need a way to do that you should definitely try blender + brad, I
have been told that it's really good.

cheers,

giulio

last option:
however if you need to test millions of different desks prbably the full
plan view rendering is the best solution (just because it's quicker):
you can just add a mask to eliminate the floor to the final image....
viewing position is always in the center of the desk , looking down, planar
projection... should be easy...

···

-----Original Message-----
From: [email protected]
[mailto:[email protected]]On Behalf Of
Christopher Kings-Lynne
Sent: 19 January 2005 17:33
To: code development
Subject: Re: [Radiance-dev] Rendering a single polygon

you can generate x y z coordinates for a grid on the desk (done with

excel)

in the form
x y z nx ny nz

then you use:

rtrace -w- -h- -I+ option < grid | rcalc -e
'$1=179*($1*0.265+$2*0.67+$3*0.065)' > illuminance

at the end you can use excel for the chart.

Yes. What if it's an irregular polygon for instance? Perhaps even a
concave polygon? Then we need to perhaps generate points in the
bounding box of the polygon and then test each ray to ensure that it
actually does hit the polygon before computing its illuminance.

Seems like it would be handy to have a way of getting what Radiance
knows about the illumination of a specified polygon and outputting it
directly?

Chris

_______________________________________________
Radiance-dev mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-dev

___________________________________________________________________
Electronic mail messages entering and leaving Arup business
systems are scanned for acceptability of content and viruses.

oops,
Are you trying to do a calculation over a polygon or do you want to generate
light maps with radiance?

If it is the 1st one have a look to:
  Bernhard Spanlang, "Creating Lightmaps from HDR using Radiance"
at
http://www.radiance-online.org/radiance-workshop1/cd/Spanlang/index.html

see you
giulio

···

-----Original Message-----
From: [email protected]
[mailto:[email protected]]On Behalf Of Giulio
Antonutto
Sent: 19 January 2005 17:54
To: 'code development'
Subject: RE: [Radiance-dev] Rendering a single polygon

you can use this simple grid to raytrace a 1st set of rays and get just
surface inersections and illuminances
(ir's an option of rtrace)
these data could be written to a file and used as a new grid for the
illuminance calculation
the resulting data could be displayed with opendx.

alternatively you could export point location to a file from the 3d,
if you need a way to do that you should definitely try blender + brad, I
have been told that it's really good.

cheers,

giulio

last option:
however if you need to test millions of different desks prbably the full
plan view rendering is the best solution (just because it's quicker):
you can just add a mask to eliminate the floor to the final image....
viewing position is always in the center of the desk , looking down, planar
projection... should be easy...

-----Original Message-----
From: [email protected]
[mailto:[email protected]]On Behalf Of
Christopher Kings-Lynne
Sent: 19 January 2005 17:33
To: code development
Subject: Re: [Radiance-dev] Rendering a single polygon

you can generate x y z coordinates for a grid on the desk (done with

excel)

in the form
x y z nx ny nz

then you use:

rtrace -w- -h- -I+ option < grid | rcalc -e
'$1=179*($1*0.265+$2*0.67+$3*0.065)' > illuminance

at the end you can use excel for the chart.

Yes. What if it's an irregular polygon for instance? Perhaps even a
concave polygon? Then we need to perhaps generate points in the
bounding box of the polygon and then test each ray to ensure that it
actually does hit the polygon before computing its illuminance.

Seems like it would be handy to have a way of getting what Radiance
knows about the illumination of a specified polygon and outputting it
directly?

Chris

_______________________________________________
Radiance-dev mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-dev

___________________________________________________________________
Electronic mail messages entering and leaving Arup business
systems are scanned for acceptability of content and viruses.

_______________________________________________
Radiance-dev mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-dev

___________________________________________________________________
Electronic mail messages entering and leaving Arup business
systems are scanned for acceptability of content and viruses.

Others have worked on the problem of getting illuminance data from Radiance for the purpose of generating walkthroughs. The thing is, Radiance doesn't keep any information on a regular grid that translates to vertex values. And Radiance doesn't rely on polygons in general, so there are two snags. Anyway, check out Bernhard Spanlang's presentation from the 2002 workshop:

  http://www.radiance-online.org/radiance-workshop1/cd/Spanlang/index.html

See also Richard Gillibrand's work from the 2003 workshop:

  http://www.radiance-online.org/radiance-workshop2/cd/Gillibrand/abstract.html

If you're just after the values on one polygon, one trick is to render the polygon by itself to figure out which rays you need to trace, then trace them. Here's how I would do it:

  % vwrays -x 200 -y 200 -vf view2poly.vf -fd \
    > rtrace -h -opN -fdd `vwrays -d -x 200 -y 200 -vf view2poly.vf` '\!oconv poly.rad' \
    > rcalc -id6 -od -e 's(x):x*x;cond=s($4)+s($5)+s($6)-.5' -e '$1=$1;$2=$2;$3=$3;$4=$4;$5=$5;$6=$6' \
    > rtrace -h -fda -I [render options] scene.oct > irrad_results.dat

The vwrays command generates the rays associated with a view of the polygon. The first rtrace command gets the surface points and normals for the rays that hit your polygon. The rcalc command throws out rays whose surface normal is (0,0,0), which is what rtrace produces for rays that didn't hit anything. The second rtrace command then computes the irradiance for the surface points.

I didn't try this, so most likely I screwed up something, but it's a hint.

-Greg