texture mapping

Hi community,

I have a question regarding texture mapping.
For rendering leaves of a tree a I have a scanned photograph that I have to
map on the geometry of a leave.
Each leave is a created (in the software xfrog) as a triangle mesh that has
for each vertex x,y,z coordinates, a normal vector and u and v coordinates.

Having this information, how do I use colorpict to map the photo exactly right
on each triangle ?
Any hints are helpfull.

Iebele

For those who like to see the project involved (work in progress, quicktime
vr's), look at
http://www.toren.com/maris

Check out the thread on "Using OBJ2MESH utility" -- this talks about the new mesh primitive in Radiance 3.5 for mapping uv coordinates on complex mesh geometry. I think this could help you a lot.

-Greg

···

From: "atelier iebele abel - toren.com" <[email protected]>
Date: Fri May 16, 2003 5:50:03 AM US/Pacific

Hi community,

I have a question regarding texture mapping.
For rendering leaves of a tree a I have a scanned photograph that I have to
map on the geometry of a leave.
Each leave is a created (in the software xfrog) as a triangle mesh that has
for each vertex x,y,z coordinates, a normal vector and u and v coordinates.

Having this information, how do I use colorpict to map the photo exactly right
on each triangle ?
Any hints are helpfull.

Iebele

For those who like to see the project involved (work in progress, quicktime
vr's), look at
http://www.toren.com/maris

Hi Greg,

Thanks for your reply. I start to get some bettter results, but still I
have some questions:

Q1.

I experimented with texture cordinates in the tmesh.cal parameters.
Instead of u and v I used :
mod(u,max(1,1)) mod(u,max(1,1))
I don't know what this really means, but I tried to tile the texture,
like in picture.cal (tile_u tile_v)
I get good results for only one part of my model ( the trunk of the tree
) but other parts (the leaves) act very strange.
Do you have a suggestions? And where can I find some documentation about
mod, frac, tri etc... (It is not explained in the book, is it?)

Q2.

When using tmesh2rad I specify a picture (-p). But what if I need a
tranparant texture?
Following your suggestion somewhere else in this discussion I create a
transparant picture like the example below.
These do not have texture coordinates like above, but as you will
understand, I cannot write such for each triangle of a leave (more as
20.000 in a tree).
Do you have a tip or workaround for this?

Iebele

···

________________
#my transparant picture example

void colorpict AL05lef 15 red green blue
/disk12/_3DLIB/bomen/AL05_Aesculus_hippocastanum_Horse_Chestnut/AL05lef.pic

picture.cal
tile_u tile_v
-s 1
-rx 0
-ry 0
-rz 0
0 1 1

AL05lef plastic AL05lef_map
0 0 5
1 1 1
0 0

void mixpict leaf_col_leaf2
11 AL05lef_map void green
/disk12/_3DLIB/bomen/AL05_Aesculus_hippocastanum_Horse_Chestnut/AL05lef-alpha.pic

picture.cal tile_u tile_v -s 1.0 -rz 0
0
0

______________________________

Greg Ward wrote:

Check out the thread on "Using OBJ2MESH utility" -- this talks about
the new mesh primitive in Radiance 3.5 for mapping uv coordinates on
complex mesh geometry. I think this could help you a lot.

-Greg

> From: "atelier iebele abel - toren.com" <[email protected]>
> Date: Fri May 16, 2003 5:50:03 AM US/Pacific
>
> Hi community,
>
> I have a question regarding texture mapping.
> For rendering leaves of a tree a I have a scanned photograph that I
> have to
> map on the geometry of a leave.
> Each leave is a created (in the software xfrog) as a triangle mesh
> that has
> for each vertex x,y,z coordinates, a normal vector and u and v
> coordinates.
>
> Having this information, how do I use colorpict to map the photo
> exactly right
> on each triangle ?
> Any hints are helpfull.
>
> Iebele
>
> For those who like to see the project involved (work in progress,
> quicktime
> vr's), look at
> http://www.toren.com/maris

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

Hi Lebele,

From: "atelier iebele abel - toren.com" <[email protected]>

Q1.

I experimented with texture cordinates in the tmesh.cal parameters.
Instead of u and v I used :
mod(u,max(1,1)) mod(u,max(1,1))
I don't know what this really means, but I tried to tile the texture,
like in picture.cal (tile_u tile_v)
I get good results for only one part of my model ( the trunk of the tree
) but other parts (the leaves) act very strange.
Do you have a suggestions? And where can I find some documentation about
mod, frac, tri etc... (It is not explained in the book, is it?)

Chapter 4 in "Rendering with Radiance" covers some of the basics of .cal file construction, but many of the specifics you just have to pick up from looking at other .cal files, particularly the rayinit.cal file in ray/src/rt/.

I don't understand how you got any results from mod(u,max(1,1)) mod(u,max(1,1)), since the variable "u" is not defined. You should have gotten an error from this specificaiton. Probably what you meant to use was frac(Lu) frac(Lv), which are the same as mod(Lu,1) mod(Lv,1). The functions frac(x) and mod(n,d) are defined in rayinit.cal. This specification should work for a square image tile.

Q2.

When using tmesh2rad I specify a picture (-p). But what if I need a
tranparant texture?
Following your suggestion somewhere else in this discussion I create a
transparant picture like the example below.
These do not have texture coordinates like above, but as you will
understand, I cannot write such for each triangle of a leave (more as
20.000 in a tree).
Do you have a tip or workaround for this?

Yes -- instead of using tile_u and tile_v with picture.cal, specify "." for the .cal file and use frac(Lu) and frac(Lv) in both your colorpict and your mixpict primitives, using obj2mesh rather than tmesh2rad to convert your models. Does this make sense?

-Greg