POV-Ray : Newsgroups : povray.general : What Function to use : Re: What Function to use Server Time
1 Aug 2024 04:09:53 EDT (-0400)
  Re: What Function to use  
From: Jim Charter
Date: 18 Apr 2006 08:52:39
Message: <4444e117$1@news.povray.org>
POVMAN wrote:
> I have an irregular csg object and I want to have objects ( cylinders ) 
> stand perpendicular to the surface.  Imagine the csg as being a box, sphere 
> and cylinder union.
> 
> I'm familiar with using "trace" to place objects (cylinders ) on a surface, 
> but I want these objects to stick out from the csg object.
> 
> I've set up a model where I can use "trace" to identify where the object is 
> to be placed on the surface of the csg but the vector I need to rotate the 
> object ( cylinder ) through is beyond me.
> 
> Tips Hints anybody?
> 
trace() returns the normal as the forth parameter


you orient your cylinder using Reorient_Trans()

ie
if you did:
#local Position =
trace ( MyObject, Start, Direction, Normal )


then if your cylinder is in the y axis

then:
cylinder { y*0, y*1, .2
	Reorient_Trans(y, Normal)
	translate Position
}


Post a reply to this message

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