MiniB3d for FreeBasic

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
Posts: 110
Joined: Jul 31, 2015 11:23
Location: Hungary

Re: MiniB3d for FreeBasic

Postby ITomi » Jul 10, 2018 15:54


I have a little problem. I would like build up a 3D world on the basis of a 2D map. Everything OK, all trees, enemies are visible - except the player's weapon.
Here is my code:

Code: Select all

dim as ubyte w,h,value,x,z
    select case which
    case 1
        restore level1
    end select
    read w
    read h
    x=1 : z=1
    for i as ubyte=1 to h
        for j as ubyte=1 to w
            read value
            select case value
            case 3 'player
                positionentity camera,x*xspace,entityy#(camera),z*zspace '[b]!!![/b]
                scalesprite weapon,0.2,0.2
                entitytexture weapon,weapontex(0)
                positionentity weapon,entityx#(camera),entityy#(camera)-0.6,entityz#(camera)+1.1

If I remove the marked line with three exclamation marks, the weapon become visible at last, but in this case I can't place it, because its coordinates at 0,0,0, but I would like place it an other place. The camera already exists; I did it outside of that subprogram.

Return to “Libraries”

Who is online

Users browsing this forum: No registered users and 0 guests