POV-Ray : Newsgroups : povray.newusers : Animating with CSG : Re: Animating with CSG Server Time
28 Jul 2024 22:30:52 EDT (-0400)
  Re: Animating with CSG  
From: Sherry Shaw
Date: 28 Jun 2007 11:21:56
Message: <4683d214@news.povray.org>
LikeNoOther wrote:

>Hi.
>
>I have to create a program or script to cut a 3D model into layers(slices).
>The layers will look similar to CT scans (X-rays).
>To do this I can use two planes to cut 3D model.
>  
>

Or, possibly, intersect it with a box or cylinder.  If you're slicing up 
a mesh, you'll need to give it an inside_vector.

>I just have to do an animation and move the places upward through the model.
>I understand what to do, unfortunately I don't know exactly how to do this.
>  
>

Either the "clock" or "frame_number" variable could be used.  Based on 
your description, I think "frame_number" would be a lot easier to work with.

>There is another problem with this. I have to be able to use a 3D mesh from
>either 3DS or Lightwave format. When I convert it to POV-Ray, the model is
>not centered at the origin.
>
>Can a script center the object?
>
>The layers must start from the bottom and run to the top of the model making
>vertical layers(slices).
>
>Is there a way to determine where the lowest y value is in the mesh?
>(I don't think so..)
>  
>

If you're using PoseRay to convert the model to Pov format, check the 
comments at the top of the include file.  PoseRay (or at least the 
version I have, v3.8.2.327) includes the bounding box coordinates when 
it builds the file.  The direct route, though, would be to use 
min_extent and max_extent, where min_extent(MyObject).y represents the 
lowest y value.

You can center the object as Simon noted, or you can use the 
Center_Trans macro from transforms.inc (which also includes some other 
nifty stuff as well).

(BTW, you might want to have a close look at the scale of the imported 
object.  For example, my Stanford bunny came out of PoseRay with a 
bounding box of  < -0.09469, 0.032987, -0.061874 > to < 0.061009, 
0.187321, 0.0588 >, which is awkwardly tiny.  I generally use "scale 
100" or so to get him into a more practical size range.)

Hope this helps...

--Sherry Shaw

-- 
#macro T(E,N)sphere{x,.4rotate z*E*60translate y*N pigment{wrinkles scale
.3}finish{ambient 1}}#end#local I=0;#while(I<5)T(I,1)T(1-I,-1)#local I=I+
1;#end camera{location-5*z}plane{z,37 pigment{granite color_map{[.7rgb 0]
[1rgb 1]}}finish{ambient 2}}//                                   TenMoons


Post a reply to this message

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