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.

Author
Message
Munchy2007
13
Years of Service
User Offline
Joined: 21st May 2013
Location: Hemel Hempstead - UK
Posted: 22nd May 2013 15:12
Can anyone recommend a free (or paid for) matrix editor for use with DarkBasic Pro?

I did some searches and the only one I could find was called MatEdit, but the download website isn't available anymore.

Thanks.
ArK 48k
19
Years of Service
User Offline
Joined: 29th Jun 2007
Location:
Posted: 25th May 2013 17:16
You should really be using 3D models for level design instead of a matrix as a 3D model uses a lot less polys.
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 25th May 2013 18:35
I recommend BlitzTerrain. There is a free version and is very much the best thing to use for terrain. You can apply shaders to it and produce some amazing terrains. (As I have done in my game.)


This terrain is 100% procedurally generated, using a simplex noise plugin for the heightmap, and a terrain shader from Green Gandalf to generate the texturing.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Munchy2007
13
Years of Service
User Offline
Joined: 21st May 2013
Location: Hemel Hempstead - UK
Posted: 26th May 2013 03:35
Thanks Mobiius, I'll check that out.

The reason I was going to use a matrix is because being new to 3D programming and there is a handy function in DBPro (Get Ground Height()) to help me position my objects onto it.

Is there an equivalent function to do the same if the ground is a model, or would I have to do the math myself?
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 26th May 2013 10:56 Edited at: 26th May 2013 10:56
Using BlitzTerrain: BT GetGroundHeight( TerrainID, XPos#, ZPos# )

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 26th May 2013 12:15
Hi there.

If the ground were a 3D model, that would have too many polygons, and that would be even slower than using a matrix, however, you could use the command INTERSECT OBJECT.


Quote: "Return Float=INTERSECT OBJECT(Object Number, X, Y, Z, ToX, ToY, ToZ)"



Cheers.

I'm not a grumpy grandpa
Munchy2007
13
Years of Service
User Offline
Joined: 21st May 2013
Location: Hemel Hempstead - UK
Posted: 26th May 2013 12:50
Thanks, I'll have a play with intersect object.
Munchy2007
13
Years of Service
User Offline
Joined: 21st May 2013
Location: Hemel Hempstead - UK
Posted: 26th May 2013 14:16
It does work with the faces, I've worked it out.

I position the ground at 0,0,0 and rotated it 90 degrees on the X axis to align it the same as a matrix.

Then I used the following to get the ground height



and I just use gy# for the y value in my position object call, simples

Thanks for all the help guys.
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 26th May 2013 18:53
But it's more efficient to use proper terrain, rather than loading a terrain object.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 26th May 2013 21:05 Edited at: 26th May 2013 21:12
Munchy2007 welcome to DarkBASIC Professional. Nice to 'see' new people join the community and give 3D game development a crack.

Quote: "it's more efficient to use proper terrain"


Before trying to create a 3D scene with walking characters, it is highly recommended to first get more familiar with the engine; as the path you are walking down is the longest one.

Forget about matrices; they are legacy; consider that the DBPRO documentation is out of date, although roughly 90% of it is valid. Consider how far back in history they spawned:

To quote:
Quote: " Matrix: This command set can create and modify simple landscapes called matrices. A matrix has height values which can be used to raise mountains and valleys, and can also be textured, resized and scrolled easily."


Matrices where created to define landscapes with variable tiles; but this CPU intensive system was not much suitable for the job so then came Terrains (I assume you didn't spot this section in the world commands section)

Quote: "TERRAIN EXIST : Return Integer=TERRAIN EXIST(Terrain Number)
TERRAIN POSITION X : Return Float=TERRAIN POSITION X(Terrain Number)
TERRAIN POSITION Y : Return Float=TERRAIN POSITION Y(Terrain Number)
TERRAIN POSITION Z : Return Float=TERRAIN POSITION Z(Terrain Number)
GET TERRAIN HEIGHT : Return Float=GET TERRAIN HEIGHT(Terrain Number, X, Z)
GET TOTAL TERRAIN HEIGHT : Return Float=GET TOTAL TERRAIN HEIGHT

MAKE TERRAIN : MAKE TERRAIN Terrain Number, Heightmap Filename
DELETE TERRAIN : DELETE TERRAIN Terrain Number
POSITION TERRAIN : POSITION TERRAIN Terrain Number, X, Y, Z
TEXTURE TERRAIN : TEXTURE TERRAIN Terrain Number, Image Number"


People used to be better off using this system, and it is still acceptable to use this system in situations where shaders and vast operators are not required.

But this is superceded by Advanced Terrains, which you get for free now with your copy of DBPRO, but the documentation does not link to it. You can get your documentation here which contains examples; supplied by the member Sixty Squares. The Green Gandalf started a thread about AT shaders.


Blitz Terrain
Using advanced terrain is considered the second best option for new programmers. The first best option was stated by Mobiius which he used to create that nice scene he made. I also use Blitz Terrain, and there is a free version here The full edition has much better features such as real time updates; but consider that a new system is being developed; visit the last page in that thread.

This Blitz Terrain system requires more effort than Advanced Terrain for simple work, ironically when the terrain is advanced Blitz Terrain is better..., it runs larger worlds more effectively and features LOD (Level of detail) which alter the density of the mesh per distance.

Finally, there is the custom terrain. This is the most low level method which would need a physics plugin or intersect object calls as chafari recommended.

Do not bother to create a custom terrain system. At least not until you get fully familiar with DBPRO. But for learning purposes, it would help to know that the Matrix1 utility plugin features many functions geared toward producing terrains; its Make Object Plane command allows you to define tilesets.


Munchy2007
13
Years of Service
User Offline
Joined: 21st May 2013
Location: Hemel Hempstead - UK
Posted: 27th May 2013 04:14
I did indeed miss the terrain commands. Thanks for a great post Chris, loads of useful stuff for me to get started with there.

It was a useful exercise for me to work something out with objects first though, helped me to get my head around a number of aspects of 3D programming that I didn't previously understand.

I'm a bit gutted in some respects though, because I originally bought Dark Basic way back when it first came out, but I found the editor and unstructured language so hard to deal with that I put it aside (and lost it) in favour of XNA as I could program that in C#. I wish I'd stuck it out with DB though as it's so much easier to do 3D stuff with it than it is with XNA and I'd be well experienced with it by now.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 27th May 2013 06:03


Hmm... Your reply makes me feel that you are hungry for control and enjoy learning from examples and performing tests (like me). Therefore, I think I'd better post up my custom terrain snippet, something you will find helpful for creating your own terrain system out of objects; I will post it here in the snippet section.

Munchy2007
13
Years of Service
User Offline
Joined: 21st May 2013
Location: Hemel Hempstead - UK
Posted: 27th May 2013 14:18
Thanks again Chris, nice clear example, will definitely help give me a push in the right direction
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 27th May 2013 14:29
Quote: "I found the editor and unstructured language so hard to deal with that I put it aside (and lost it) in favour of XNA as I could program that in C#"


Did you know you can code DBP in C++/C# with Dark GDK/GDK.net? Might be the best of both worlds for you.

Quote: "The first best option was stated by Mobiius which he used to create that nice scene he made. "

Thanks for the compliment.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Munchy2007
13
Years of Service
User Offline
Joined: 21st May 2013
Location: Hemel Hempstead - UK
Posted: 28th May 2013 02:51
C++ 2010 is broken on my PC since I installed the beta of VS2012, and the only fix appears to be a reinstall, which isn't going to happen any time soon, because it's such a pain getting all my software set up again.

But I didn't realise there was a wrapper for c# (which wasn't affected by the VS2012 beta), so I'll check that out.

Thanks again Mobiius, and I forgot to compliment you on the nice scene, I'll be happy if I can get something looking as good as that myself.
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 28th May 2013 16:54
Thanks for the compliment! I like getting compliments! lol

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 30th May 2013 05:46
I guess I will take on the unenviable task of promoting the use of a matrix. A matrix is terrible system that does fairly well for indoor environments. The fact that it is easy to setup and provides hard edge tiles, works well to create a believable floor. Not to mention it makes it easy to have sloped indoor terrain.

Ultimately if you are going for professional quality it's probably best to create a custom terrain system that mimics matrices, where you can do things like apply shaders, cut holes out, and use less polygons.

For indoor environments only.

Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 31st May 2013 03:50
Remember, that there's a bug found with DBPro Matrix commands. Running your DBPro application which is using a matrix, hitting CTRL ALT DELETE, then returning to the application causes a crash to occur, which I don't believe there's a fix for, it's essentially a bug that hasn't been addressed.

This is not to be confused with the Object cache that gets flushed, as that problem is solvable by detecting the missing object, then re-loading it.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 31st May 2013 05:27
I wonder which handsome devil told you that.

Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 31st May 2013 08:03
Mage, if I could... I would have your babies.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia

Login to post a reply

Server time is: 2026-07-09 02:35:09
Your offset time is: 2026-07-09 02:35:09