scaling up and down properly

0 views
Skip to first unread message

cellis

unread,
Aug 10, 2009, 5:12:25 PM8/10/09
to away3d.dev
Hello

i am trying to scale a mesh like this

scale = .2;
mesh.scale(scale);

this works, but when i do this

scale += .05
mesh.scale(scale);


it is smaller. Why?

David Parks

unread,
Aug 10, 2009, 9:41:15 PM8/10/09
to away3...@googlegroups.com
I believe the scale is always relative to the current size. So you reduced
it by 20% in the first round, then you reduced it by 25% in the second
round.
Dave

cellis

unread,
Aug 10, 2009, 11:05:04 PM8/10/09
to away3d.dev
i thought calling .scale() was setting it to that value, not
transforming it by a percentage??

Fabrice3D

unread,
Aug 11, 2009, 4:02:53 AM8/11/09
to away3...@googlegroups.com
The mesh.geometry object holds a scale variable. Allowing fast non
destructible scaling options.
If you want to apply a scale at vertex level, just parse the vertices
array and multiply the components.

Fabrice

Rob Bateman

unread,
Aug 21, 2009, 6:11:56 AM8/21/09
to away3...@googlegroups.com
if you want to set absolute scale, you can use the scaleX/scaleY adn scaleZ proprties

the scale() method applies a further scale to an already scaled object, in much the same way that scale() works on a native matrix object

Rob
--
Rob Bateman
Flash Development & Consultancy

rob.b...@gmail.com
www.infiniteturtles.co.uk
www.away3d.com
Reply all
Reply to author
Forward
0 new messages