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 / Save object with rescaling?

Author
Message
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 23rd Jan 2013 17:01 Edited at: 23rd Jan 2013 17:02
I'm trying to do some preprocessing of 3D models by allowing them to be rescaled when being imported by my engine. I would have thought it would just be a matter of repositioning its vertices but this doesn't appear to work even when using the vertexbuffer lock flag of 2, which the documentation seems to hint is for this purpose.
I've tried this; when saved and loaded back in the object is of its original size again:


Do anybody have any ideas about this?


"Why do programmers get Halloween and Christmas mixed up?"
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 24th Jan 2013 00:47
Hi Rudolpho. To save an object afer scaling, in other to keep the new size...instead of scaling our object, what we have to do is :
scale limb my_obj,0,new_size,new_size,new_size and after that:
save object "my_obj_scaled.dbo",my_obj

Now when we load the new object, it has different size comparing with the first one.

Cheers.

I'm not a grumpy grandpa
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 26th Jan 2013 02:53
Oh, will that work?
Fishy... I guess my main point here was that it seems that you can't save the edited vertex data though, even if you use the flag which supposedly is for indeed saving it.
But I will try and use your solution if it works, thanks


"Why do programmers get Halloween and Christmas mixed up?"
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 4th Feb 2013 07:40 Edited at: 4th Feb 2013 07:46


works fine.

*** Merry Chuckmas! ***
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 6th Feb 2013 02:52
Hm, yes, turned out the problems I was having was due to using Enhanced Animations with the object to be saved, which implores its own limb-based position, rotation and scalings


"Why do programmers get Halloween and Christmas mixed up?"

Login to post a reply

Server time is: 2026-07-07 06:22:49
Your offset time is: 2026-07-07 06:22:49