New To 3D

Blitz3D Forums/Blitz3D Beginners Area/New To 3D

Kirkkaf13(Posted 2011) [#1]
Hi everyone,

I am looking to start a small simple 3D demo. I have never done a 3D project as of yet and not quite sure what tools I need and where to start.

What are the bare minimum of tools I will require to get a simple flat terrain and be able to walk over the terrain.

Thanks.


Matty(Posted 2011) [#2]
graphics3d 1024,768,0,2
setbuffer backbuffer()

camera=createcamera() ;create a perspective camera
moveentity camera,0,1.7,0 ;put camera at eye height


planeent = createplane() ;create a flat terrain ie a flat mesh


repeat ;start loop

if keydown(200) then moveentity camera,0,0,1	;move camera forwards 1 unit
if keydown(208) then moveentity camera,0,0,-1   ;move camera backwards 1 unit
if keydown(203) then turnentity camera,0,-1,0 ;turn camera 1 degree left (I could have the sign wrong..)
if keydown(205) then turnentity camera,0,1,0 ;turn camera 1 degree right (I could have the sign wrong..)


renderworld ;render the fairly empty basic scene
flip ;flip the backbuffer into view


until keydown(1) ;keep looping until the escape key is depressed
freeentity camera ;free the camera entity
freeentity planeent ;free the plane entity
end 



Your question needs to be a bit more specific...this code does what you says - walk over a flat terrain with no tools other than blitz3d.

edit - However you may want a paint program to draw a heightmap, and to texture the resulting terrain. You may want a character mesh with a walk animation, you may also want a skybox , you may also want some trees or bushes or something....depends on just how simple or complex you want to get.

Last edited 2011


Kirkkaf13(Posted 2011) [#3]
Thanks the code is almost what I was after. If I was to load a model of a character, have a 3rd person camera and lets say a uneven terrain. When the character walks forward I obviously don't want to walk through higher points of the terrain but go over it. How could I do this?


Matty(Posted 2011) [#4]
To walk 'on' the terrain/uneven ground there are a number of methods.

If you use a blitz-terrain then simply using the terrainy function (see manual) you can get the height of the terrain at any point on the terrain.

If you use the collision system, set it up as sphere-polygon with sliding collisions then set the relevant entitytype for your character and terrain is another way.

You can use a linepick down from beneath the character's feet to get the distance from the ground..as long as the terrain pick mode is set to polygon.

I'm not going to go through the code for each of these but have a look at the castle demo that comes with blitz3d - that covers this pretty well.


Kirkkaf13(Posted 2011) [#5]
Thanks for your help Matty I will look into this.