Duplicating Softimage Texturing in OpenGL
X-Y-Z Planar
Softimage wraps a texture on an object depending on how large the object is.
To replicate the effect in a CAVE program:
- Keep track of the largest and smallest X-Y-Z values when loading the model
verticies.
- Use (Vy - MinY)/(MaxY - MinY) to assign the U/V values.
Alternatively, you can use the TexGen function. Place the planes in the
smallest coodinates and futz around with the normal length until you get the
coverage you want. For example, X-Z planar means you would need to assign
the U values to a plane with (A,B,C,D) values of the form (?,0,0,MinX) where
? is a positive value. V would be of the form (0,0,?,MinZ).
X-Y-Z Cylindrical
- Keep track of the maximum and minimum values of the model verticies in the
cylinder vector.
- Assign the V values based on (Vy - MinY)/(MaxY - MinY).
- Calculate the U values bases on atan2(Vx, Vz)/(2*M_PI).
- Add 1 to the U value if the current polygon's U values span a threshold
value. (This prevents the texture from repeating itself within one polygon.)
X-Y-Z Spherical
- Calculate the U values based on atan2(Vx, Vz)/(2*M_PI). Add 1 if
necessary.
- Calculate the V values based on atan2(Vy, sqrt(Vx*Vx + Vz*Vz))/(2*M_PI).
Add 1 if necessary.
U/V
Assign U/V directly if it is available in the .hrc file. It is possible to
convert any 2-D texture map method into U/V in softimage using TextureOperators->InfoUV.
Back to Main