Imported model size vs. scaling

Software: Away3D 4.x

Mike Samuel, Newbie
Posted: 31 July 2012 01:53 AM   Total Posts: 30

Hi,

Quick question: when importing 3ds models into away3d I usually end up scaling the loader up by 50-150. (most examples do the same)

I was wondering,  performance wise, would it be better to scale the model up by ~100 in Blender before exporting, to avoid the scaling in away3d?

regards

Mike

   

Mr Margaret Scratcher, Sr. Member
Posted: 31 July 2012 03:10 AM   Total Posts: 344   [ # 1 ]

I recently asked the same question, and in the end by trial and error I found that an object which was 1 metre high in blender needed to be scaled by 0.02 to end up 1 unit tall in away3d.

Bit odd, but it works…

   

Richard Olsson, Administrator
Posted: 31 July 2012 09:27 AM   Total Posts: 1192   [ # 2 ]

Mike Samuel: The best thing is usually to scale the geometry (in Blender, the “mesh” data block, ie going into edit mode, select all vertices and scale them) because that way you can start with a “fresh” transform matrix once you’re in Away3D. There’s no real performance difference though, because the matrix multiplication happens even if the matrix contains no transformation.

Mr Margaret Scratcher: How did you come to that conclusion? All measurements in Away3D are without any real-life unit, so one “unit” in Blender will also become one “unit” in Away3D (depending on whether some conversion happens during export, which usually it doesn’t.)

I’ve never configured Blender to use meters (is that even possible?) but generally in Blender a unit is considered relatively large (the standard cube is for instance 2x2x2 units) whereas in Away3D a unit is relatively small (the cube primitive is by default 100x100x100 units.) This is just a matter of perception though, because if you’re not using the default cube (or anything else with a default size) in either package it all just comes down to how far from your object you position your camera. In Away3D the camera is generally thousands of units away from the object, whereas in Blender I think it starts at 5 or so units in the default start-up scene.

   

Mr Margaret Scratcher, Sr. Member
Posted: 31 July 2012 11:58 AM   Total Posts: 344   [ # 3 ]

I came to that conclusion by making an object a metre tall, importing it and playing around with scaling the mesh until what I got was the same as a 1 unit high cube.

I didn’t configure blender to use metres, I think it must be quite a recent thing, I’m using blender 2.61

   

Mike Samuel, Newbie
Posted: 31 July 2012 08:19 PM   Total Posts: 30   [ # 4 ]

Seems like the questions wasn’t so simple after all. I was just wondering since every example one finds loading model usually does a 100 scale, and prefab also always points one one should scale up. SO why not avoid it, save some CPU. 

But it seems harder to work in blender if the model is scaled up that much. I find it best to stay within 5-10 units while working in blender.
So ya, if there is no real benefit,  it seems more convenient to scale in away3d, at least until a final release.

@ Mr.S :Funny you mention you have posted this kinda question already since I was really surprised to NOT find this question asked already. But then, I have to say I had some trouble with the search here.

Now maybe this is a wanted concept, maybe it is just me and my browser (FF 14 or whatever is newest does days). Whenever I search while being on a thread, like this one, the search turns up a white screen. No loading after, no redirect, nothing, just white. It took me a while to figure out I have to go up, to Forum level for the search to work. This seems a bit “strange”, especial since the text in the search box says:“search this forum.”

No piggy, just thought I mention it, since I actually did search, found nothing and then posted this question.

Thanx
Mike

   

Mr Margaret Scratcher, Sr. Member
Posted: 31 July 2012 09:52 PM   Total Posts: 344   [ # 5 ]

For me, the reason I worked in metres when making the objects for my last project was that all the dimensions were given in inches, and I was damned if I was going to convert and calculate outer and inner dimensions of 30 tube cross sections…

So, like I say, I took all the meausrements in inches, and made them in metres, and then multiplied by .02 to make an object that was 1 metre tall in blender the same height as an object that was 1 unit high in away3d..

Oh, and I did this to come up with a solution to extruding cross sections easily, with filled ends - make your cross section ‘1’ high, and then just scale along the y axis the required amount. No doubt if my maths and away3d skills were a bit better I could have specified the cross sections as a number of vertices and done it that way, but when i started to think about plotting a number of vertices around a circle, and doing the rounded edges of angle iron I decided to go the easy route..

   

Mike Samuel, Newbie
Posted: 31 July 2012 11:00 PM   Total Posts: 30   [ # 6 ]

@ Mr. Scratcher

Ya the inch thing is one peace of work, I just finishes a job in need of feet/inches with display, sometimes only in inches, sometimes feet/inch, but only down to 1/4. Hell, if you grow up with plain simple metric.

Ok, so now far far of topic of this thread,
partially for making me go turn metric in Blender and actually try out what you said, partially for making me think real hard and partially for spite.

When I turn on metric in Blender (2.63), ‘one blender unit’ turns into ‘one meter’ by default, so far so good.

That makes the model I work on about 4m x 5m x 2m. Now if I import this model into away3d, I need to scale up at least 50 to be able to see it.Yet, you state ...

and then multiplied by .02 to make an object that was 1 meter tall in blender the same height as an object that was 1 unit high in away3d

Assuming you mean scale by 0.02 when you say ‘multiply’, than means you shrunk your model by a factor of 50 .....hm, if I shrink my model by 0.1, is see ..well, not much more then a dot
I know, there can probably be a dozen other parameters different from your work and my test project, but you started it, you made me try it, now tell me why the .... you scale your model down when it is already tiny??? Please smile

As for the last part, that somehow sounds interesting and something I would like to know, but I don’t understand what you mean. Care to throw in a more detailed explanation, maybe a screen or two?

PS: All of this only if we don’t get into trouble wondering of topic,  I don’t wanna get kicked of the forum, I am just curious what it is you did with those pipes and why this makes extruding easier.

 

 

 

 

   

Richard Olsson, Administrator
Posted: 01 August 2012 07:11 AM   Total Posts: 1192   [ # 7 ]

I think you are both putting a little too much importance into units in 3D. In the real world, we have units (metric or imperial) because they actually mean something. The unit is agreed upon and defined based on some physical law (e.g. speed of light) or some prototype (e.g. the platinum metre in Sévre), both of which also exist in the real world.

Now, in virtual 3D worlds, we have no prototypes, and we have no laws of physics, so everything is relative and we can ourselves decide what unit system we want to use.

This can, and does, mean that any two tools might use different scales for their units. A scale that is considered big by one tool might actually be considered really small by another.

This also means that real-life units (e.g. metres, centimetres, inches, feet, yards) are all just meta-data that doesn’t actually mean anything more than a decimal point does. Sure, two objects that are both size 1 will be differently scaled if one has it’s size tagged with the “metre” meta-data and the other with the “centimetre” meta-data. But it’s not like these objects will actually match anything outside of the virtual world, and the unit meta-data is just a scale factor where “cm” means “multiply by 0.01”.

In some tools you can configure the program to use real-life units, but again, that’s just to simplify your authoring. As long as you’re not going to transfer your content into the physical world (e.g. if you’re doing CAD to plan an actual construction) the only thing that matters is the relative size between your objects (and things like where your camera is located, et c.)

To prove this, create a default cube in Blender and export it as OBJ. Open the OBJ file in a text editor and read the data. It will reach from (-1,-1,-1) to (1,1,1), so it’s 2x2x2 units big. Note that OBJ does not support unit meta-data, so the measurements are not given as metres or any other real-life unit, but just implied, anonymous scalars.

Now, configure Blender to use metres instead and export the OBJ again. You’ll see the exact same measurements in there. That’s because Blender knows very well that real-life units have no meaning in virtual worlds, so it actually keeps it’s no-unit representation internally, and that’s what the exporter uses.

Try again using Imperial units. You’ll see the same result. The cube still comes out as 2x2x2, even though completely different measurements are represented in the Blender UI.

So, where does this magic 2% (0.02) come from? Probably because a default cube in Blender is 2x2x2, whereas the default cube in Away3D is 100x100x100, i.e. there is a 0.02 ratio between the two. As we’ve seen, it doesn’t matter whether you configure Blender to use “no” units, metric units or imperial units. The exported output, and therefor also the ratio, will be the same.

Now, the unit meta-data still exists in Blender, because there are file formats that support unit meta-data, like CAD formats for example. That’s because in CAD the unit actually means something, because ultimately the goal is to end up with a physical product. If you’re not going to end up in the physical world however, trying to bother with units like this is just a waste of time and brain cycles.

So how do I recommend you work? Well, here are a couple of pointers:

- “Away3D units” are just scalars, so you can give them whatever meaning you want. If you’re on a project where all measurements for the models are given in feet, you can decide that 1 unit in Away3D == 1 feet. If units are given in mm, you can decide that 1 unit in Away3D == 1 mm. That should keep the math simple enough. If you ever need to display some real-life unit to the user (e.g. kilometres travelled in a game) you can easily calculate it from the number of “Away3D units”.

- Agree on a scale within your team before starting asset creation. If you decide that 1 unit is 1 centimetre, tell your modeler about that, and they can model their objects according to that scale. As long as all models are correctly scaled relative to each other everything will look fine.

- There is no “better scale” and the main reason why some tools use one scale and others use another is just legacy. If you prefer having small scales like in Blender, you can of course configure Away3D to work well with those as well, by for example moving the camera closer and setting it’s far/near clipping distances to smaller numbers than the defaults.


I hope this helps clarify some things!

   

Mr Margaret Scratcher, Sr. Member
Posted: 01 August 2012 12:46 PM   Total Posts: 344   [ # 8 ]

Aha, interesting - I did find it the .002 ratio a little odd!

Generally i think I would have just used blender units, not entirely sure why the config has changed to metres. I might see about changing that back in fact…

   

Mike Samuel, Newbie
Posted: 01 August 2012 04:12 PM   Total Posts: 30   [ # 9 ]

ya, I knew this would go out of hand. As educational and correct your answer is Richard, it was not my point to discuss unit labels.
I use whatever is default and all I care about is the ratio within one model.(Ok, you make sure that you use equal, comparable RL units to calculate the ratio, but that’s more or less implied)

I went and enabled metric in Blender and made up the example in order to try to understand why Mr. Scratcher scales his model DOWN even further in Away3D when I always have to scale UP

I still don’t understand why scaling down.
Is the camera very close in Away3d (maybe 50)?
Is the model in blender huge, (using 200 or 500 blender units) ?

It’ doesn’t really matter,  the 0.02 just caught my eye and my brain started wondering ...Why scale down, and why does this help in cross section extrusion stuff.

Regards

   

Mr Margaret Scratcher, Sr. Member
Posted: 02 August 2012 11:07 AM   Total Posts: 344   [ # 10 ]

I had to scale down I beleive because I was using metres in blender, rather than units.

And as for the cross section extrusion I was explaining how if you make the shape you want to extrude, and extrude it by ‘1’, you can then simply scale it to acheive the same result as getting just the cross section and extruding it, with the added bonus that the end faces are already filled..

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X