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 / object size not working

Author
Message
krolik
16
Years of Service
User Offline
Joined: 20th Mar 2008
Location: Poland
Posted: 30th Dec 2008 12:27 Edited at: 30th Dec 2008 15:23
Hi

I have problem with dbObjectSize
I read in others subjects about add secound argument to basic3d.h
i done this i have 3 normal functions with one argument and 3 functions with id and i use size or actual size . project was compilated but not working good.

i done if i will click space dbScaleObject(1,dbObjectSizeX(1,1)+1 , ...Y(1,1)+1 ...Z(1,1)+1 ) but when i click space then model is smaller , very very small.

i dont know what is wrong i read in other subject the secound argument is for using scaling or not so when i wrote 0 or 1 every one effect is identical.


Sorry for my eng.


dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 30th Dec 2008 17:24 Edited at: 30th Dec 2008 17:25
Quote: "but when i click space then model is smaller , very very small."


Remember that dbScaleObject() takes a percentage from the normal object size, so if I load an object, its scale is 100, 100, 100. If I scale this object to 200, 200, 200, it is now 200% of the size it was when loaded, if I scale it to 200, 200, 200 again then it still remains the same. Now, dbObjectSizeX/Y/Z( ID, 0 ) returns the original size of the object. NOT the scale, so if my object is 1337.0f units along the x axis, its dbObjectSizeX() will be exactly 1337.0f, but the scale will be 100.0f still, if I scale it using dbScaleObject( ID, 100.0f, 100.0f, 100.0f ) then it will still be 1337.0f units in size. If I scale this object to 200.0f on all 3 axis, then its size will now be 2674.0f on the X axis, however! dbObjectSizeX( ID, 0 ) will still return the original size, which is still 1337.0f, if you want to get the new size, then you can call dbObjectSizeX( ID, 1 ), this will return 2674.0f. If you want to find the scale of the object(200.0f), then you can just do, dbObjectSizeX( ID, 1 ) / dbObjectSizeX( ID, 0 ), this will return 2.0f, which you can multiply by 100.0f and it gives you 200.0f. I hope this explains things, and Poland rocks.

krolik
16
Years of Service
User Offline
Joined: 20th Mar 2008
Location: Poland
Posted: 31st Dec 2008 01:03
Thanks Dark Coder
I understand you, but i done scaling with int size1 = 100;
And when im scaling im doing that :

if( dbSpaceKey() ) dbScaleObject( 1, size1 +=1, size1 +=1, size1 +=1); and is working ok

Login to post a reply

Server time is: 2024-09-30 13:19:18
Your offset time is: 2024-09-30 13:19:18