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.

AppGameKit Classic Chat / Get the width/height/dimensions or size of an object?

Author
Message
Divided
FPSC Reloaded TGC Backer
11
Years of Service
User Offline
Joined: 31st Oct 2013
Location:
Posted: 14th Mar 2019 06:57
Hey guys,

Wondering if there is a way to get the dimensions of an 3d object like we have for 2d sprites.

Any help is greatly appreciated.

Cheers
Real programmers don't comment their code, because if it was hard to write it must be hard to read!

- PixHil Entertainment
Download Pixel Smasher on the App Store today!
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 14th Mar 2019 07:08
like this
fubar
Divided
FPSC Reloaded TGC Backer
11
Years of Service
User Offline
Joined: 31st Oct 2013
Location:
Posted: 14th Mar 2019 07:14
You're a genius!

Thanks fubarpk
Real programmers don't comment their code, because if it was hard to write it must be hard to read!

- PixHil Entertainment
Download Pixel Smasher on the App Store today!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Mar 2019 09:15
I believe that that does not take into account any scaling
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 14th Mar 2019 09:22 Edited at: 14th Mar 2019 09:39
@blink is there a method that does?
I would've thought that just gets the max and min points so scaling shouldn't matter but I may be missing something

If its a bug has it been reported ?
fubar
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 14th Mar 2019 10:24
If you use setobjectscalepermanent it should take it into account, but regular scaling is done in a transformation matrix I think, so the mesh isn't altered. So in that sense, not a bug, no.
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Mar 2019 11:30
Hi there. Yeah setobjectscalepermanent works . Another method .

Quote: "
setobjectscale(obj,0.5,0.5,0.5)
fixobjectpivot(obj)
nsize=GetObjectMeshSizeMaxX(obj,1)-GetObjectMeshSizeMinX(obj,1)
"
I'm not a grumpy grandpa
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Mar 2019 18:43
https://forum.thegamecreators.com/thread/223985#msg2640935

You can calculate the size by getting the WorldX/Y/Z position of the boxes

Login to post a reply

Server time is: 2024-11-05 23:11:31
Your offset time is: 2024-11-05 23:11:31