Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Scale object, and remember the new scale

Author
Message
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Dec 2011 16:42
In a loop, this....

scale object total,object size x(total)+1, object size y(total)+1, object size z(total)+1

Will stop after the first scale UP. That's because the scale isn't remembered. I want the same loop, but with the new scale added to the last scale. I just want a simple command if possible. I don't want to store all of the scales in a DIM because I have at least 600000 of them.

Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 29th Dec 2011 16:47
Adding a flag value of 1 to the object size functions will retrieve the current size (as opposed to the default size you get when not providing the flag / setting it to zero). You should be able to make use of both those functionalities to determine the current scale of the object like so:


Also remember that the scale object function takes a percentage value, with 100 being the standard scale.


"Why do programmers get Halloween and Christmas mixed up?"
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 29th Dec 2011 16:55
Quote: "scale object total,object size x(total)+1, object size y(total)+1, object size z(total)+1"

scale object total, object scale x(total)+1, object scale y(total)+1, object scale z(total)+1

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Dec 2011 17:05 Edited at: 29th Dec 2011 17:09
Hmmm, this still stops scaling....



Edit: Just saw Brendy Boy's answer. Nope, still doesn't work.

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Dec 2011 17:13
Fixed it thanks! I had another check I forgot about that exited the loop.

david w
20
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 29th Dec 2011 17:59
I don't know if this will be of any help to you, but you could use the vertexdata commands and scale the vertices by your percentage. In this fashion you would not have to store the scales but they would be in the mesh and in addition if you need to know how much they have been scaled you have a reference mesh that you could check the difference against any arbitraily scaled mesh. This would give you your x,y,z scale percentages and in addition you would not have to have a lage array that stores each meshes scale.

Login to post a reply

Server time is: 2026-07-09 23:12:19
Your offset time is: 2026-07-09 23:12:19