MiniB3d for FreeBasic

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
duke4e
Posts: 717
Joined: Dec 04, 2005 0:16
Location: Varazdin, Croatia, Europe
Contact:

Postby duke4e » Jun 02, 2010 21:40

awesome! keep up the great work! this will come handy one day...
super_castle
Posts: 289
Joined: Oct 10, 2006 7:19

Postby super_castle » Jun 05, 2010 11:14

hello, who is "imageload" in the programm?
i can not found.

gruss
angros47
Posts: 1444
Joined: Jun 21, 2005 19:04

Postby angros47 » Jun 05, 2010 12:30

I don't understand what are you referring to.

There is no "imageload", in minib3d: you can load an image as a texture, with LoadTexture.

Internally, MiniB3d uses STBI to load the image: the LoadTexture (file texture.cpp) function calls stbi_load (file stb_image.c), that loads a picture in memory.

The format is not exactly the same of FB images.
You can also use stbi_load in FreeBasic (and you don't even need minib3d shared library to do that).
I've posted a sample here: http://www.freebasic.net/forum/viewtopic.php?p=133021#133021
super_castle
Posts: 289
Joined: Oct 10, 2006 7:19

Postby super_castle » Jun 10, 2010 15:20

why make sprite transparent with minib3d?

gruss
angros47
Posts: 1444
Joined: Jun 21, 2005 19:04

Postby angros47 » Jun 10, 2010 17:25

What do you mean? Anyway, check the alpha channel of the image.
super_castle
Posts: 289
Joined: Oct 10, 2006 7:19

Postby super_castle » Jun 10, 2010 21:07

hello, have you one demo for transparentsprite?

gruss
angros47
Posts: 1444
Joined: Jun 21, 2005 19:04

Postby angros47 » Jun 10, 2010 21:33

Still no demo, sorry. You can check on BlitzBasic site.

Anyway, I finally ported MiniB3d to linux:
http://www.file-pasta.com/file/0/Minib3d%200.1%20linux.tar.gz

Warning! Linux filesystem is case-sensitive, so be sure, if you want to load files (texture, models) that the name is written correctly.

The shared library is libminib3d.so

If you don't want to install it, just copy it in the directory where you have your freebasic program; to launch program, you have to do

Code: Select all

LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH  ./filename


In fact, this is another difference between Windows and Linux: in Windows, a program will look for shared libraries in its own directory, and in system folder; in linux, a program will look for shared libraries in path only (so, you have to explicitly tell it to look into its own directory)
angros47
Posts: 1444
Joined: Jun 21, 2005 19:04

Postby angros47 » Jul 17, 2010 12:58

Getting closer to load 3ds files. Also, the new version should allow to map images drawn in FreeBasic to textures.

Stay tuned...
angros47
Posts: 1444
Joined: Jun 21, 2005 19:04

Postby angros47 » Jul 23, 2010 11:43

Updated, check first post.

http://www.file-pasta.com/file/0/miniB3 ... r%20FB.zip

it includes a flight simulator, to show how easy is it.
kiyotewolf
Posts: 1009
Joined: Oct 11, 2008 7:42
Location: ABQ, NM
Contact:

Postby kiyotewolf » Aug 03, 2010 4:11

How did you make the dll into (or aided by) a .bi file?

I'm just curious.

You don't have to get into detail, cause this type of stuff is WAY over my head. I was just curious.



~Kiyote!
Westbeam
Posts: 239
Joined: Dec 22, 2009 9:24
Contact:

Postby Westbeam » Aug 03, 2010 8:55

Hey, thats amazing. I used Blitz3D before i found FreeBasic. Now i can write my 3D-Game without OpenGL. :D

I made a miniB3D-Logo with the BB-Spacefighter:
Image

And now ill write a tutorial: "3D-Programming with miniB3D".

Sorry for my bad english, im german :/
angros47
Posts: 1444
Joined: Jun 21, 2005 19:04

Postby angros47 » Aug 03, 2010 11:51

@Westbeam

Nice logo! I like it.

@kiyotewolf

I just converted the declarations from C to FreeBasic, then i used the "inclib" keyword.

http://www.freebasic.net/wiki/wikka.php?wakka=KeyPginclib

In fact, you can use it with no .a file, if the dll is in the current directory (or in path directory)
kiyotewolf
Posts: 1009
Joined: Oct 11, 2008 7:42
Location: ABQ, NM
Contact:

Postby kiyotewolf » Aug 04, 2010 0:39

@Westbeam

From the sounds of it, we should expect GREAT THINGS from you.

Voldemort did GREAT THINGS.. terrible things.. but great..

* kidding *

~~~

Anyways,.. yes, I am anxious to see what kind of cool stuff you make.



~Kiyote!
Westbeam
Posts: 239
Joined: Dec 22, 2009 9:24
Contact:

Postby Westbeam » Aug 04, 2010 12:08

Ive got a problem:
I can only load textures, when they are in the same directory as the source-code. When they are in another directory, you cannot see them.
:/
angros47
Posts: 1444
Joined: Jun 21, 2005 19:04

Postby angros47 » Aug 04, 2010 13:23

This is a bug of MiniB3d: it come from the fact that MiniB3d is derived from iMiniB3d, that has a subroutine that remove path info from file name.
Otherwise, many meshes that store texture name with path info would have crashed the library (because paths are managed in a different way under windows and posix)

For now, I haven't fixed it, since it requires a different fix for Windows and Linux version (because linux uses "/", windows uses "\").

Meanwhile, you can work around this bug by using "chdir".
I.E.

Code: Select all

chdir "data"
tex=loadtexture ("file.3ds")
chdir ".."

Return to “Libraries”

Who is online

Users browsing this forum: No registered users and 1 guest