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 / Saving object scale

Author
Message
MSon
22
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 25th Nov 2010 21:07 Edited at: 25th Nov 2010 21:14
hi all

I've got a problem thats annoying me here, maybe i've just been staring at my computer screen too long.

In my editor when resizing an object, im using the following function which uses "Scale Object"



Then when it comes to saving the map i cant find any command to get x y and z scales separately so im using "Object Size X", Ect, But this means when i load the map, i dont have the Scale Value which i need to resize it so everythin is out of scale, i think i need to convert the saved size to xyz scales, but im unsure how, (or as i said, maybe i've been staring at the screen for just too long).

Heres my load and save functions



EDIT: I dont think there is any command to resize based on xyz Size values, Hence why im using scale, but i may be wrong.

RiiDii
21
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 25th Nov 2010 21:14
I know your pain. Fortunately...
IanM's Matrix Utilities has just what you are looking for (and probably more) in Matrix1Util_18.
Matty H
17
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 25th Nov 2010 22:01
There are two 'object size' commands, one returns the original size and the other returns the scaled size.
If you divide one by the other you get the object scale. Hope that helps, never had time to look over all your code but I think thats what you are after.

MSon
22
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 25th Nov 2010 22:17 Edited at: 25th Nov 2010 22:22
These are all the size commands I know off
Object Size
Object Size X
Object Size Y
Object Size Z

Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 25th Nov 2010 22:42
Save the object size after scaling, get the object size before scaling

then object scale = size after/size before

General Jackson
User Banned
Posted: 25th Nov 2010 22:46
Would you mind if I used some of your code there?

MSon
22
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 26th Nov 2010 00:16
help yourself

General Jackson
User Banned
Posted: 26th Nov 2010 00:37
Shweet thanks

MSon
22
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 26th Nov 2010 01:06
went for a sleep for about an hour, came back refreshed, and just realized that i was storing scale data in a dim so fixed it now, all it took was a break, but thanks for all the help.


baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Nov 2010 09:58
Glad you solved it, for anyone struggling to save their object at a new scale you can easily rescale an object using vertex manipulation and that way the object will be saved at its current scale (not its original scale as it would if you just used "scale object")

Here is the code I use to scale objects:


Login to post a reply

Server time is: 2026-07-21 12:49:59
Your offset time is: 2026-07-21 12:49:59