
The renderDepth function assumes that the vertical direction of the walls is the Z axis, since that's how pagal's situation is described in one of his earlier posts in this thread.
But this time, the Z coordinate is not changing. So you have to change slightly the equations.
For instance, if your vertical axis is the Y coordinate, replace :
glTexCoord2dv(lower_left_texcoord);glVertex3dv(lower_left_wall);glTexCoord2d(upper_right_texcoord[0], lower_left_texcoord[1]);glVertex3d(upper_right_wall[0], upper_right_wall[1], lower_left_wall[2]);glTexCoord2dv(upper_right_texcoord);glVertex3dv(upper_right_wall);glTexCoord2d(lower_left_texcoord[0], upper_right_texcoord[1]);glVertex3d(lower_left_wall[0], lower_left_wall[1], upper_right_wall[2]);
with :
glTexCoord2dv(lower_left_texcoord);glVertex3dv(lower_left_wall);glTexCoord2d(upper_right_texcoord[0], lower_left_texcoord[1]);glVertex3d(upper_right_wall[0], lower_left_wall[1], upper_right_wall[2]);glTexCoord2dv(upper_right_texcoord);glVertex3dv(upper_right_wall);glTexCoord2d(lower_left_texcoord[0], upper_right_texcoord[1]);glVertex3d(lower_left_wall[0], upper_right_wall[1], lower_left_wall[2]);
and replace :
{solve_linear(lower_left_wall[2], upper_right_wall[2], lower_left_door[2], upper_right_door[2], &lower_left_texcoord[1], &upper_right_texcoord[1]);if (fabs(upper_right_wall[0]-lower_left_wall[0]) > fabs(upper_right_wall[1]-lower_left_wall[1])) solve_linear(lower_left_wall[0], upper_right_wall[0], lower_left_door[0], upper_right_door[0], &lower_left_texcoord[0], &upper_right_texcoord[0]);else solve_linear(lower_left_wall[1], upper_right_wall[1], lower_left_door[1], upper_right_door[1], &lower_left_texcoord[0], &upper_right_texcoord[0]);}
with:
{solve_linear(lower_left_wall[1], upper_right_wall[1], lower_left_door[1], upper_right_door[1], &lower_left_texcoord[1], &upper_right_texcoord[1]);if (fabs(upper_right_wall[0]-lower_left_wall[0]) > fabs(upper_right_wall[2]-lower_left_wall[2])) solve_linear(lower_left_wall[0], upper_right_wall[0], lower_left_door[0], upper_right_door[0], &lower_left_texcoord[0], &upper_right_texcoord[0]);else solve_linear(lower_left_wall[2], upper_right_wall[2], lower_left_door[2], upper_right_door[2], &lower_left_texcoord[0], &upper_right_texcoord[0]);}
This should do the trick.
hope this helps, I haven't looked at your code completely but at least what I've written here should be done as long as the Z coordinate of your wall is constant over the wall.
[edited by - vincoof on July 26, 2003 10:57:46 AM]