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 / Doth no one careth or containeth thy intelect? Helpeth thee!

Author
Message
SpiralMinice
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: United States
Posted: 16th Nov 2002 22:44
I want to use a .3ds object as the ground in my game because I can make such incredibly beter landscapes with 3d studio max. But I've been trying to rack my brain for days trying to figure out a way to make this possible. I mean DB provides an easy way to get the height of any point on a matrix but there is no freegin way for me to get this information for an object. Please if anyone one has any information on how to do this it would be greatly apreciated. please help!
Come children and i shall bring you into unlevend
feilds of faraf fo sdlief dnevelnu otni uoy gnirb llahs i dna nerdlihc emoC
hexGEAR
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 16th Nov 2002 23:23
dunno man, erm..... you could increment your height (y) value untill your player was not touching the landscape and then it stops, so basically:

- if the object is touching the landscape then increment the y value. (using the object collision or hit command)
- when the object is not touching the landscape then you stop the incrementation.

look something like:



so if your player moves up a hill, he'll be moving up and when he gets to level ground, he'll stop moving because he's not colliding with the landscape. Thats from the top of ma head so i ain't sure it's right. hope it helped though.

to live is to suffer, to survive, well, that's to find meaning in the suffering - DMX
SpiralMinice
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: United States
Posted: 17th Nov 2002 01:03
I do apreciate the effort,but I've tried this many a time from many different perspectives and I always end up with the same problem. The problem is that because there is no way of knowing the height or angle of the part of the ground I am touching there is no way to calculate how high my character should be positioned in relationship to my character's current speed. With out the knowledge i need the outcome is always the same, the screen will shake violently untill eventualy my character runs straight threw the hill and falls out. I'de turbo apreciate it if you or anyone else could find the cure. thanks.

Come children and i shall bring you into unlevend
feilds of faraf fo sdlief dnevelnu otni uoy gnirb llahs i dna nerdlihc emoC
hexGEAR
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 17th Nov 2002 02:38
hmm... how about trying to clone you landscape with a matrix of roughly the same shape and height (the matrix would have no texture, coloured black and ghosted or something so that it does not affect your game speed and is invisible) would be a tedious job but if you where desperate then you could give it a shot.

to live is to suffer, to survive, well, that's to find meaning in the suffering - DMX
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 17th Nov 2002 03:28
two simple ways to do this, and technically both are the same

first setup a virtual grid array like so, this will give you 1024 points XYZ ... you'll have to uniform thier scale so i'd suggest each point = 10DBU and you can calculate an interpol from that



now the next task is relatively simply IF you have DarkMatter, if not it'll take a bloody long time and require you to know the 3DS header



now we have what we need from the 3DS and all the points are here as vertex... but we need to sort them out first unless you want to deal with multiple vertex points.

so make a temp array to store the vertex prior to sorting



and we then make a second array the same size but this time for the compressed point



now we've populated the Buffer we can sort them out and check them against each other for duplicates.



finally we clear the Buffer so we can reinitlize it to hold ONLY active data and not the now reserved spaces.



finally we use the buffer to populate the ground pointer



now if you need a value simple do search based upon the position of the character over the ptrGround() array
yeah effectively the Get Ground Height Routine but can be interpoled correctly to also give accurate Collision Data
If you need to setup Collision Boxes then you can use a similer effect and just compile the array information prior using Booleans for if a character will collide of not ... i'm sure i could explain that too if you need it to be, the actual collision can then be Angluar or Standard Based on the boolean callback.

Hope that all helps and actually makes sense... if you need the header for 3DS try http://www.wotsit.org

Anata aru kowagaru no watashi!
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 17th Nov 2002 03:31
you can also increase the accuracy and such of this but simply having a second ptrScale(6) which hold the scale XYZ and Translate XYZ
so you can resize the arrayed information from a compressed Square size to a real size, as you take all the figures and rather than just dividing by accuracy you actually replot the devided values within a smaller box.
obviously a 1024,1024 box would really be -512 <-> 512

Anata aru kowagaru no watashi!
SpiralMinice
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: United States
Posted: 17th Nov 2002 06:22
Well HexGear i apreciate your help. And Raven Vageta I greatly apreciate your atempt at helping me, what with all the code snipits and so on. But alass I'm afraid that my lack of expeireince in programing prohibits me from being able to take advantage of your suggestions that and i dont have dark matter. You would probably have to write a 5 page manual on explaining the whole process to me... you wouldnt be willing to do that would you?! ...just as i suspected (wamp womp wa wa wa) anyway to show you my gratitude I will tell you a special secret... if you act quickly, depending on where you live, if you hury on down to your local doller tree store, large DBZ models are being sold for a buck each!

Come children and i shall bring you into unlevend
feilds of faraf fo sdlief dnevelnu otni uoy gnirb llahs i dna nerdlihc emoC
SpiralMinice
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: United States
Posted: 17th Nov 2002 06:26
oh yeah... Raven Vegeta... you wouldn't happen to be the infamous Cody Turner would you?

Come children and i shall bring you into unlevend
feilds of faraf fo sdlief dnevelnu otni uoy gnirb llahs i dna nerdlihc emoC
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 17th Nov 2002 08:18
lol... not Cody Turner (i have no idea who that is )

to do this in Standard DB is quite a simple task, rather than using a memblock you use the file read values, suchas byte(int/char), word, long(dword) and file(double long)
and load directly from the 3DS file. As i said the File Header and Data structure can be found on the site i linked. Normally I'd be happy to run through this better, but I have my hands full with a project i REALLY want out the door as of about 6hours ago - poor CDonCD is still waiting

Once you get it all into the Array it actually is pretty simple to use, as you should think of it as
Height(Y#) = ptrGround(int(X/10),int(Z#/10))

you use the int() command to make sure it is an interger (whole number) rather than a float (decimal number).
as i mentioned almost literally no different from the Get Ground Height() command.

the scale and such also isn't too hard to understand, as what you do for that is Scale is how refined you go and the translation is the manual offset of the figures to get them to return exactly

as i said you could also do this as a collision array,
bool = ptrCollision(X,Y,Z) you check the XYZ for where the person is, and then the Bool is either 1/0 from a precalculated Collision
you check for collision based on the faces of a level, so say you'd check the vertex you need ...
i'll sketch up something with an explaination to help a lil later, but you basically set the vertex positions and calculate the points between (in intergers) where it would collide

then collision is simple checking up positions

Anata aru kowagaru no watashi!

Login to post a reply

Server time is: 2024-04-26 19:15:41
Your offset time is: 2024-04-26 19:15:41