#### Archived

This topic is now archived and is closed to further replies.

# Texture Mapping Functions - S.O.S

This topic is 5860 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello everybody. I have the following problem: Given a wrl object, I must define a function like the following in order to texturize the object : void Planar_Mapping(float size,float x,float y,float z,float v1[3],float v2[3]) { float u,t; u=x*v1[0]+y*v1[1]+z*v1[2]; t=x*v2[0]+y*v2[1]+z*v2[2]; glTexCoord2f(u/size,t/size); } void Mapping_Function(float x,float y,float z,int plane) { float vx[3],vy[3],vz[3]; vx[0]=1; vx[1]=0; vx[2]=0; vy[0]=0; vy[1]=1; vy[2]=0; vz[0]=0; vz[1]=0; vz[2]=1; switch (plane) { case 0: Planar_Mapping(100,x,y,z,vx,vy);break; case 1: Planar_Mapping(100,x,y,z,vy,vz);break; case 2: Planar_Mapping(100,x,y,z,vx,vz);break; } glVertex3f(x,y,z); } The above functions implement the box mapping. This works fine in my project but I must also implement spherical, cylindrical and shrink mapping the same way... Can anyone help me? I'm desperate because I'm a graphics rookie! Thanks anyway! [edited by - ozric on November 4, 2002 6:38:43 PM]

1. 1
Rutin
49
2. 2
3. 3
4. 4
5. 5

• 10
• 28
• 20
• 9
• 20
• ### Forum Statistics

• Total Topics
633409
• Total Posts
3011722
• ### Who's Online (See full list)

There are no registered users currently online

×