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.

Dark GDK / [DarkGDK 2.0] how to size an object according to another object size

Author
Message
haliop
User Banned
Posted: 23rd Jul 2012 07:52
i think i remmber that on GDK 1.0 there was a command dbSizeObject where you can size any object in exact numbers
but on DarkGDK 2.0 you only have dbScaleObject which uses precentage instead of real numbers.

so , if i have object obj1 and i also have obj2
i want obj2 to be the same size as obj1

but if an obj1 size is 25,25,25
and obj2 is 10,10,10

if i use dbScaleObject(obj2,dbObjectSizeX(obj1),dbObjectSizeY(obj1),dbObjectSizeZ(obj1))
the result will actually be
obj2 size x = 2.5f
obj2 size y = 2.5f
obj2 size z = 2.5f

so it will actually be smaller..

im interesting in how to make obj2 the exact size as obj1 ..
i wonder and pawnder but i cant see the math behind it..

ty for your help and time.
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 23rd Jul 2012 09:12
Here's a suggestion:

obj2.scale = obj1.size/obj2.size*100.0

With Computers you can solve Problems that you have never befor.
Share your knowledge. It's a way to achieve immortality. (Tenzin Gyatso)
haliop
User Banned
Posted: 23rd Jul 2012 09:26
cool lets see if it works

Login to post a reply

Server time is: 2024-03-29 15:54:17
Your offset time is: 2024-03-29 15:54:17