Silly question about terrain origin

Falagard

02-03-2006 21:01:47

I could find this out myself but easier to ask since I'm not at my computer with PLM2 - does the terrain work outwards from the origin, such that pages are built all around world 0,0,0 being in the center, or is the world origin one corner of the terrain, with pages working away from the corner? :-)

I'm assuming that the world vector (0,0,0) is in the center of the pages.

Clay

jacmoe

02-03-2006 22:24:11

IIRC the PLSM2 has center in the middle.
The standard terrain sm has it from the corner.

I read a post in the main forum about the OgreODE terrain collision code not working in plsm2 because of that difference. :wink:

tuan kuranes

03-03-2006 13:25:19

Yes,
Page (0,0) has tile(0,0) beginning at Vector3::Zero position.

Falagard

06-03-2006 23:56:23

Ah, so 0,0,0 isn't at the center of the pages, it's in one corner of the pages.

Falagard

20-03-2006 20:22:20

Tuan, can you clarify how the pages and tiles are created and their coordinates?

I just loaded the hf_129 terrain and noticed that it definitely didn't have world vector 0,0,0 in one corner. To me it appeared as if it was partially centered on 0,0,0, meaning that one corner of the terrain was at 256,0,256 and the other was (maybe?) at -256,0,-256.

When I loaded puget_sound it was more difficult to tell what was going on but there was terrain all around me when I expected one corner of the terrain to be at 0,0,0.

I have looked at the code but it's tricky :-D

tuan kuranes

21-03-2006 09:21:03

you're right:
the thing is that 0,0,0 is center of the world,
So if you have a (2,2) pages map, page (0,0)corner will be at 0,0,0
but if you have a (1,1) pages map, center is at page center...
etc...

EagleEye

01-04-2006 22:35:55

This doesn't make much sense to me. If you have a 2x2 world, the world center (0,0,0) should be at the top left corner of the bottom right page.

The question is, is the world center here (where the X is):

X---------
| | |
---------
| | |
---------


Or is it here? :

---------
| | |
----X----
| | |
---------


And in a 3x3 grid, would it be the center of the center page? The top left of the center page? Or the top left of the top left page?

tuan kuranes

03-04-2006 09:01:28

second drawing.
3x3 center of page.
You can change it using a setOption "PositionX", "PositionY", "PositionZ"