Another attempt at 3D external using openb3d

Are you developing an External using the LiveCode Externals SDK?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
n.allan
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 127
Joined: Mon Mar 12, 2007 12:06 pm

Another attempt at 3D external using openb3d

Post by n.allan » Fri Jun 20, 2014 8:59 am

Hello, Continuing my mad obsession with 3D externals for windows Livecode, I have thrown together another one.

This one uses the OpenB3D library. OpenB3D uses openGL and is primarily intended for use in FreeBASIC. It has a long history too. From what I can gather....

Blitz3D used Direct X 7 and was discontinued, a new cross platform language was created, BlitzMax. BlitzMax users wanted 3D functionality that was cross platform....Enter MiniB3D.

It started out as MiniB3D. MiniB3D gave BlitzMax users Blitz3D functionality. It was also "extended" giving BlitzMax users a more complete 3D replacement for Blitz3D such as terrains etc... It was then ported to IOS, creating iMiniB3D. iMiniB3D was then stripped of it's objective c ties to create OpenB3D.

OpenB3D is still under development. It currently supports win32 and linux and has recently been ported to OSX for use in BlitzMax. so I got to thinking...

I have created an external for livecode that takes the livecode stack and creates an opengl context, the stack then loads the functions explicitly from the openb3d.dll and maps them to livecode functions and commands. They are mapped in such a way that it is fairly true to the original Blitz3D syntax (which I liked)

global camera
put CreateCamera() into camera etc...

The only thing I really did was create the context and openB3D does the rest. It is a remarkable library!

I will upload my wrapper dll and source later if anyone is interested. Maybe someone in the know could add an opengl context in Linux and OSX too, maybe even IOS!

n.allan
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 127
Joined: Mon Mar 12, 2007 12:06 pm

Re: Another attempt at 3D external using openb3d

Post by n.allan » Sat Jun 21, 2014 3:34 pm

OK, here are some bits and pieces.

The attached zip file has the compiled external extopenb3d.dll, the source for it, the ubiquitous Utah teapot model and a couple of stacks to test.

As well as these files, you will need to go onto sourceforge and download the latest openb3d.dll for win32. (For these tests I used V0.7).

Once you have the openb3d.dll, put it alongside these files OR stick it in your system32 / sysWOW64 folder (depending if you are running a 32 or 64 bit win32.

All commands are available (but not tested) Most are documented on Blitz3D docs website and some are not ( such as stencils, shadows and stuff ). If anyone wants I could rattle up some instructions or whatever.

There are only two major differences to the command set:

1. Graphics3D needs the title of the window passed to it along with the width and height (so that we can grab the handle) This will probably change in the future so I can go fullscreen, open another window or something I shall have to have a think about it.

2. Since "Flip" is a reserved keyword in LC I have used "Swap" instead.

You must call "Graphics3D before calling any other commands.

I'm not going to go in to too much detail at the moment unless anyone else wants info due to the fact that this murky section of the forum is not frequented by a lot of people.
Attachments
extopenb3d.zip
extopenb3d external for Livecode win32
(173.98 KiB) Downloaded 109 times

Post Reply

Return to “Building Externals/Plugins”