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 / Edgeless map, world matrix advice needed.

Author
Message
Kaboooom2000uk
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location: England, United Kingdom
Posted: 7th Aug 2009 23:23 Edited at: 8th Aug 2009 05:14
Hello I have the need to make my matrix wrap, I think it is called, where the player can leave a known point on the map, move north and eventualy depending on the size of the matrix, return to the point at which they started. for instance (0.0X 0.0Y 0.0Z) Almost as if they are walking on a shere, or a planet. If we travel in a straight line for long enough we get back to the point of origin.

this idealy needs to work in any direction on the X and Z axis, apart from if the player leaves the surface of the matrix +Y

There should be no collisions with any map edges, as there are no egdes... I should be able to make it very big, and make it feel "world like" in proportions.

Im not sure 100% how to code this so some help would be very much apreciated.

Anyone done this before?
Would there be complications with the skybox, maybe this can move with the player so the edge of the sykbox is never reached?
Kaboooom2000uk
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location: England, United Kingdom
Posted: 8th Aug 2009 17:44 Edited at: 8th Aug 2009 17:50


This is idealy what im trying to achieve.

Please any help would be greatly apreciated.
TheGroggyOne
15
Years of Service
User Offline
Joined: 11th Apr 2009
Location:
Posted: 9th Aug 2009 01:11
http://mathforum.org/dr.math/faq/formulas/faq.sphere.html

Some other useful toys there too.

Specifically, you're looking at Sector of a sphere.

s = 2Pirh

Ideally, your height should be set to the width of your model. In reality, you'll have to tinker with it.

Radius is the key. From the north pole, it'll be small to large at the equator, then from the equator to the south pole, it'll be a large number to a small number.

Now working with 3d, you'd think, (x, y, z) matrix would work. However, you'll end up with the same position in the north and south hemispheres. So you'll need an (x, y, z, sphere) (0 for north, 1 for south). Then it's basic matrix texturing from there, with s = 1 matrix point. You use the same formula to place your objects and camera (or you can tie a camera to an object). The sky is built the same way. Only the matrix is inverted.

Hope this helps.
Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 9th Aug 2009 04:52
dbShiftMatrixRight(int matrix)
dbShiftMatrixLeft(int matrix)
dbShiftMatrixUp(int matrix)
dbShiftMatrixDown(int matrix)

This command will shift the entire contents of the matrix one grid square to the direction. The shift ensures that the height and tile data that represent the matrix contents are wrapped around to allow continuous shifting of the landscape. The matrix number should be an integer value.

if(enemy == Amnzero) runAway();
Amnzero::WebSite = L"http://neovance.com/";
Kaboooom2000uk
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location: England, United Kingdom
Posted: 9th Aug 2009 22:08
Ok thanks Guys, I shall put the ideas to the test, and see if it gets me any further.
Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 9th Aug 2009 22:16
Great. I didnt even know such useful functions existed till I looked them up lol.

if(enemy == Amnzero) runAway();
Amnzero->WebSite = L"http://neovance.com/";
Kaboooom2000uk
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location: England, United Kingdom
Posted: 15th Aug 2009 04:56
humm still having a few diffculties, i bound the shift matrix comand but it moves the matrix very slowly and drops my framerate down.

would it be simpler if i just make a really really huge sphere??

Login to post a reply

Server time is: 2024-10-01 10:30:09
Your offset time is: 2024-10-01 10:30:09