[Radiance-general] panotools to map textures, patterns etc?
Peter Apian-Bennewitz
[email protected]
Tue, 20 Nov 2001 07:29:37 +0100
--------------A522AABA7AADAA10EF38208A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
"Lars O. Grobe" wrote:
> Hi!
>
> For me (as I am a student of architecture and not of mathematics) it's
> very difficult to understand how to map onto non-planar objects. E.g. if
> I want to map onto a cylinder, I know that there is a cal-file, but I
> don't really understand this. Now, maybe I should try, but I just found
> a set of tools called panotools (www.panotools.org), which is able to
> convert bitmap-files from different projections. Would it be possible to
> use it to create imagefiles that could be mapped onto e.g. a radiance
> cylinder without any further calculations, just like mapping iot onto a
> plane? I would really like to have pic-files that don't need any further
> calculations.
>
> So, maybe someone tried something like this before? Or am I completely
> wrong with this?
>
> Thank You, CU, Lars.
> _______________________________________________
> Radiance-general mailing list
> [email protected]
> http://www.radiance-online.org/mailman/listinfo/radiance-general
Hi Lars,
don't know panaotools, but wouldn't think its feasible. The mapping glues
world coordinates
(the xyz-coordinates your cylinder is defined in) to texture coordinates
(the pixel number in your image),
so it's somewhat 'outside' the image itself.
--math-on--
>From a math point of view this transformation could be one general one,
with a second one
implicitly defined in 'warping' the image, but that fails (mathematically)
at singular points in
the transformation. E.g. the mapping of a texture onto a polygon is just
too different from mapping
on a sphere.
--math-off--
However, it's disappointing for casual users that Radiance hasn't got
default mappings for geometric
primitives (GUI builders- any comments ?).
For cylinders, I once used:
merkur $ more picture_cyl.cal
{
Calculation of 2d picture coordinates for cylinders.
A1, A2 are coordinates of cylinder, which extends along
z-axis
A3 is radius
A4 is pic_ascpect
A5 is scaling
}
pic_aspect=A4;
pic_u = A3*atan2(Px-A1,Py-A2)/A5;
pic_v = Pz / A5;
tile_u = mod(pic_u,max(1,1/pic_aspect));
tile_v = mod(pic_v,max(1,pic_aspect));
Which worked for a brick cylinder wall.
hope that helps
cheers
Peter
--
pab-opto, Freiburg, Germany, www.pab-opto.de
--------------A522AABA7AADAA10EF38208A
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
"Lars O. Grobe" wrote:
<blockquote TYPE=CITE>Hi!
<p>For me (as I am a student of architecture and not of mathematics) it's
<br>very difficult to understand how to map onto non-planar objects. E.g.
if
<br>I want to map onto a cylinder, I know that there is a cal-file, but
I
<br>don't really understand this. Now, maybe I should try, but I just found
<br>a set of tools called panotools (www.panotools.org), which is able
to
<br>convert bitmap-files from different projections. Would it be possible
to
<br>use it to create imagefiles that could be mapped onto e.g. a radiance
<br>cylinder without any further calculations, just like mapping iot onto
a
<br>plane? I would really like to have pic-files that don't need any further
<br>calculations.
<p>So, maybe someone tried something like this before? Or am I completely
<br>wrong with this?
<p>Thank You, CU, Lars.
<br>_______________________________________________
<br>Radiance-general mailing list
<br>[email protected]
<br><a href="http://www.radiance-online.org/mailman/listinfo/radiance-general">http://www.radiance-online.org/mailman/listinfo/radiance-general</a></blockquote>
Hi Lars,
<p>don't know panaotools, but wouldn't think its feasible. The mapping
glues world coordinates
<br>(the xyz-coordinates your cylinder is defined in) to texture coordinates
(the pixel number in your image),
<br>so it's somewhat 'outside' the image itself.
<p>--math-on--
<br>From a math point of view this transformation could be one general
one, with a second one
<br>implicitly defined in 'warping' the image, but that fails (mathematically)
at singular points in
<br>the transformation. E.g. the mapping of a texture onto a polygon is
just too different from mapping
<br>on a sphere.
<br> --math-off--
<p>However, it's disappointing for casual users that Radiance hasn't got
default mappings for geometric
<br>primitives (GUI builders- any comments ?).
<p>For cylinders, I once used:
<blockquote>merkur $ more picture_cyl.cal
<br>{
<br> Calculation of 2d picture
coordinates for cylinders.
<br> A1, A2 are coordinates
of cylinder, which extends along z-axis
<br> A3 is radius
<br> A4 is pic_ascpect
<br> A5 is scaling
<br>}
<p>pic_aspect=A4;
<br>pic_u = A3*atan2(Px-A1,Py-A2)/A5;
<br>pic_v = Pz / A5;
<p>tile_u = mod(pic_u,max(1,1/pic_aspect));
<br>tile_v = mod(pic_v,max(1,pic_aspect));</blockquote>
Which worked for a brick cylinder wall.
<p>hope that helps
<br>cheers
<br>Peter
<pre>--
pab-opto, Freiburg, Germany, www.pab-opto.de</pre>
</html>
--------------A522AABA7AADAA10EF38208A--