Sprites in 3D

BlitzMax Forums/MiniB3D Module/Sprites in 3D

B(Posted 2015) [#1]
Hi all,

It's been a years since I've programmed or posted.
Glad to be back!

I've been messing around in minib3d the past few days, and just can't
seem to figure this out.

I've searched the web for tutorials and the like, but no dice.


I'm running into problems with displaying sprites in 3d space.
I get a ghost effect, the sprite is being displayed
multiple times. I figure it has something to do with the way I am
putting the sprite on screen with PositionEntity, but I can't solve the problem myself.

Here is my code.

(I apologize in advance for my utter noobness, it's been a few years.)
(I also apologize for not uploading the png imgs anywhere.



Here's a screenshot of my issue:



I'm looking to have the sprite just cycle through the images to make it
look like it is rotating around. But the previous sprites are still existing
after the new sprite is updated and placed on screen.

Totally new to minib3d, if there are any tutorials or documentation
I would appreciate a link.

So far I've only been able to find a list of commands on the github, but no documentation.

Thanks again guys,

B


Krischan(Posted 2015) [#2]
You should use LoadAnimTexture for this:

- create ONE sprite only
- load the animation strip with LoadAnimTexture (the 8 images should be merged together into one single horizontal texture)
- use the EntityTexture Command to apply the texture to the sprite (and to set the current animation frame)

The documentation of minib3d is identical with the Blitz3D commands but with some commands missing (like AlignToVector for example). And you could download the open source version of Blitz3D to get more practice how to use the commands studying the examples in the samples folder there.

One additional hint: if you use "Framework sidesign.minib3d" or "Import sidesign.minib3d" you mustn't compile the whole minib3d framework each time again and again as it gets compiled as a ready to use module in your binary. To make this work, the minib3d module must built once first copying the sidesign.mod folder to blitzmax/mod and start the compilation using the bmk command in the bin folder with:

bmk makemods -a -h sidesign.minib3d


B(Posted 2015) [#3]
Thanks Christian!

That helped quite a bit. I've been reading up on the blitz3d docs now.
Have a better understanding. Got my little animation to work finally!

Took me forever to realize that EntityTexture has to be called every loop.

Thanks for the quick reply!
And the Framework advice.

Cheers!
See you around.