POV-Ray : Newsgroups : povray.general : a simple 3ds max box not centered and resized correctly in povray Server Time
4 Nov 2024 17:34:31 EST (-0500)
  a simple 3ds max box not centered and resized correctly in povray (Message 1 to 4 of 4)  
From: optima
Subject: a simple 3ds max box not centered and resized correctly in povray
Date: 30 May 2010 11:05:01
Message: <web.4c027d3a62f0ad8adf816feb0@news.povray.org>
Hi,

First let me tell you I am no stranger to 3dsmax or povray for 2 years I am
developing and selling a professional application built with files
imported/exported and/or used by these 2 applications and C#


I export a box (cube) in 3ds format from 3ds max (2009 64 bit)
then import it into PoseRay v3.12.2.456 then export it as box.inc file for use
in Povray.

But the box is not correctly positioned or sized in povray it's off place and
oversized. PROBLEM IS CORRECTED IF I DIVIDE BOX'S XYZ DIMENSIONS INSIDE POVRAY
CODE BY 2.54 or if I resize the box inside max to 39.37 cm instead of 100 cm.
Same thing when 100 / 2.54 = 39.37  As you know 1 inch is 2.54 centimeters.

I size the box in max to 100 cm cause in povray I scale <0.025,0.025,0.025>
then multiply with a rescale scale<50,75,60>
meaning box is 50 cm wide, 75 cm high, 60 cm deep.

Box created this way in max
-Create a box object  (aka cube) make it 100 cm in all 3 xyz dimensions
-Pivot / Affect Pivot Only / Center to object
-Move object to 0,0,0 on world position by right clicking Move toolbar icon
-exported as 3ds object

in 3ds Max System unit scale  1 unit = 1 centimeters

What setting do I need to change in max to consistenly export to the same
dimensions every time? Customize/Unit Setup/System unit scale  dont work I tried
many times. Box is a simple example I gave, some other models downloaded from
the net also results in the same erroneous condition (oversized 2.54 times) I
think Max's unit system from cm to inch is causing all this trouble but changing
units (System Unit Scale in max) and redoing everything same does not solve the
issue?

or is it PoseRay v3.12.2.456 causing the error when saving the inc file?
Sorry for such a long question, but I am really stuck for 2 days and have almost
no one else to turn to. Thank you for any input you can provide. I will deeply
appreciate all types of help. I MUST BE MISSING SOMETHING BIG.


BELOW IS THE _GEOM INC. FILE EXPORTED FROM POSERAY

//==================================================
//POV-Ray Geometry mesh list
//==================================================
//This file has been created by PoseRay v3.12.2.456
//3D model to POV-Ray/Moray Converter.
//Author: FlyerX
//Email: fly### [at] yahoocom
//Web: http://mysite.verizon.net/sfg0000/
//==================================================
//Files needed to run the POV-Ray scene:
//box_POV_main.ini (initialization file - open this to render)
//box_POV_scene.pov (scene setup of cameras, lights and geometry)
//box_POV_geom.inc (geometry mesh)
//box_POV_mat.inc (materials)
//
//==================================================
//Model Statistics:
//Number of triangular faces..... 12
//Number of vertices............. 26
//Number of normals.............. 30
//Number of UV coordinates....... 26
//Number of lines................ 0
//Number of materials............ 1
//Number of groups/meshes........ 1
//Number of subdivision faces.... 0
//UV boundaries........ from u,v=(0,0)
//                        to u,v=(1,1)
//Bounding Box....... from x,y,z=(-49.999,0.001,-50.001)
//                      to x,y,z=(50.001,100.001,49.999)
//                 size dx,dy,dz=(100,100,100)
//                  center x,y,z=(0.0009994507,50.001,-0.0009994507)
//                       diagonal 173.2051
//Surface area................... 60000
//             Smallest face area 5000
//              Largest face area 5000
//Memory allocated for geometry.. 5 KBytes
//
//==================================================


//Materials
#include "box_POV_mat.inc"

//Geometry
#declare box_unnamed_material_=mesh2{
vertex_vectors{
26,
<-49.999,0.001,49.999>,
<-49.999,0.001,-50.001>,
<50.001,0.001,-50.001>,
<50.001,0.001,49.999>,
<-49.999,100.001,49.999>,
<50.001,100.001,49.999>,
<50.001,100.001,-50.001>,
<-49.999,100.001,-50.001>,
<-49.999,0.001,49.999>,
<50.001,0.001,49.999>,
<50.001,100.001,49.999>,
<50.001,100.001,49.999>,
<-49.999,100.001,49.999>,
<-49.999,0.001,49.999>,
<50.001,0.001,-50.001>,
<50.001,100.001,49.999>,
<50.001,0.001,-50.001>,
<-49.999,0.001,-50.001>,
<-49.999,100.001,-50.001>,
<-49.999,100.001,-50.001>,
<50.001,100.001,-50.001>,
<50.001,0.001,-50.001>,
<-49.999,0.001,-50.001>,
<-49.999,100.001,49.999>,
<-49.999,100.001,49.999>,
<-49.999,0.001,-50.001>
}
normal_vectors{
30,
<0,-1,-6.122923E-17>,
<0,-1,-6.122923E-17>,
<0,-1,-6.122923E-17>,
<0,-1,-6.122923E-17>,
<0,1,0>,
<0,1,0>,
<0,1,0>,
<0,1,0>,
<0,-7.105427E-17,1>,
<0,-7.105427E-17,1>,
<0,-7.105427E-17,1>,
<0,-7.105427E-17,1>,
<0,-7.105427E-17,1>,
<0,-7.105427E-17,1>,
<1,0,0>,
<1,0,0>,
<1,0,0>,
<1,0,0>,
<0,7.105427E-17,-1>,
<0,7.105427E-17,-1>,
<0,7.105427E-17,-1>,
<0,7.105427E-17,-1>,
<0,7.105427E-17,-1>,
<0,7.105427E-17,-1>,
<-1,0,0>,
<-1,0,0>,
<-1,0,0>,
<-1,0,0>,
<-1,0,0>,
<-1,0,0>
}
uv_vectors{
26,
<1,0>,
<1,1>,
<0,1>,
<0,0>,
<0,0>,
<1,0>,
<1,1>,
<0,1>,
<0,0>,
<1,0>,
<1,1>,
<1,1>,
<0,1>,
<0,0>,
<1,0>,
<0,1>,
<0,0>,
<1,0>,
<1,1>,
<1,1>,
<0,1>,
<0,0>,
<0,0>,
<1,1>,
<1,1>,
<0,0>
}
face_indices{
12,
<0,1,2>,
<2,3,0>,
<4,5,6>,
<6,7,4>,
<8,9,10>,
<11,12,13>,
<3,14,6>,
<6,15,3>,
<16,17,18>,
<19,20,21>,
<22,0,23>,
<24,7,25>
}
uv_indices{
12,
<0,1,2>,
<2,3,0>,
<4,5,6>,
<6,7,4>,
<8,9,10>,
<11,12,13>,
<3,14,6>,
<6,15,3>,
<16,17,18>,
<19,20,21>,
<22,0,23>,
<24,7,25>
}
normal_indices{
12,
<0,1,2>,
<2,3,0>,
<4,5,6>,
<6,7,4>,
<8,9,10>,
<11,12,13>,
<14,15,16>,
<16,17,14>,
<18,19,20>,
<21,22,23>,
<24,25,26>,
<27,28,29>
}
inside_vector <0,0,1> }


//Model assembly from the meshes
#declare box_=
object{box_unnamed_material_  material{unnamed_material_} hollow}




--povray code for box/panel

//begin PANEL 1
#include "panel_POV_geom.inc"union{
#declare panel1= object {panel_ scale <0.025,0.025,0.025>}
object { panel1 scale <19.68504,29.52756,23.62205> pigment {image_map {jpeg
"A319_akcaagac.jpg"}scale 1 }
finish {phong 1 ambient 0.6 reflection 0.08}}
rotate <0,360,0> translate <-233.6575,14.76378,84.311>}
//end PANEL 1

in the second scale xyz is divided by 2


Post a reply to this message

From: Christian Froeschlin
Subject: Re: a simple 3ds max box not centered and resized correctly in povray
Date: 30 May 2010 11:37:42
Message: <4c028646$1@news.povray.org>
optima wrote:

> What setting do I need to change in max to consistenly export to the same
> dimensions every time? Customize/Unit Setup/System unit scale  dont work I tried
> many times. 

I'm afraid I don't quite understand the problem. You set up a box
100 units in size and the exported mesh seems to have coordinates
ranging from -50 to 50 which is also 100 units in size.

How you scale the unit to fit into your scene is another matter.
Units in povray are abstract and have no absolute real world size,
so you can't expect it to end up with a size of "100 cm" anyway.
You need to scale and translate according to your needs in SDL.


Post a reply to this message

From: optima
Subject: Re: a simple 3ds max box not centered and resized correctly in povray
Date: 30 May 2010 14:45:00
Message: <web.4c02b1834e0d2aabdf816feb0@news.povray.org>
Christian,

thank you for answering, I scale my models same way in povray and 3ds max but it
gives different results for different models, box was just an example.

My whole point is I size models to exactly same parameters in 3ds max and I use
exactly same povray code but their size differs by 2.54 times when rendered in
povray. Beware though these are models downloaded from internet so they have
been built to different dimension specifications in 3ds max. BUT I reopen them
in max and resize them to what I described in my original post and some of them
are oversized by 2.54 times. How do I know this? When I divide model's
dimensions by 2.54 as in scale <50/2.54,75/2.54,60/2.54>  in pov code,
everything fits nicely together.

The box is just a weird example of what I'm trying to say, how come a box I size
to 100 cm in max and scale to  scale <0.025,0.025,0.025> then scale to
 scale <50,75,60> doesn't come out to be 50 cm wide, 75 cm high and 60cm deep
when pov renders it?

I used this same technique for sizing objects in max and povray for almost 2
years now. But for some reason it fails me presently.

meanwhile I made some platform changes though,
- went from 3ds max 2008 32 bit to 3dsmax 2009 64bit
- went from windows xp to windows 7 64bit
- a newer version of poseray

I dont know what these have to do with it? but I list them anyway.
Thank you very much, I am almost sure 3ds max is causing all this trouble,
something in Unit Scale System of max I currently use is different but WHAT? I
appreciate your help.

Christian Froeschlin <chr### [at] chrfrde> wrote:
> optima wrote:
>
> > What setting do I need to change in max to consistenly export to the same
> > dimensions every time? Customize/Unit Setup/System unit scale  dont work I tried
> > many times.
>
> I'm afraid I don't quite understand the problem. You set up a box
> 100 units in size and the exported mesh seems to have coordinates
> ranging from -50 to 50 which is also 100 units in size.
>
> How you scale the unit to fit into your scene is another matter.
> Units in povray are abstract and have no absolute real world size,
> so you can't expect it to end up with a size of "100 cm" anyway.
> You need to scale and translate according to your needs in SDL.


Post a reply to this message

From: "Jérôme M. Berger"
Subject: Re: a simple 3ds max box not centered and resized correctly in povray
Date: 30 May 2010 15:22:28
Message: <4c02baf4$1@news.povray.org>
optima wrote:
> Christian,
> 
> thank you for answering, I scale my models same way in povray and 3ds m
ax but it
> gives different results for different models, box was just an example.
> 
> My whole point is I size models to exactly same parameters in 3ds max a
nd I use
> exactly same povray code but their size differs by 2.54 times when rend
ered in
> povray. Beware though these are models downloaded from internet so they
 have
> been built to different dimension specifications in 3ds max. BUT I reop
en them
> in max and resize them to what I described in my original post and some
 of them
> are oversized by 2.54 times. How do I know this? When I divide model's
> dimensions by 2.54 as in scale <50/2.54,75/2.54,60/2.54>  in pov code,
> everything fits nicely together.
> 
> The box is just a weird example of what I'm trying to say, how come a b
ox I size
> to 100 cm in max and scale to  scale <0.025,0.025,0.025> then scale to
>  scale <50,75,60> doesn't come out to be 50 cm wide, 75 cm high and 60c
m deep
> when pov renders it?
> 
> I used this same technique for sizing objects in max and povray for alm
ost 2
> years now. But for some reason it fails me presently.
> 
> meanwhile I made some platform changes though,
> - went from 3ds max 2008 32 bit to 3dsmax 2009 64bit
> - went from windows xp to windows 7 64bit
> - a newer version of poseray
> 
> I dont know what these have to do with it? but I list them anyway.
> Thank you very much, I am almost sure 3ds max is causing all this troub
le,
> something in Unit Scale System of max I currently use is different but 
WHAT? I
> appreciate your help.
> 
	Is there some setting in max or poseray which allows you to choose
between centimeters and inches? The reason I'm asking is that 2.54
is precisely the ratio between inches and centimeters, so if you are
scaling to 100 in max, are you sure those are always 100cm and not
100 inches?

		Jerome
-- 
mailto:jeb### [at] freefr
http://jeberger.free.fr
Jabber: jeb### [at] jabberfr


Post a reply to this message


Attachments:
Download 'us-ascii' (1 KB)

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