MiniB3d for FreeBasic

Headers, Bindings, Libraries for use with FreeBASIC, Please include example of use to help ensure they are tested and usable.
Post Reply
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: MiniB3d for FreeBasic

Post by angros47 »

You need to scale the texture itself, with the command ScaleTexture. The flag 16 prevents the texture to repeat, so avoid it
ITomi
Posts: 154
Joined: Jul 31, 2015 11:23
Location: Hungary

Re: MiniB3d for FreeBasic

Post by ITomi »

Happy new year and thanks, Angros47, but something isn't work with it yet...
I have four cubes to bound the game field and I scale these to fit the edge of field:

Code: Select all

wall(0).itsimage=CreateCube()
PositionEntity wall(0).itsimage,1,entityy#(kamera),1
ScaleEntity wall(0).itsimage,pszel*pxegys,1,1
EntityTexture wall(0).itsimage,walltexture
ScaleTexture walltexture,pszel*pxegys,1

(...)

wall(3).itsimage=CreateCube()
PositionEntity wall(3).itsimage,pszel*pxegys,entityy#(kamera),1
ScaleEntity wall(3).itsimage,1,1,pmag*pzegys
EntityTexture wall(3).itsimage,walltexture
ScaleTexture walltexture,1,pmag*pzegys
The texture ("walltexture") is the same on each walls. But I do anything, the result is an ugly, smeared stripe instead of the wall texture. I have no idea what is wrong... :-/
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: MiniB3d for FreeBasic

Post by angros47 »

If you scale the entity itself, the texture, too, is stretched to fit. So, if you scale up the cube, and you scale up the texture as well, texture will be scaled twice. If you want to enlarge a cube, still keeping bricks at the same size, you have to scale down the texture (if you double the size of the cube, you have to half the size of the texture)

Also, in a cube made with CreateCube, all faces use the same texture, that will fit the face exactly in the same way. So, if you apply a brick texture on it, every face will show the same amount of bricks. And it happens even after a ScaleEntity command, so if you deform the cube to turn it into a rectangular box, for example, the long side and the short side will still show the same number of bricks, that will look much smaller on the short side.

If you want to turn a cube into a wall, make sure that only two faces of it are visible. If you want to make a sort of maze made of blocks, so you can see the corners of walls, as well, you should combine several cubes for long walls, as you would do in a tile map
ITomi
Posts: 154
Joined: Jul 31, 2015 11:23
Location: Hungary

Re: MiniB3d for FreeBasic

Post by ITomi »

Wow, thank you Angros47 for the helpful explanation! Now I scaled down the size of texture, so it looks perfectly!
And one more question: why the camera entity avoid collision with a sprite in up or down direction on the basis of this code:

Code: Select all

kamera=createCamera()
EntityType kamera,1
EntityRadius kamera,2
(...)
var a_tree=createsprite()
entitytexture a_tree,treetexture
entitytype a_tree,2
entityradius a_tree,1

collisions 1,2,2,2
I would like avoid these obstacles left or right just like the walls, but now the camera moves up or down in case of collision. I tried use values 1 and 2 too, but the result is the same.
Maybe can't I avoid a sprite with this method?
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: MiniB3d for FreeBasic

Post by angros47 »

Try with:

Code: Select all

collisions 1,2,1,2
That would set the ellipsoid-to-ellipsoid collision methods. Your code has set ellipsoid-to-polygon method, that is more accurate against large and complex meshes, but is not suitable to work well with sprites, that have very few polygons
ITomi
Posts: 154
Joined: Jul 31, 2015 11:23
Location: Hungary

Re: MiniB3d for FreeBasic

Post by ITomi »

Thank you; now it is works with sprites, although now I can go across the walls. Then should I use different collision values to walls and sprites?
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: MiniB3d for FreeBasic

Post by angros47 »

Yes. You can set as many collision rules as you want. The sprites and the wall must have different EntityType than the wall

Something like:

Code: Select all

entitytype a_tree,2
entitytype walls,3

collisions 1,2,1,2
collisions 1,3,2,2
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: MiniB3d for FreeBasic

Post by angros47 »

I wrote a command reference, but I am still unsure about how to publish it: should I make a PDF? Or a markdown file? Or a series of HTML? Or an epub?

So far, the file is in ODT format, and it contains the OpenB3D commands in alphabetical order. I am open to ideas
badidea
Posts: 2586
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: MiniB3d for FreeBasic

Post by badidea »

Why not multiple formats? The ODT itself (if you want to share that one) and whichever format it easy to convert to. PDF should be easy from ODT. HTML is convenient for linking to a section from e.g. this forum directly.
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: MiniB3d for FreeBasic

Post by angros47 »

Here is the raw ODT:

https://www.mediafire.com/file/4vhhrh03 ... D.odt/file

I'd appreciate any help to make it more readable
Gunslinger
Posts: 103
Joined: Mar 08, 2016 19:10
Location: The Netherlands

Re: MiniB3d for FreeBasic

Post by Gunslinger »

Very nice and very usefull. i need time to read all.
After a firt look i think your document can use a index en page nummers.
Cant help you with my english..

And what i like to see and know is a page on backgroud info about openB3D.
Special for users who start with it now.
Thanks

Edit:
Why is it not in this fork list?
https://github.com/si-design/iminib3d/network/members
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: MiniB3d for FreeBasic

Post by angros47 »

An index would be easy to add, although I thought it would be better a clickable index, and no page numbers

And OpenB3D it is not on the fork list of iminib3d because that list is not maintained by me.
badidea
Posts: 2586
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: MiniB3d for FreeBasic

Post by badidea »

angros47 wrote:Here is the raw ODT:
https://www.mediafire.com/file/4vhhrh03 ... D.odt/file
I'd appreciate any help to make it more readable
I am a bit confused. You have this document, but you also have documentation in wiki form on Sourceforge. I don't like Sourceforge too much, but having the library and documentation together makes sense. But you don't like this wiki format? Or do you want to include the manual with the library in the zip-file (or separate) download?

I did a bit of reading and it seems that Microsoft's CHM format was such a big success in 1997 that no one bothered writing a good alternative?

I came across the DocBook format, which can be created with the Bluefish editor, but it does not look very user friendly (or at least not wysiwyg). DocBook is a pseudo-XML format intended for machine-readable translation into HTML, PDF and other formats. The linux kernel seems to be moving away from DocBook to Sphinx/reStructuredText.

If I look at WinFBX from JoseRoca, he uses markdown files, which looks very nice online on GitHub. But when I download WinFBX, I don't know how to use the md-files in the same way.

I have almost no experience with OpenB3D so I cannot say much useful about the contents of this 53-page manual at the moment.
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: MiniB3d for FreeBasic

Post by angros47 »

I started working on the wiki on Sourceforge years ago, but I was never really satisfied, so I dropped it: that wiki would have required, to contribute, to be registered to Sourceforge, and most people here are not, so the main advantage of having a wiki was gone.

Also, a wiki is a perfect way to provide online documentation, but it's not a good way to provide offline documentation, since there is no easy option to download it, and even if it were, it's unpratical to view offline without installing the server software.

Also, it is not easy to download in case I wanted to move the hosting from sourceforge to github or any other repository. So, I decided to use what I had already written, integrating it also with the original Blitz3D documentation (that is now open source), and to add the missing parts, but I haven't put it in a wiki anymore.

The CHM, or the HLP formats are pretty good ones (the windows HLP format allowed in the '80s the creation of hypertexts that were as good as the early web pages, this was pretty ahead of its time) but they are windows specific.

For now, I chose the ODT format because it can be easily exported to epub, pdf or html, so it should be easier to generate documentations in other formats. But I am still unsure about how to organize it
badidea
Posts: 2586
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: MiniB3d for FreeBasic

Post by badidea »

If I look at your ODT file with LibreOffice (which I normally only use for simple things), all subroutines are displayed with grey background. Has this a special meaning in the ODT format or is this just text grey background? They don't seen to be cross-references or hyperlinks. There are hyperlinks in it which link to other documents not existing on my computer, like:

file:///home/badidea/.wine/drive_c/Blitz3d/help/commands/3d_commands/CameraFogRange.htm
file:///home/badidea/vecchio hard disk/Blitz3d/help/3d_commands/GetSurfaceBrush.htm


If you create cross-reference targets for each subroutine, you can then build an index. I don't know enough about OpenB3D what index layout is best. The layout on the sourceforge wiki is not good? When I export to XHTML I get something like this: https://nr100.home.xs4all.nl/badidea/OpenB3D.html (which looks quite nice).

(Maybe you already know all this already, then you can ignore this post. Then at least I learned something today.)
Post Reply