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 Professional Discussion / Matrix shaped by objects

Author
Message
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 1st Nov 2003 04:05
Is it possible to place an object in a matrix and get the batrix to shape itself round it... rather like an object hitting the ground and making a dent. Memblocks? possibley? how could you make a sphere dent in a matrix? code would be nice.. i dont have a flecking clue about mem blocks

The following threads and their accompanying sound tracks are protected by copyright and any broadcast public diffusion, copying and edditing are etc... etc.. you may not complain about my Typo's
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 1st Nov 2003 04:47
Im in a cafe so i dont have a snippet.

heres the thoery behind it.


use a for loop the same divisions of your matrix and use the get ground height on the matrix with the object at hand.



you can sculpt the matrix to reflect the shape of the primitive or imported shape with the set matrix height command.

Now in some instances like for example a cone will produce a weird result, it shows up like a hemisphere but for taking a 3ds landscape or a cube tilted to an angle it works a treat.

I cant claim fame to this trick, a long time ago in a galaxy far away was a clever monkey called tdboy who first showed me this idea in action. It will work for both dbp and dbc.
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 1st Nov 2003 11:13


The following threads and their accompanying sound tracks are protected by copyright and any broadcast public diffusion, copying and edditing are etc... etc.. you may not complain about my Typo's
ReD_eYe
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 1st Nov 2003 12:01
theres some code for this in the codebase!
http://darkbasicpro.thegamecreators.com/?m=codebase_view&i=bffdf2f9dd18437292b773dff1f2e31d
check it out!


Go on, click on my signature image, you know you want to
Favourite smiley>>>
GCEclipse
23
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: United Kingdom
Posted: 1st Nov 2003 12:09
Yeh, I was going to work on an improved version of that code but the codebase entry does at least show the principles behing how to do it.

Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 1st Nov 2003 14:01
hey
thats great....
one thing
that code puts the matrix ontop of the object... how do you put it underneath?

The following threads and their accompanying sound tracks are protected by copyright and any broadcast public diffusion, copying and edditing are etc... etc.. you may not complain about my Typo's
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 1st Nov 2003 14:02
EDIT: would i just put a - sign in there?

The following threads and their accompanying sound tracks are protected by copyright and any broadcast public diffusion, copying and edditing are etc... etc.. you may not complain about my Typo's
GCEclipse
23
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: United Kingdom
Posted: 1st Nov 2003 21:45
I THINK this will reverse it but I haven't tested it:

Change the line:

R#=INTERSECT OBJECT(Objno,x#,height#,z#,x#,0-height#,z#)

to:

R#=INTERSECT OBJECT(Objno,x#,height#*-1,z#,x#,0+height#,z#)

I will try it out later.

Login to post a reply

Server time is: 2026-07-26 08:30:37
Your offset time is: 2026-07-26 08:30:37