Sloped 3d floor planes

Advanced OpenGL source port fork from ZDoom, picking up where ZDoomGL left off.
[Home] [Download] [Git builds (Win)] [Git builds (Mac)] [Wiki] [Repo] [Bugs&Suggestions]

Moderator: Graf Zahl

Locked
printz
Posts: 30
Joined: Sat May 09, 2009 23:09

Sloped 3d floor planes

Post by printz »

I'm in the process of writing a program that converts Quake maps into GZDoom 3d floor structures. Among other things, the program will place all the control sectors on a grid at the side of the playable area. The program should accept sloped 3d floors, and therefore the corresponding control sectors will be triangles having vertex zfloor and zceiling values belonging to the 3d floor planes.

Here's what I'd like to be sure about: if a 3d floor is too steep, its planes' Z coordinates might mathematically go beyond the 16-bit limit by the time they reach the control sector's XY coordinates [the program won't place them optimally to be at the same elevation]. Do they actually wrap around in GZDoom? If they do, then it means that the zfloor and zceiling values of the controller sector can stay within the 16-bit limit too, and fit with the planes, which will wrap back around nicely until they meet with the 3d floor map sector(s), and render them where they're expected to be.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Sloped 3d floor planes

Post by Graf Zahl »

Planes are represented by plane equations and one equation will represent precisely one plane. Although values wrap around at some time this won't result in the plane being duplicated. In some calculations it may appear to work but there will be unpredictable overflows in others if a plane's absolute z value is too large. What you want to do here won't work.

Especially the GL renderer will fail to handle this because it performs many slope calculations with floating point to prevent such overflows from happening. So even at best your wrapped around plane will not be rendered correctly.
printz
Posts: 30
Joined: Sat May 09, 2009 23:09

Re: Sloped 3d floor planes

Post by printz »

Thanks for the detailed explanation. And I think I can easily make the program place the control sectors in a safe XY location after all. There will be a location around the playable area, with equal elevation with the rendered 3d floor.
Locked

Return to “GZDoom”