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 and Scale Object???

Author
Message
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 3rd Nov 2008 15:21
First I make an object and then I scale it. Now I whant to print out the new size, but the program still says 32x32x32!

[CODE]#include "DarkGDK.h"

void DarkGDK ( void )
{
dbSyncOn();
dbMakeObjectBox(1, 32, 32, 32);
dbScaleObject(1, 111, 222, 333);

while(LoopGDK())
{
dbText(0, 0, dbStr(dbObjectSizeX(1)));
dbText(0, 32, dbStr(dbObjectSizeY(1)));
dbText(0, 64, dbStr(dbObjectSizeZ(1)));

dbSync();
}
}[/CODE]
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 3rd Nov 2008 15:49
When you Scale an object 100 then its 100% of its size. when you Scale an object 111 then its 111% of its size. The true size of the object is still the original size.

So to find the "new" size of 32 with Scale 111 you need to find 111% of 32 = (32 / 100) * 111 = 0.32 * 111 = 35.52

/Niels

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
General Reed
18
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 3rd Nov 2008 23:13
As far as i know, there is an extra parameter on the get object size commands, 0 = Not include scaling, 1 = Include scaling. So change for example the following line:
Quote: "dbText(0, 0, dbStr(dbObjectSizeX(1)));"


to

dbText(0, 0, dbStr(dbObjectSizeX(1, 1)));

However, im not sure if this is a new feature in one of the later updates of dbpro, so as dgdk, is out of date the extra parameter may not exist.

-General Reed

CPU: AMD X2 6000+ 3.0ghz GFX: NVIDIA BFG Geforce 8800GTS 640MB OC-550mhz core RAM: 2048mb

General Reed
18
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 3rd Nov 2008 23:13
As far as i know, there is an extra parameter on the get object size commands, 0 = Not include scaling, 1 = Include scaling. So change for example the following line:
Quote: "dbText(0, 0, dbStr(dbObjectSizeX(1)));"


to

dbText(0, 0, dbStr(dbObjectSizeX(1, 1)));

However, im not sure if this is a new feature in one of the later updates of dbpro, so as dgdk, is out of date the extra parameter may not exist.

-General Reed

CPU: AMD X2 6000+ 3.0ghz GFX: NVIDIA BFG Geforce 8800GTS 640MB OC-550mhz core RAM: 2048mb

CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 4th Nov 2008 08:35
Nope, there is no extra parameter...

Login to post a reply

Server time is: 2024-09-30 09:36:45
Your offset time is: 2024-09-30 09:36:45