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.

DarkBASIC Discussion / sphere as matrix

Author
Message
Mikada
21
Years of Service
User Offline
Joined: 28th Jan 2004
Location: Kentucky
Posted: 15th May 2008 05:16
Hey guys I know its been a while since any of my crew has been in this forum. We need a little help, somewhere in the back of my mind I remember someone here telling that they made a sphere as a dark basic matrix and the objects could move around it like a planet with the ground height. Ive tried but I cant seem to put anything together that works. Does some here know how to do it? Or a cube would work maybe.

sincerely,

Mike

Mike Cohoon
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th May 2008 09:46
Hello,

Sounds interesting... seems like a very plausible concept. If the sphere is perfect, the simple thing is to just use it's radius from a center point to the the point in question. That would be the ground height. If it's not perfect (mountainy or whatever) use collision detection to raise the object moving about, up or down.

If you use Sparky's collision DLL, point a ray from the ground object position or from above the object towards the center of the sphere. You can get the coordinates of the collision and raise or lower the position of the ground object according to the terrain.

If you aren't afraid of a little math, you could use the dot product to calculate your own intersecting ray with each face of the sphere. You'd need to get the faces of the sphere and test each one against your ray a)for collision b)to return the height. However, this would essentially be doing the same thing as Sparky's Collision DLL.

Enjoy your day.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th May 2008 17:54
maybe you could make your own 3D matrix using a 3D array
storing the distance of each point from the core

It is far better to complete a 10 line program than to start a 10,000 line program.
MSon
20
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 15th May 2008 18:01
I did somethink like that once, i just made a Sphere, Textured it, placed other items on the Sphere as Limbs, then you dont move the players object, but you rotate the sphere, and it looks like your walking on the Sphere, this was good as it gave a Looped Map.

Everyone Be Cool, You, Be Cool.
Mikada
21
Years of Service
User Offline
Joined: 28th Jan 2004
Location: Kentucky
Posted: 20th May 2008 07:08
MSon,

Thanks for the help, but it was what I needed.

Mike

Mike Cohoon

Login to post a reply

Server time is: 2025-06-05 21:13:18
Your offset time is: 2025-06-05 21:13:18