POV-Ray : Newsgroups : povray.advanced-users : How to calculate object size Server Time
3 Jul 2024 06:22:40 EDT (-0400)
  How to calculate object size (Message 1 to 3 of 3)  
From: badjanah
Subject: How to calculate object size
Date: 3 Jan 2008 08:15:04
Message: <web.477cded5f3c4b98ff2945ac50@news.povray.org>
I need to insert into povray scene some exported 3ds objects. Exported
objects are complex, have many polygons and vertex. How automatically
calculate object bounding box for scaling to needed size?


Post a reply to this message

From: Alain
Subject: Re: How to calculate object size
Date: 3 Jan 2008 10:34:12
Message: <477d0074@news.povray.org>
badjanah nous apporta ses lumieres en ce 2008/01/03 08:12:
> I need to insert into povray scene some exported 3ds objects. Exported
> objects are complex, have many polygons and vertex. How automatically
> calculate object bounding box for scaling to needed size?
> 
> 
> 
Get PoseRay (Free).
Import the 3DS object into PoseRay.
Here, you can rotate, translate and rotate the object if you wish.
Export the object to POV-Ray. This will create a file (.inc) that POV-Ray can 
use. That file will contain a mesh version of your object. You may also have 
some other files containing the materials to be used with the obect.

#include the file(s) from PoseRay into your scene.

Once the object is available to POV-Ray, you can use min_extent() and 
max_extent() to retreive the actual bounding box of that object and use that to 
scale it.
As the imported object is a mesh, you can use 1000's of it without problem.

-- 
Alain
-------------------------------------------------
Advertisements contain the only truths to be relied on in a newspaper.
Thomas Jefferson


Post a reply to this message

From: Sherry Shaw
Subject: Re: How to calculate object size
Date: 4 Jan 2008 19:37:24
Message: <477ed144@news.povray.org>
Alain wrote:
> badjanah nous apporta ses lumieres en ce 2008/01/03 08:12:
>> I need to insert into povray scene some exported 3ds objects. Exported
>> objects are complex, have many polygons and vertex. How automatically
>> calculate object bounding box for scaling to needed size?
>>
>>
>>
> Get PoseRay (Free).
> Import the 3DS object into PoseRay.
> Here, you can rotate, translate and rotate the object if you wish.
> Export the object to POV-Ray. This will create a file (.inc) that 
> POV-Ray can use. That file will contain a mesh version of your object. 
> You may also have some other files containing the materials to be used 
> with the obect.
> 
> #include the file(s) from PoseRay into your scene.
> 
> Once the object is available to POV-Ray, you can use min_extent() and 
> max_extent() to retreive the actual bounding box of that object and use 
> that to scale it.
> As the imported object is a mesh, you can use 1000's of it without problem.
> 

Also, the #include file created by PoseRay will include (as comments) 
the minimum and maximum x-, y-, and z-extents of the object, which *may* 
save you a step or two, at least in deciding precisely how to deal with 
the object.

--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.