Jump to content
  • Advertisement

Archived

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

ozric

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.

If you intended to correct an error in the post then please contact us.

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]

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
test email notification

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!