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.