Jpez1432 Posted May 25, 2004 I am working on a opengl port, the gwa files from glbsp are loaded, linedefs are drawn (no textures) but what I can't figure out is how to render the floors, ceiling planes... anyone know anything reply to this post. -James Pezold -Jpezold@mail.win.org -Jpez1432 0 Share this post Link to post
Infinite Ammunition Posted May 30, 2004 Look at the ZdoomGL code and see how they do it 0 Share this post Link to post
timmie Posted May 31, 2004 basically, it looks like this: glBegin(GL_TRIANGLE_FAN); for (i = 0; i < subSector->numlines; i++) { seg = segs[subSector->firstline + i]; glVertex3f(seg->v1->x / (FRACUNIT * 1.f), floorheight, seg->v1->y / (FRACUNIT * 1.f)); } glEnd(); for one plane you go 0..numlines and the other is the opposite. You could also bitshift the x/y values (>> FRACBITS), but you get better precision by dividing by FRACUNIT (and converting to floating point). For ZDoomGL, you have to query the sector plane for the height at a location (because of the slopes), but if you don't have to worry about slopes then just grab the floor/ceiling height normally. 0 Share this post Link to post