POV-Ray : Newsgroups : povray.general : Feature Request: Easy Iso : Re: Feature Request: Easy Iso Server Time
9 Aug 2024 15:24:10 EDT (-0400)
  Re: Feature Request: Easy Iso  
From: Anton Sherwood
Date: 13 Aug 2000 02:36:44
Message: <39964397.4C636C6C@pobox.com>
Chris Huff wrote:
> The object pattern will only work for objects that are solid, and it
> isn't very friendly with the isosurface solving method. It is a "block
> pattern", and has only one of two states...basically meaning it has an
> infinite max_gradient. The isosurface algorithm can't easily cope with
> this.

I'm coming into this late and ignorant (haven't even compiled megapov
yet), so ignore me if I say something too stupid ...

Rune asked for a "function" equivalent to a given cone.  What about
having this mean a function of the angle between the point in question,
the tip of the cone and the axis of the cone, ranging from 0 (axis,
outside) to 1 (axis, inside), adjusted so that a point on the surface of
the cone has function value 1/2 ?

The base of the cone can be represented by a ramp function, and thus the
whole finite cone function is the min() of these two.

To illustrate, suppose a standard cone has its apex at the origin, its
base at y=-1, and a 45 degree slope ...

	float cone (float x, float y, float z)
	{
	float r = sqrt(x*x+z*z);
	return 0.5 - atan2(y+r,r)/pi;
	}

	float cone_base (float x, float y, float z)
	{
	if (y<-2) return 0;
	if (y>0) return 1;
	return 1+y/2;
	}

	float finite_cone (float x, float y, float z)
	{
	return min( cone(x,y,z), cone_base(x,y,z) );
	}

-- 
Anton Sherwood  --  br0### [at] p0b0xcom  --  http://ogre.nu/


Post a reply to this message

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