POV-Ray : Newsgroups : povray.binaries.images : "Spinner" space colony (2) : Re: "Spinner" space colony (2) Server Time
31 Jul 2024 10:19:16 EDT (-0400)
  Re: "Spinner" space colony (2)  
From: SharkD
Date: 14 Jun 2010 19:31:17
Message: <4c16bbc5$1@news.povray.org>
On 6/14/2010 7:03 PM, Alain wrote:
> Le 2010-06-14 18:12, SharkD a écrit :
>> What kinds of things might be the causes of all the slowdown? I've
>> turned off all media and reflection and it is still abysmally slow.
>>
>> One major revision I've made to Chris Colefax's CityGen include file is
>> that each building is now called by a macro and generated individually
>> at runtime. Whereas originally a single copy (more or less) of a
>> building was stored in an array and replicated/duplicated when needed.
>>
>> The other difference of course is that buildings now have greater
>> complexity. They make use of more CSG operations and feature a greater
>> number of storeys.
>>
>
> You have a "concave" geometry composed of many objects made out of
> coaxyal cylinders slices. This can very easily lead to bounding problems
> where most objects bounding boxes overlap each other, and are
> excessively large.
>
> Try manualy bounding the individual buildings. Try to see if you can use
> some mesh.
> Use simple boxes or prisms for narrow buildings and some of the farder
> ones. Some/most broad buildings probably can do with only a texture that
> curves instead of the actual floors.
>
> Except for the closest buildings, don't model individual floors. A flat
> topped conical building can be a simple truncated cone. The flat base
> beed hiden under the ground. If needed, remove a small cylindrical part
> from it's top.
>
> Only model the interior of a building IF you look from it's inside or
> take a closeup look into it. Use conditional statements, possibly based
> on insideness test or bounding box test to toggle the insides as needed.
>
>
>
> Alain

Here's the macro I use to generate the concave cylinder sections:

#macro cyl_box(in_star, in_stop)
	#local in_star_height	= city_radius - in_star.y;
	#local in_stop_height	= city_radius - in_stop.y;
	#local in_star_z_angle	= in_star.x/city_circum * 360;
	#local in_stop_z_angle	= in_stop.x/city_circum * 360;
	difference
	{
		cylinder {<0,0,in_star.z-0>, <0,0,in_stop.z+0>, in_star_height}
		cylinder {<0,0,in_star.z-1>, <0,0,in_stop.z+1>, in_stop_height}
		plane {+x, 0 rotate z * in_star_z_angle}
		plane {-x, 0 rotate z * in_stop_z_angle}
		bounded_by {cylinder {<0,0,in_star.z-0>, <0,0,in_stop.z+0>, 
in_star_height}}
	}
#end

Can I use an object produced by this macro as a bounding object? Would 
it be better to use a mesh instead? Does bounding work on unions and 
merges as well as differences and intersections?

-- 
http://isometricland.com


Post a reply to this message

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