Advertisement

planar texture mapping

Started by March 21, 2003 05:45 AM
-1 comments, last by earthworm 21 years, 11 months ago
hi, im trying to render QuakeII bsp files with my own loader and software renderer. i got md2/md3 models working fine, but bsp is a bitch. i can''t seem to get the texture projection right. this is the technique given (http://www.flipcode.com/tutorials/tut_q2levels.shtml): u = x * u_axis.x + y * u_axis.y + z * u_axis.z + u_offset v = x * v_axis.x + y * v_axis.y + z * v_axis.z + v_offset this supposedly projects a vertex onto the texture to give you your u/v coords. the numbers i get back are in the -600 - 600 ish range ish. i have tried scaling these number by the texture size and writing a renderer that wraps round texture on a 0.0 - 1.0 basis. i didn''t work. i have tried just using the numbers as u/v, it didn''t work. i''ve seen some stuff suggestiong that openGL (which i''m NOT using) takes its tex coords based on the min and max tex coords but im not sure. i can''t find a single decent tutorial on this projection techique. if anyone knows about this stuff it would be a great help. thanks in advance. earthworm

This topic is closed to new replies.

Advertisement