Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (alibaba, vicknick), 1,492 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
precision issue or ? #450170
04/07/15 20:26
04/07/15 20:26
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline OP
User
Wjbender  Offline OP
User
W

Joined: Mar 2012
Posts: 927
cyberspace
hi , I have noticed something odd .

I am using the sdk to save out hmp files , I set up a particular test scenario where I arranged 10
terrains next to eachother all down the x axis .

the terrains sizes were 128*128 tiles with a triangle distance of 128 , so that's 163,840 quants along the x axis if I am correct .

I saved each terrain out to file , and viewed them all individually in MED , I discovered that about after 7 terrains , which is 7 * (128*128) , the next subsequent terrains , were all distorted , some seem to have stretched triangles along the x and some seemed to have a combination of stretching along the x plus what seemed to be less tiles along the y .

I thought this might be some mistake on my part , but after setting each terrain to the world centre I found the problem went away , I then tested one terrain against the world centre it were fine, and then also at an offset far along the x which yealded the same problem , the problem then must be the distance or rather precision I suppose ; so okay I know the best is to just save my terrains centred in the world , after that I can place them at those far positions when loaded.

I know about many games with large distances that can run into precision proplems , but is this really enough distance , I mean I don't really know when the quant becomes to far and this does not seem to be that far out for this particular issue , has to be a conversion issue ?

I know theres a conversion from var to float when saving , is this possibly where the issue comes from ?

is it really possible to be a precision issue at 7 *(128*128) quants , when saving the terrain ?

I am no mathematical wiz

thanks


Compulsive compiler
Re: precision issue or ? [Re: Wjbender] #450173
04/07/15 21:41
04/07/15 21:41
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline OP
User
Wjbender  Offline OP
User
W

Joined: Mar 2012
Posts: 927
cyberspace
in adll.h of the plugin sdk , the var to float conversion _FLOAT(var) macros is

inline float _FLOAT(var x) { return ((float)x)/(1<<10); }

so if i wanted to test and see the values in lite-c from var to float

is this correct:

var xx=(128*128)*10;
float tt= ((float)xx)/(1<<10);
printf("%5.f to %.5f",(double)xx,(double)tt);

because i get xx=163840 and tt=160.0000

I hope that's how I test and display it correct
?


Compulsive compiler

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1