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 / Using a 3ds model as a matrix?

Author
Message
Big Shot
21
Years of Service
User Offline
Joined: 27th Apr 2004
Location: dunno...
Posted: 9th Mar 2005 02:19
How can I use a 3ds model as my world? I need to know how I can read and alter the height of my character when he walks on it.
any help would be great.

life is a risk... take it.
TravisP
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location: Behind you, with a knife!
Posted: 9th Mar 2005 02:50 Edited at: 18th Mar 2005 14:58
Quote: "can I use a 3ds model as my world?"

Nope, .3ds cannot be used.

Note: The above I didn't say, your just crazy.

Not a ripoff of The Twilight Zone
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 10th Mar 2005 15:57
Big Shot,

A 3d model can be used as your world, but you yourself must calculate several coordinates within it to do so. If you wish to do so, I would recommend writing a program in DB, which loads your model. Then, have it load a box and enable you to move the box within the 3d world, while you jott down specific coordinates you will need to create specific collisions. This method is long and exhausting, but allows for you to have more control over what your world looks like, via good modeling skills.

I am in the midst of creating a game using this exact method. If you would like details on how to program such a world, just ask.

+NanoBrain+
Big Shot
21
Years of Service
User Offline
Joined: 27th Apr 2004
Location: dunno...
Posted: 10th Mar 2005 19:03
So what you'r saying is, I will need to set up my height for each object which I want to climb up? Do I need to find the collision for each of my objects and change my characters height?

life is a risk... take it.
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 10th Mar 2005 20:32 Edited at: 10th Mar 2005 20:33
Big Shot,

Let's say you have a ladder in your level somewhere at about the x coordinate of 50, the z coordinate of 65, and the y coordinate of zero. Let's also say that you do not yet know the coordinates of the ladder, but you want your character to climb up it when he collides with the it.

First of all, you would use the box method to find the x, y, and z coordinates of the box. Then you would use this information in your code to check if the character is close to or on the ladder's coordinates. Finally, the code to make the character climb up the ladder would come thereafter.

For effeciency, I suggest making a "map" of all the objects' coordinates beforehand, using either pen and paper, literally drawing a top view of the map on a grid of some sort, and jotting down the coordinates next to each point of each object where collision detection is needed, or some other method you find handy.

When you say "change my character's height", do you mean as to scale the character's size, or as to move the character up and down in the 3d world?

+NanoBrain+
Big Shot
21
Years of Service
User Offline
Joined: 27th Apr 2004
Location: dunno...
Posted: 10th Mar 2005 20:45
Yes, I mean moving my character up and down. If I build my level in DeleD, will my objects still be seperate?

life is a risk... take it.
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 10th Mar 2005 23:39 Edited at: 12th Mar 2005 06:20
For like a ladder you need to make a collision box for the ladder object and also the character. Then somewhere in your code you need to say if the character's collision box is colliding with the ladder's collision box then move the character object up until they aren't colliding anymore. This is the main reason why I'm taking a break from 3d and working more with 2d .

I'll make a little demo for you when I get home .

NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 11th Mar 2005 18:18 Edited at: 11th Mar 2005 18:22
Underworld 1020,

The only fallback in the method of using collision boxes is that more polygons have to be calculated. I would suggest in using math to calculate collision instead. However, this is only if you are needing to raise the frame-rate of your game and have the skills to do so. Also, it is just good practice to do so, if so be that you wish to not only program in DB in your life.

+NanoBrain+
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 12th Mar 2005 06:27 Edited at: 12th Mar 2005 06:32
Here's a little example:


It's not the best example there is, but it works . If you have any questions just ask .

@NanoBrain - Math would be better, but thats really only needed when the levels start getting really complex and you start worrying about speed.

Malith
20
Years of Service
User Offline
Joined: 12th Mar 2005
Location: nowhere
Posted: 12th Mar 2005 10:21
http://darkbasic.thegamecreators.com/?m=codebase_view&i=d71183f50e9a2d3d7dcec986ff7dbd76
That is an X-level engine. Now, to convert your 3ds to an X file, there are many possibilities. I would suggest simply using the engine provided above, and then instead of loading the .x file supplied, use yours once converted.
Big Shot
21
Years of Service
User Offline
Joined: 27th Apr 2004
Location: dunno...
Posted: 17th Mar 2005 03:39
When I try to run the code, it says 'array must have at least one subscript'-why?

life is a risk... take it.
Big Shot
21
Years of Service
User Offline
Joined: 27th Apr 2004
Location: dunno...
Posted: 17th Mar 2005 03:48
NanoBrain,

When I try and use the command 'if object collision(?,?) then position object ?,x#,y#+?,z#'
it works, but only once in my main loop. If I try and change the objects for another command then it cancels out the first. How can I seperate the code to make it work as many times as I need, or could you give me an alternative code on how I could write the collisions for my character's height?
thanks.

life is a risk... take it.
Ledio Sinjari
20
Years of Service
User Offline
Joined: 16th Mar 2005
Location: United states
Posted: 17th Mar 2005 05:19
How do i use the 3ds skyboxes that come in darkmatter for my game?
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 17th Mar 2005 11:56 Edited at: 17th Mar 2005 11:57
Big Shot,

About the array problem, I believe that the subscript is the second dimension in your array. For example:
arrayname(script,subscript)
So, if you have created an array and have set it up like:
arrayname(1)
then, it is not valid.

About the collision, can I see your source code? I cannot figure a problem from the top of my head. However, I may be able to figure it out by running through your code.

+NanoBrain+
Hop a long
21
Years of Service
User Offline
Joined: 12th May 2004
Location: The Code Dump
Posted: 18th Mar 2005 09:41
HI guys

Nice thread ... lot a good ideas flying back and forth. This isn't exactly what your are looking for but it might be interesting: Includes some DeleD models, math collision on an incline and standard DB collision functions.
http://www.geocities.com/hifin2003/incline.html
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 19th Mar 2005 03:30
kevin picone (www.underwaredesign.com) wrote a program that you can use to walk over .x models, he didnt actually use an x model coz that requires downloading stuff :-P but he used lots of triangles and it works quite well. if you have trouble finding the code for it just ask.

"Well, if he dies, it'll teach him not to do it again." - Me
Malith
20
Years of Service
User Offline
Joined: 12th Mar 2005
Location: nowhere
Posted: 9th Apr 2005 06:47
I ment to say, in my above post, to convert your 3ds to an x. Simply type in 3ds2max "your3dsfile.3ds" "yourxfile.x"
that will convert
now delete that code out of your source
replace the matrix, etc, with the new x file
Lover of games
20
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 15th May 2005 04:47
When I run the program in DBC it says i need the full bersion to do it. then when I try in DBPro, it crashes. any ideas why?

"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack

Login to post a reply

Server time is: 2025-05-23 19:09:19
Your offset time is: 2025-05-23 19:09:19