POV-Ray : Newsgroups : povray.binaries.images : Floors, rails, stairs and roofs, detail! : Re: Floors, rails, stairs and roofs, detail! Server Time
24 Apr 2024 12:22:41 EDT (-0400)
  Re: Floors, rails, stairs and roofs, detail!  
From: Bill Pragnell
Date: 28 Nov 2021 17:05:00
Message: <web.61a3fc0aae5fec9b96893c06f35e431@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> I'm of course curious about the method/rules you're using to assemble all the
> parts, and how many lines of code you're up to now!  ;)

It's basically a grid of cells in a 3D array. Each cell is 0 (empty), 1 (floor),
10-13 (staircase), or 20-23 (above staircase). The grid starts with a random set
of floor cells, then a subsequent pass places stair values, being careful to
avoid collisions. The final stage makes the geometry for each cell, looking at
nearest neighbours to decide what kind of rails and posts should be used. I have
a large set of very small macros to help with this - IsFloor(I,J,K),
IsCorner(I,J,K,Dir) etc - which all build on each other to make a relatively
readable pile of logic that then calls another set of macros to make the actual
geometry. I've put the geometry helpers into another file to avoid confusion, so
the main scene file is really just grid management. The two files together are
about 650 lines at present.

> Great work - after so many years of making great POV-Ray renders, you're still
> knocking impressive scenes out of the park!

I look at POV-Ray as a little 'comfort programming' environment - the
limitations of SDL allow a sort of purity to problem-solving. I'm a developer by
day, so POV-Ray allows me to indulge in small-scale projects outside work that
don't become time-sinks. And as a bonus, the output looks nice :)

Bill


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.