MiniB3d for FreeBasic
MiniB3d for FreeBasic
This is MiniB3D for FreeBasic:
http://sourceforge.net/projects/minib3d/
Windows and Linux version.
Previous version is:
http://www.file-pasta.com/file/0/miniB3 ... r%20FB.zip
(Windows)
http://www.file-pasta.com/file/0/MiniB3 ... nux.tar.gz
(Linux)
(first version at http://www.file-pasta.com/file/0/minib3 ... ebasic.zip)
I took iMiniB3D (that was written in C++ and ObjC), ported it to C++, compiled to a DLL with MingW, and made a simple .bi file.
I've made some changes from original miniB3D:
-this version uses quaternions internally (thanks to warner): so, no more gimbal lock.
-this version uses stb_image.c to load textures: no more OS-specific depandancies.
It supports also terrains, and 3ds files.
http://sourceforge.net/projects/minib3d/
Windows and Linux version.
Previous version is:
http://www.file-pasta.com/file/0/miniB3 ... r%20FB.zip
(Windows)
http://www.file-pasta.com/file/0/MiniB3 ... nux.tar.gz
(Linux)
(first version at http://www.file-pasta.com/file/0/minib3 ... ebasic.zip)
I took iMiniB3D (that was written in C++ and ObjC), ported it to C++, compiled to a DLL with MingW, and made a simple .bi file.
I've made some changes from original miniB3D:
-this version uses quaternions internally (thanks to warner): so, no more gimbal lock.
-this version uses stb_image.c to load textures: no more OS-specific depandancies.
It supports also terrains, and 3ds files.
Last edited by angros47 on Oct 16, 2010 18:05, edited 3 times in total.
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Awesome work and simple to use!
Here's an updated example:
(note that this is my first contact with minib3d)
Here's an updated example:
(note that this is my first contact with minib3d)
Code: Select all
#include "minib3d.bi"
#include "fbgfx.bi"
Using FB
Const xres = 1024
Const yres = 768
Screenres xres, yres, 32,, GFX_OPENGL
Graphics3d xres, yres, 32, 1, 1
Var camera=createcamera(0)
CameraViewport(camera,0,0,xres,yres)
Var bird=LoadAnimMesh ("bird.b3d",0)
moveentity bird,0,0,15
animate bird,1,.1,0,0
AmbientLight(0, 255, 255)
Do
EntityAlpha bird, Abs(Cos(Timer))
If Multikey(SC_W) Then turnentity bird, -1, 0, 0, 0
If Multikey(SC_S) Then turnentity bird, 1, 0, 0, 0
If Multikey(SC_A) Then turnentity bird, 0, -1, 0, 0
If Multikey(SC_D) Then turnentity bird, 0, 1, 0, 0
If Multikey(SC_Q) Then turnentity bird, 0, 0, -1, 0
If Multikey(SC_E) Then turnentity bird, 0, 0, 1, 0
If Multikey(SC_RIGHT) Then TranslateEntity bird, 1, 0, 0, 0
If Multikey(SC_LEFT) Then TranslateEntity bird, -1, 0, 0, 0
If Multikey(SC_DOWN) Then TranslateEntity bird, 0, -1, 0, 0
If Multikey(SC_UP) Then TranslateEntity bird, 0, 1, 0, 0
updateworld 1
renderworld
Flip
Loop Until Multikey(SC_ESCAPE)
-
- Posts: 206
- Joined: Aug 27, 2005 2:02
- Location: Istanbul, Turkey
Very very nice and easy. Thank you.
I tried the executables on Linux with Wine, and they both work flawlessly.
I also tried to compile the source, but no use. It gives;
and stops.
I try a simple make command though. I'll try it with headers from Mingw later.
Great job again.
Anil
I tried the executables on Linux with Wine, and they both work flawlessly.
I also tried to compile the source, but no use. It gives;
Code: Select all
surface.cpp:10:21: error: gl\GLee.h: No such file or directory
I try a simple make command though. I'll try it with headers from Mingw later.
Great job again.
Anil
Last edited by joseywales72 on Apr 20, 2010 9:48, edited 1 time in total.
-
- Posts: 147
- Joined: May 24, 2009 23:13
- Location: Texas, United States, Planet Earth
- Contact:
-
- Posts: 289
- Joined: Oct 10, 2006 7:19
I have sometimes tested with SDL and a Screen of FB-Basic with ScreenRes 200,200,32.
On the ScreenRes is with PSet (numberx,numbery), RGB (255,0,0).
Wonderful, 2 Screens with Opengl and Minib3d.
On the ScreenRes is with PSet (numberx,numbery), RGB (255,0,0).
Wonderful, 2 Screens with Opengl and Minib3d.
Code: Select all
#Include "minib3d.bi"
#Include "SDL/SDL.bi"
#Include "fbgfx.bi"
#Include "windows.bi"
#Include "crt.bi"
USING FB
Const SCR_WIDTH = 500
Const SCR_HEIGHT = 500
Const BPP = 16
Dim vpage as SDL_Surface Ptr
Dim event as SDL_Event
Dim As Integer result,camera,bird,zahlx,zahly
result = SDL_Init(SDL_INIT_EVERYTHING)
if result <> 0 then
end 1
end If
ScreenRes 200,200,32
ScreenControl SET_WINDOW_POS, 10,10
vpage = SDL_SetVideoMode(SCR_WIDTH, SCR_HEIGHT, BPP, SDL_OPENGL or SDL_OPENGLBLIT)
if vpage = 0 Then
SDL_Quit
end 1
end If
SDL_WM_SetCaption "test", ""
Graphics3d SCR_WIDTH, SCR_HEIGHT,32,1,1
camera=createcamera(0)
CameraViewport(camera,0,0,500,500)
bird=LoadAnimMesh ("bird.b3d",0)
moveentity bird,0,0,15
animate bird,1,.1,0,0
Do
Sleep 5
If multikey( FB.SC_q ) Then
turnentity bird,1,0,0,0
End If
If multikey( FB.SC_w ) Then
turnentity bird,-1,0,0,0
End If
If multikey( FB.SC_e ) Then
turnentity bird,0,-1,0,0
End If
If multikey( FB.SC_s ) Then
turnentity bird,0,1,0,0
End If
zahlx=INT(RND * 199) + 1
zahly=INT(RND * 199) + 1
PSet(zahlx,zahly),RGB(255,0,0)
updateworld 1
renderworld
SDL_GL_SwapBuffers
SDL_PumpEvents
loop until( (SDL_PollEvent( @event ) <> 0) and (event.type = SDL_MOUSEBUTTONDOWN))
-
- Posts: 289
- Joined: Oct 10, 2006 7:19
-
- Posts: 289
- Joined: Oct 10, 2006 7:19
-
- Posts: 289
- Joined: Oct 10, 2006 7:19
Not yet, sorry.
There is a modded version of MiniB3d (only for BlitzMax) that supports terrains, quaternions, and 3DS: http://www.hi-toro.com/blitz/sidesign.zip
I'm porting it in C++: I've already ported quaternions, and now I'm working on terrains; after that, I'll give a look at 3ds loader.
Of course, if someone wants to help, I'll appreciate it.
There is a modded version of MiniB3d (only for BlitzMax) that supports terrains, quaternions, and 3DS: http://www.hi-toro.com/blitz/sidesign.zip
I'm porting it in C++: I've already ported quaternions, and now I'm working on terrains; after that, I'll give a look at 3ds loader.
Of course, if someone wants to help, I'll appreciate it.
-
- Posts: 289
- Joined: Oct 10, 2006 7:19
Finally, a new version!
This one supports LOD terrains. You can use an heightmap, or manually draw/modify the terrain with ModifyTerrain.
Demo included.
Download it at:
http://www.file-pasta.com/file/0/Minib3 ... r%20FB.zip
This one supports LOD terrains. You can use an heightmap, or manually draw/modify the terrain with ModifyTerrain.
Demo included.
Download it at:
http://www.file-pasta.com/file/0/Minib3 ... r%20FB.zip
-
- Posts: 289
- Joined: Oct 10, 2006 7:19