3Dit, manages Bennu 3D with Bennu 2D LOCALs only

Started by Windgate, February 02, 2010, 09:09:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Windgate

Hi all,
here is an utility, a .prg file which has a PROCESS called make_3dit ( )

That PROCESS allows you to use: file, graph, x, y, z, angle and size on Bennu 3D just like in Bennu 2D, so you don't have to be care about the weird Bennu 3D syntax.

Here is an example of a process that uses 3dit and moves, rotate, scale, advance and change graph using LOCAL variables only:

PROCESS dummy ( )
BEGIN

make_3dit ( );
file = load_model ( "model/ogre/ogre.md2" );
graph = load_texture ( "model/ogre/ogre001.pcx" );

LOOP

// Moving test along x,y,z axis
IF ( key ( _Q ) )
x++;
ELSEIF ( key ( _E ) )
x--;
END
IF ( key ( _R ) )
y++;
ELSEIF ( key ( _F ) )
y--;
END
IF ( key ( _Z ) )
z++;
ELSEIF ( key ( _X ) )
z--;
END

// Rotation test along y axis
IF ( key ( _A ) )
angle -= 1000;
ELSEIF ( key ( _D ) )
angle += 1000;
END

// Resize test along x,y,z (uniform)
IF ( key ( _C ) )
size++;
ELSEIF ( key ( _V ) )
size--;
END

// Advance test
IF ( key ( _W ) )
advance3d ( 4 );
ELSEIF ( key ( _S ) )
advance3d ( -4 );
END

// Change texture test
IF ( key ( _1 ) )
graph = load_texture ( "model/ogre/ogre001.pcx" );
ELSEIF ( key ( _2 ) )
graph = load_texture ( "model/ogre/ogre002.pcx" );
ELSEIF ( key ( _3 ) )
graph = load_texture ( "model/ogre/ogre003.pcx" );
END

FRAME;
END
END


And here you can download the sample, it includes all Bennu 3D dlls, bgdc, bgdi, with last versions, a RunWin.bat launcher, all ready to compile, run, even modify it:

DOWNLOAD: http://trinit.es/DescargaDirecta/Bennu3D/3Dit/3Dit%200.0.0.zip

So enjoy!
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

SplinterGU

Download Lastest BennuGD Release: http://www.bennugd.org/node/2


Imerion

Sounds good! I haven't tried the Bennu 3D library yet (waiting for a Linux version), but this should certainly come in handy once it's done!
Try my games : Neotron Games

Windgate

I think it works well with Wine... And there is a new version for Linux, I haven't tried it yet, if you want to... :D
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

Imerion

Sounds good! I'll check it out once I finish the games I am working on for the moment. I have a feeling that if I get my hands on a nice and easy to use 3d library I won't be able to put it down. :) Perhaps the library will be more finished by then as well.
Try my games : Neotron Games

Windgate

Here is a new version with a very easy example:

DOWNLOAD: http://trinit.es/DescargaDirecta/Bennu3D/3Dit/3Dit%200.2.0%20test.zip

I hope it could help you, it is very very very easy to manage with Bennu 3D with this module :D
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

Imerion

Yep, looks excellent and really easy to use! This is how I always wanted 3D to work in Bennu. Perhaps, once you have finished some more of it, you could put it together to a single module, like mod_3dit, which includes both these functions and the Bennu3D library.
Try my games : Neotron Games

Windgate

I talked with SplinterGU about it, it would be easier to use, since you wouldn't have to call make_3dit ( ) on each process... The problem is I don't know how to make dlls... :S And this dll is not trivial.
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

Windgate

New version with very very interesting improves and changes :P

Free 3D rotation and position, absolute and relative, 100% working

DOWNLOAD: http://trinit.es/DescargaDirecta/Bennu3D/3Dit/3Dit%200.4.0.zip

Example code of a character walking over a map with gravity and WoW-like controls:

PROCESS ogre ( )
BEGIN
make_3dit ( );
model = load_model ( "model/ogre/ogre.md2" );
texture = load_texture ( "model/ogre/ogre001.pcx" );
state = 0;
absolute = FALSE;
gravity ( map );
LOOP
IF ( key ( _W ) )
advance3d ( 4.0 );
state = 1;
ELSEIF ( key ( _S ) )
advance3d ( -4.0 );
state = 1;
ELSE
advance3d ( 0.0 );
state = 0;
END

IF ( key ( _Q ) )
strafe3d ( 4.0 );
state = 1;
ELSEIF ( key ( _E ) )
strafe3d ( -4.0 );
state = 1;
ELSE
strafe3d ( 0.0 );
END

IF ( key ( _A ) )
rotation.y = -4.2;
ELSEIF ( key ( _D ) )
rotation.y = 4.2;
ELSE
rotation.y = 0;
END

IF ( key ( _SPACE ) )
jump ( map , 200 );
END

FRAME;
END
END


Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

Windgate

#10
New version with a test program for each utility, all comments and instructions in english ;)

Now included Bullet advanced physics and more!!!

http://trinit.es/DescargaDirecta/Bennu3D/3Dit/3Dit%200.5.0.zip
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

Imerion

Awesome! It's nice to see you keep working on this. Eventually I will start to make some 3D-games, and then this will be very useful!
Try my games : Neotron Games