MiniB3D Thread 3

BlitzMax Forums/MiniB3D Module/MiniB3D Thread 3

simonh(Posted 2006) [#1]
Thread 2

Latest Version: 0.27 - download from here.

0.27 features a few bug fixes, mostly relating to sprites which are now always displayed correctly and also a few other things.


degac(Posted 2006) [#2]
You are getting worst than Mark into making updates...:D


Chris C(Posted 2006) [#3]
nice solid work thanks for sharing


ckob(Posted 2006) [#4]
Simonh, I really appreciate all your hardwork on this project it's really helping out.


The r0nin(Posted 2006) [#5]
Sweet! Talk about quality (and responsiveness)!

What a great tool you've created!


Bobysait(Posted 2006) [#6]
is the link dead or just me who can't access to the website ?


ckob(Posted 2006) [#7]
works fine here.


patmaba(Posted 2006) [#8]
Note, How can use linepick method with minib3d ?

Special message For Boby, çà marche impec l'ami.


ozak(Posted 2006) [#9]
LinePick is not implemented yet.


Bobysait(Posted 2006) [#10]
strange issue... it 's the only link that i can't access. I can't solve it . Maybe anyone could post a mirror Link to download ? It would be lovely :)


Gabriel(Posted 2006) [#11]
I assume Simon doesn't mind, since it's a public download.

It's in my temp folder, so don't expect it to stay there for ever, but since you're having problems.

http://www.glimmergames.com/temp/MiniB3D-v027.zip


ckob(Posted 2006) [#12]
has anyone been able to get entitypick or camerapick to work? I've tried and failed.


Bobysait(Posted 2006) [#13]
Many thanx ! I try it in the minute.
[edit]
Many works done. really good !

But for the moment, there are so many functions not available, that i really often use like "CreateTexture" ,"TextureBuffer" , "getSurfacebrush" etc... and of course the TForm functions. So for the moment, i keep a look on this, but i can't use it.

Continue, it's really a good work !!!


ozak(Posted 2006) [#14]
What do people use for 2D with MiniB3D? Anyone hacked Max2D to work with it? I saw it somewhere in the forums, but can't find it ATM.


patmaba(Posted 2006) [#15]
About meshwidth, meshdepth and meshheigth functions, i received always 2.0

I had tested with different mesh the value returned for the theses functions is always 2.

I don't understand why ?


patmaba(Posted 2006) [#16]
Another problem about CountSurfaces.

When i use this functions, i received for my mesh value 0.

I test the same function CountSurfaces whit the same mesh in blitz3d the returne value is 4.


ozak(Posted 2006) [#17]
While I haven't testet it, the code for meshwidth etc. looks valid.

As for CountSurfaces it's used heavy internally, so that's probably ok too. Please re-check your results :)


ozak(Posted 2006) [#18]
We really should make Max2D support a priority in MiniB3D. It's such a pain doing it yourself each time :)


ozak(Posted 2006) [#19]
Hmm. Did some work on converting entity position to screen coords (for labels over objects etc.), but only the x position is correct.
The y Position keeps moving up for some odd reason.
I know the returned Y is reverse from normal.

' Object to screen stuff
	Method ObjectToScreen:TVector(Entity:TEntity)
	
		Local SX:Double
		Local SY:Double
		Local SZ:Double
		Local MVMatrix:Double[16]
		Local ProjMat:Double[16]
		Local VPort:Int[4]
		glGetDoublev(GL_MODELVIEW_MATRIX,Varptr MVMatrix[0])
		glGetDoublev(GL_PROJECTION_MATRIX,Varptr ProjMat[0])
		glGetIntegerv(GL_VIEWPORT,Varptr VPort[0])
		gluProject(EntityX(Entity),EntityY(Entity),EntityZ(Entity),MVMatrix,ProjMat,VPort, Varptr SX, Varptr SY, Varptr SZ)
		
		Return TVector.Create(SX, SY, SZ)

	
	End Method


Anyone?

I'm trying to do CameraProject for MiniB3D

CameraProject camera,x#,y#,z#
Parameters:
camera - camera handle
x# - world coordinate x
y# - world coordinate y
z# - world coordinate z



Dreamora(Posted 2006) [#20]
Strange, for me your method works (after changed to OO version as the compiler blocks because of object to int conversion beeing illegal).

But I'll do some other tests to see if it is only because of the setup of the basic entity test.


ozak(Posted 2006) [#21]
Hmm. No compiler errors here. (It's a method tho)
Although Y coordinate is everchanging, even though object is at center of screen.
A good guess is that some kind of projection is going on here.
Will investigate futher.


Dreamora(Posted 2006) [#22]
I edited the above post.
The projection issue is gone, was an error on my side!

Thats the code I used and put into the example after the other line of debugtext.
	Local vec:TVector = cam.ObjectToScreen(cube)
	DebugText 0,20, "Coords: " + vec.x + ","+vec.y+","+vec.z
	DebugText vec.x, height-vec.y, "Cube"  		' height - vec.y needed as OpenGL has reversed y. Else it looks like projection error!



ozak(Posted 2006) [#23]
Hmm. I tried that, but it didn't work. When are you calling ObjectToScreen? (Before/after renderworld etc.)
Also, mine is placed on a moving object.
It's correct that gluProject reverses the Y coordinate, since OpenGL starts at bottom left (weeeh, we've been smoking too much weed)

Can you make a very simple example that works for you?


simonh(Posted 2006) [#24]
patmaba - can you post an example program?

This program suggest MeshWidth/Height etc and CountSurfaces are working OK:

Import "../MiniB3D.bmx"

Local width=640,height=480,depth=16,mode=0

Graphics3D width,height,depth,mode

Local  cam=CreateCamera()
PositionEntity cam,0,0,-10

Local light=CreateLight(1)

Local tex=LoadTexture("media/test.png")

Local cube=CreateCube()

ScaleMesh cube,5,1,1

RenderWorld

DebugText 0,0,"MeshWidth: "+String(MeshWidth(cube))
DebugText 0,20,"Count Surfaces: "+String(CountSurfaces(cube))

Flip

WaitKey

ozak - Yeah I'll add Max2D support to the next version.


ozak(Posted 2006) [#25]
Btw: I'm working on the collision functions from Blitz3D and was wondering what the procedures are, if I should mail you a suggested update?


TeraBit(Posted 2006) [#26]
Hi Si,

I've also emailed some stuff you might find useful.


The r0nin(Posted 2006) [#27]
Yeah I'll add Max2D support to the next version.

Sweet! I was just starting to fiddle with straight OpenGL in order to find a better way to do 2D than using sprites childed to the camera (which led to the discovery of the sprite orientation issue you fixed so quickly!). This is a terrific tool. Thanks for your hard work!


ckob(Posted 2006) [#28]
I am still working on trying to get a camerapick to work but its proving to be pretty difficult.


Dreamora(Posted 2006) [#29]
Ozak:

I put your method on the TCamera class (think thats where you have it as well).

The code above was put into the basic example with the rotating cube etc straight after the other line of debug text so after renderworld ie about the last thing before the screen is flipped.

PS: For lazy programmers, here is the one with the correct y output. Just put it into the TCamera type.



And here is the whole test-privmitives.bmx, type based to make it work at all:




TeraBit(Posted 2006) [#30]
The stuff I sent Si was some CameraPick and LinePick code I did for my own OGL engine. I'm just going through MiniB3D at the moment and looking at the viability of integrating it.

[EDIT]

It's failed. It works very well in my Engine, but is a bit of a 'square peg in a round hole' for MiniB3D. :(


klepto2(Posted 2006) [#31]
Hi, my first post here: At first Simon, great work and I think with the help of this community this engine will be grow very fast.

Here is my addition i'm currently working on:

http://www.blitzforum.de/upload/file.php?id=451

It is a Terrain Engine (currently without LOD).
It should be in the end a Quadtree Terrain.

@Simon: Please add the UpdateNormals code from Mark, it is much faster here then yours. And for Terrains I need a good Updatenormals function.

Second Addition was a simply Wireframe command, but I think this is to small to post here ;)


ozak(Posted 2006) [#32]
Sent CameraProject to Simon. 100% like Blitz3D's.
Thanks to Dreamora for the help. I'll keep testing it tho.


deps(Posted 2006) [#33]
This project is sweet! But I have one question.
Was unsure if I should start a new thread, or just ask away here. I hope nobody minds if I ask here. :)

I haven't used Blitz3D before so I don't know if this is possible to do this, but is there a way to make a mesh a child to a bone? One example is to place a weapon in the hand of a player or enemy.

I looked at the TMesh code, TBone code and the TKeys code but all I found was a function in TMesh that makes a copy of all the bones. And it didn't look like it was useful in this case.

Thanks for any help, and for working on MiniB3D!


Dreamora(Posted 2006) [#34]
In Blitz3D it isn't a problem.
As a Bone is an entity and any entity accepts child you can simply parent the object to the bone.

Haven't tried in MiniB3D yet.


deps(Posted 2006) [#35]
How was this done in Blitz3D? I have been searching the code archives but haven't found anything that explains this.
Is the names for the bones saved in a B3D file?

EDIT:
Ooh, wait. There is a FindChild in TEntity. Looks like it could be useful in this case. :)


Dreamora(Posted 2006) [#36]
Yupp thats exactly the way it is done in B3D.
You load as AnimMesh and look for the bone by FindChild :)


deps(Posted 2006) [#37]
I think I found a small bug with the lights.
The Blitz3D manual says: "Specifying a parent entity will still result in the light being created at position 0,0,0 rather than at the parent entity's position."
But when I added a light as a child to a robot in my little test-MiniB3D-game the light was placed at the feet.


simonh(Posted 2006) [#38]
The doc is wrong.


Dreamora(Posted 2006) [#39]
Strange
Because current B3D creates entities with specified parent at 0,0,0, but not global 0,0,0 but parent 0,0,0. Or is this just an inconsistency on lights?

It does not make sense to place it somewhere else than 0 of the parent as it will move relative to it and relative to "somewhere" is a little pointless.


simonh(Posted 2006) [#40]
Because current B3D creates entities with specified parent at 0,0,0, but not global 0,0,0 but parent 0,0,0

Yes, CreateCamera/Light/Mesh etc, when a parent is specified, will position the child entity at local 0,0,0 (i.e. the parent entity's position). This is true for all entities in either B3D or MiniB3D.

The docs suggest that the child entity is created at global 0,0,0 when a parent is specified, which is wrong.

In dep's case I would guess that the local 0,0,0 is at the robot's feet.


deps(Posted 2006) [#41]
Well, I wanted it to be created at local 0,0,0. (at the feet of the robot.)
So it looks like there was no bug after all. Sweet. :)

Thanks.

Edit: A virtual cookie to the one who can guess what game I'm making a clone of, using MiniB3D. :)
Screenshot
(The zombie is a placeholder, will be removed later.)


TeraBit(Posted 2006) [#42]
[EDIT]
Oops.
[EDIT]
Well after some extensive testing I found out why why my LinePick / Camerapick stuff failed. All the Maths appear to be the reverse of my own OLG engine for some reason. :/


Chris C(Posted 2006) [#43]
yeah isnt that the way blitz3d did it?


ozak(Posted 2006) [#44]
Well. You can join the club. My CameraProject only works with one camera :)

Maybe we should just add the needed math to code it all ourselves, instead of relying on Glu stuff (thinking of frustum culling here too)
That way we could have the orthogonal stuff too.


patmaba(Posted 2006) [#45]
About my problem with the functions meshwidth, depth, height and count surface. The code work in a mini program.

The function work perfect with this code

Import "MiniB3D.bmx"

Graphics3D 800,600,16,2
m:TMesh=LoadMesh ("media/batfighter.b3d")
Print "CountSurfaces="+CountSurfaces(m)
Print "MeshWidth="+MeshWidth(m)
Print "MeshHeight="+MeshHeight(m)
Print "MeshDepth="+MeshDepth(m)
Print ""
Print "Press key to exit"

WaitKey


but in another program too big to post the result is incorrect

DebugLog:Entity XYZ CountSurfaces=0
DebugLog:Entity XYZ MeshWidth=-2.00000000e+009
DebugLog:Entity Base CountSurfaces=1
DebugLog:Entity Base MeshWidth=2.00000000

I havent found why


simonh(Posted 2006) [#46]
Email me the big program and I'll take a look.


deps(Posted 2006) [#47]
Got some problems with adding children to bones.

Looks like (TMesh) children isn't placed at the parent position, and they isn't moved when the parent moves, and isn't rotated when the parent is rotating.

Here is a method from my Droid Type:
	Method New()
	
		If Not e_droid Then 
			' Load the mesh, then hide it. Used for making copies of this one later
			e_droid = LoadAnimMesh("data/droidmk2.b3d")
			HideEntity( e_droid )
		EndIf
		
		If Not e_sight Then
			e_sight = LoadMesh("data/lasersight.b3d")
			HideEntity( e_sight )
		EndIf

		obj = CopyEntity( e_droid )
		
		' Place the droid
		Local x:Int = 2 ' Use known values for debug reasons.
		Local z:Int = 3 
		PositionEntity( obj, 20+(x*40),0,20+(z*40) )
		RotateEntity( obj, 0, Rand(0,3)*90, 0 ) ' Get a random direction

		Local b:TEntity = FindChild( obj, "borglaserend" )
		If b Then
			lasersight = CopyEntity( e_sight,b )
			ShowEntity( lasersight )
			EntityFX( lasersight, 1 )
		
			Print EntityX(lasersight,True)+","+EntityY(lasersight,True)+","+EntityZ(lasersight,True)
		Else
			Print "Unable to find the bone!"		
		EndIf
		
	EndMethod


The debug output says:
-0.0206391700,13.4376907,0.975049317


And that looks like the correct position, if the origin is at the droid's feet. But the droid is placed at (global) 100,0,140. So, if I understand things correctly, the Output Should have said something like:
99.98, 13.437,140.975

Since I tell EntityX,Y,Z to return the global coordinates.

Or am I wrong here?


simonh(Posted 2006) [#48]
Yeah, looking into, bones don't actually transform child entities at the moment - need to fix that.


patmaba(Posted 2006) [#49]
about countsurface and mesh size functions failed when Tmesh is used with loadanimmesh

here a code.

Import "MiniB3D.bmx"

Type TA
Field entity:TMesh

Method loadentity( pName:String )
entity = LoadAnimMesh( pName )
End Method
End Type

Graphics3D 800,600,16,2
m:TMesh=LoadMesh ("media/patmaba.b3d")
Print "CountSurfaces="+CountSurfaces(m)
Print "MeshWidth="+MeshWidth(m)
Print "MeshHeight="+MeshHeight(m)
Print "MeshDepth="+MeshDepth(m)
Print ""


A:TA = New TA
A.loadentity("media/patmaba.b3d")

Print "A CountSurfaces="+CountSurfaces(A.entity)
Print "A MeshWidth="+MeshWidth(A.entity)
Print "A MeshHeight="+MeshHeight(A.entity)
Print "A MeshDepth="+MeshDepth(A.entity)
Print "Press key to exit"

WaitKey


The r0nin(Posted 2006) [#50]
Quick question:

I'm working on a rudimentary collision detection and I'm having trouble with my terrain collisions. My terrain is a tilemapped series of meshes, so I'll need actual mesh collisions (rather than the bounding boxes I'm using for objects).

How are the values for each triangle/surface stored in the Tmesh type? Would I have to EachIn the surfaces of the mesh, then For-Next up to no_verts to get each of the vert coords (i.e. up to vert_coords[no_verts-1]) for each surface, with each vert_coords[i] representing either the x,y, or z value (relative to the mesh origin)? Are the vertexes themselves recorded in the array in clockwise order? Any help would be... er... helpful!


simonh(Posted 2006) [#51]
For vertices, you have one big array, with each vertex position stored like so: x (0), y (1), z (2), x (3), y (4), z (5) etc.

For triangles, you have another big array, with each vertex index stored like so: So: v2 (0), v1 (1), v0 (2), v2 (3), v1 (4), v0 (5) etc, with v0, v1, v2 representing the parameters in AddVertex.

So to get the vertex position for each triangle, you need to loop through the triangle array, get the vertex index, and use that to find the vertex position from the vertex array.


simonh(Posted 2006) [#52]
patmaba - your example runs OK here (I tested it with zombie.b3d). Can you send me your 'patmaba.b3d' model so I can test it with that?


klepto2(Posted 2006) [#53]
Hi, again.
Here is small status on how far I was coming in the last days.

Terrain Engine mainly stays (some minor things and tweaking to get nearly to the original Terrain)
Also added Wireframe (not such a big thing)
and
If someone is interrested, I have succesfully attached Shaders to the Brushtype.

BtW, here is small demo of the Terrain:

http://klepto2.kl.funpic.de/DL/TerrainDemo.rar

Arrow Keys to Move around
Mouse to Look around
W for Wireframe
and Left Mouse Button for a small Shader test

Enjoy.


simonh(Posted 2006) [#54]
Link's dead.


sigi(Posted 2006) [#55]
Rightclick and save as :)


klepto2(Posted 2006) [#56]
sorry, sometimes it works, sometimes not. But not long and I will have a better webspace. Currently follow sigi's post.


simonh(Posted 2006) [#57]
Seems to work well. What type of terrain system is it?


klepto2(Posted 2006) [#58]
It is a preoptimised Tiled Quadtree Terrain.
It is mainly based on this code: http://www.blitzbasic.com/Community/posts.php?topic=34168#368818
and currently I try to embbed it into MiniB3D. The only thing I have vurrently a problem with, is to get the height of the real terrain.


simonh(Posted 2006) [#59]
Hmmm, unfortunately Eole released that code with a license agreement, so I'm not sure I'd be able to add it to MiniB3D.

To get the real height of the terrain use this:

ya#=(y10-y00)*fx+y00
yb#=(y11-y01)*fx+y01
y#=(yb-ya)*fz+ya
Where y00,y01,y10,y11 are the height of the tile corners, and fx# and fz# are the fractional x and z positional values (0-1) within the tile.


klepto2(Posted 2006) [#60]
Well, I could make it new from scratch (now where I understand Quadtrees ;). and thx for the height formula, I will try it out.


Dreamora(Posted 2006) [#61]
From the license he added, there is nothing that prevents using it unless you are planning to make MiniB3D a commercial project.
But easiest thing is always to contact people and simply ask.

I'm currently porting Particle Candy to MiniB3D but need to add some commands before (I need TForm commands and Cam Project). When I'm done I'll send the code to its creator so he can decide if owners of the license get that code as well to use with MiniB3D.
I'm mainly interested in the speed difference we get because I'm quite sure that the BM-MiniB3D will be significantly faster.


deps(Posted 2006) [#62]
What about games that use MiniB3D? Will the license prevent them from being commercial?


ckob(Posted 2006) [#63]
SimonH: I think this module deserves its own website and forum Where we can collect togethor on MiniB3d specifically.


patmaba(Posted 2006) [#64]
I can't seend the model. I'm not the owner of the model.

But the model is exported with gile application( http://www.frecle.net/giles/ )

The problem come when i'm using LoadAnimMesh function.


Dreamora(Posted 2006) [#65]
Have you tried using TEntity for the type when using animmesh command on loading?
Main problem might be that Gile[s] head node has no geometry attached, it is only a pivot. so that might interfer perhaps.


patmaba(Posted 2006) [#66]
Impossible Dreamora, the load function is implemented into TMesh.


Dreamora(Posted 2006) [#67]
Sorry missspelled the idea perhaps a little.
What I meant is that you assign the loaded animmesh to a TEntity instead of TMesh

But thinking over it there is another simple reason why it won't work with animmesh: exactly the reason above. You are asking the head node for its surfaces ... and as it is only a pivot, it naturally has none. Nor has it a mesh width as no geometry is attached. You have to ask all of its childs for this informations.
Although I'm not sure if B3D in this case just uppropagandated all the bounding box informations to get the dimensions on the head as well. In this case, at least the width, height, depth are bugged if they don't return anything on the head pivot. (bugged or might be added later. Currently culling is on sphere base not bounding volume and the later is the data, width - height - depth would return on the head pivot normally)


simonh(Posted 2006) [#68]
Yeah, if the head node is a pivot, that might cause CountSurface/MeshWidth etc to return wrong values. I'll look into it.

Dreamora: The TForm commands and CameraProject commands are already in the new version (0.3), which will be released soon. I'm not sure MB3D will be quicker yet though.


Dreamora(Posted 2006) [#69]
Glad to hear :)
We will see if it is faster or slower.

It would definitely be cool if it would be faster, as OpenGL is causing less problems than DX7 does, the newer the graphics driver are.


klepto2(Posted 2006) [#70]
I have mailed Eole and I'm waiting for his answer now.

As long I'm currently working on GLSL Shader integration to the TBrush Type, which comes quite well.

My Terrain with a Environment Map Shader attached:



Here is some Code how to attach a Shader to the Brush:



In the mainloop you could do a simply Terrain.setShader(True/False) to switch it on/off.

If V 0.3 is ready I will build it in and send the code to Simon.


ozak(Posted 2006) [#71]
You rock simon! So. Can we have 0.3 soon? Really need that Max2D stuff :)


Dreamora(Posted 2006) [#72]
Have I mentioned that this thing is getting better and better?

I might consider dropping my "2D entity framework" idea and instead thinking about a way of integrating my own particle system into MiniB3D (it has its root back in ParticleDreams for those that have used it when it was available. But got a major redesign to work more efficiently) as I definitely like it and would like to contribute to it as well :-)


ozak(Posted 2006) [#73]
I'm working on a multiplayer action game with the current MiniB3D and it's more than capable. Also, my game runs on both Windows and Mac without problems :)


ckob(Posted 2006) [#74]
yeah ill add to it, I am using this for my project as well.


patmaba(Posted 2006) [#75]
thanks for the feedback about my problem. But have you a workaround with the gile exported model.


Dreamora(Posted 2006) [#76]
Currently the only workaround I could think if is:

Define minX,maxX / y / z:float
Define surfaces:int

Take your giles model and ask each child for its surface count and add that to surfaces
Ask each child for its width, depth, height, divide it by 2 and add it to entityX/y/z and see if it is larger / smaller than your minX / maxX etc and if so, apply it to the coresponding values.
As all the childs should be meshes (unless you exported lights as well), this shouldn't be a problem.


patmaba(Posted 2006) [#77]
Ok DreamOra, but to ask my model, i must used the count surface function. Before to start this function have trouble with gile model.


Dreamora(Posted 2006) [#78]
Don't understand your posting.

Yes you must use the count surface function, but not on your model. You have to use the Entity Child functions to get all childs and ask those for the surfaces as those are the meshes.

When I'm back home and find time, I'll possibly write you a function to do so.


ozak(Posted 2006) [#79]
Anyone noticed that regular alpha blending does not work with sprites? Also, when using Max2D I always get additive alphablending no matter what I specify (even no blend)

Regards

Ozak


Dreamora(Posted 2006) [#80]
With Max2D this is expected. If you add alpha information, they are taken into account on anyblend beside SolidBlend (no blend does not exist, default is Mask when I remember correctly)

Haven't tested on sprites yet. But isn't that exactly what Blitz3D does as well?
If you want a different behavior with Blitz3D it is normally a mix of EntityBlend and TextureBlend to compensate each other.


Koriolis(Posted 2006) [#81]
I will just add my own pointless post to say that this project looks quite exciting.
Kudos Simon, and keep up the good work.


klepto2(Posted 2006) [#82]
I have a calculation problem with my terrain system to get the current height at x,z.

Here is some code:


As you see: the terrain is based an patches (equal to meshes)
so if i have found a mesh via the getmesh method (returns definatly the right Mesh) I'm going through all triangles in the surface and compare the dist to the given x ,y and z position.
Well I know that the VertexX commands returns local positions
and I have taken look to the TForm commands in B3D and added the needed things to the Vertexpositions.
Now I would guess that the triangle Id should change in a constant way, if I move across the terrain, but it doesn't. It jumps from one Id to another or stays on one Id a long time, any Ideas how to solve this?

thx.


TeraBit(Posted 2006) [#83]
Alrighty then...

After banging my head against Left Handed/Right Handed Matrices for a Looong time. I've made some working additions to the TMatrix Class. Just add in these methods:



This will allow you to convert normals and vectors by an arbitrary matrix and to invert the matrix to do the opposite.


TeraBit(Posted 2006) [#84]
Example Program using the above to track the movement and rotation of a cube, shown by spheres.



Looks like this:



The Caffeine Kid(Posted 2006) [#85]
Amazing work everyone - this is truly the best BlitzMax community project anyone could ask for. I wish I had the 3d and math knowledge to contribute. You guys rock. :)


simonh(Posted 2006) [#86]
Just to let you know, I will probably opt against adding stuff like terrain systems, shader systems, bsps, md2s etc to the main release of MiniB3D. While the support and interest that MiniB3D is gained is quite overwhelming, there a couple of things which I need to make clear:

* While I am a member of BRL I cannot allow MiniB3D to become a conflict of interest with either B3D or Max3D, and therefore MiniB3D will remain exactly that - a lightweight version of B3D without all the bells and whistles. There are a few commands left that I wish to add (most of which will be forthcoming in the next release), but after than, I will consider MiniB3D to be pretty much 'done' (bar optimisations and bug fixes).

* MiniB3D is being written so that I can convert Super Gerball to the Mac. MiniB3D does not make me any money, Super Gerball does. Therefore really I cannot afford to devote more time to MiniB3D than is necessary, and while I would dearly like to spend all day attending to support issues and managing all the different author contributions, unfortunately my day job and other commitments dictate that I can't.

I hope you understand. Just felt the need to post this as I felt MiniB3D was spiralling out of control somewhat, and I haven't really got the time to contribute to this thread or project as much as I would like. I can promise though that I will continue to support and maintain MiniB3D as much as I can - my own game projects depend on it (at least until Mark releases his own GL B3D), so it won't be abandoned anytime soon.

Of course, people are still free to release their own add-ons and libs, so hopefully this won't affect anything too much. I just wanted to clarify that MiniB3D itself will not be developed much further.


ckob(Posted 2006) [#87]
ouch must be Blitz Research slapped your hand :(

well I hope as a community we will keep this going strong.


Dreamora(Posted 2006) [#88]
Don't see any conflict with Max3D. Max3D isn't targeted at the same market.

Nor is Blitz3D as it bases on an API not fully supported anymore by current graphic card drivers. (I'm getting more and more confusing issues on NV side).

but yes, I understand that you have a real life, like we all do have it :-)
But after all, it would be sad if the only BM based 3D engine would die, so I hope you won't go against people creating addon modules/sources for it to extend its possibilities.


LarsG(Posted 2006) [#89]
SimonH;
Perhaps, when you feel MiniB3D to be as complete as you want it to be, post it as a community project?
I think all the effort you put into it could be a very good base for others to expand on.. :)


TeraBit(Posted 2006) [#90]
From Mark's Worklog:
I am also designing Max3D with older hardware somewhat in mind, but any such version - if it ever actually happens - will have *less* capabilities than Blitz3D. Which oddly enough increases the chance of a GL Blitz3D happening one day - unless Si H's MiniB3D gets there first!



In all honesty, most of the Blitz community are waiting for Max3D before they start any real serious 3D work (I am). I already wrote a Mini 3D Engine that does some very similar things, but is certainly not as well/clearly written as MiniB3D (in my defence, I wrote it purely as a learning experience :)

I think that to get the most out of Max3D, it is good to play about with other Blitz written engines. Not only is it a good learning experience, It also helps us to see how these things are not trivial to write!

When Max3D does get out there, we'll see it for the cool stuff it's going to be. That's been my motivation for chipping in. It wouldn't occur to me to think that any 3D Engine I am likely to write/contribute to could be competing with Max3D.


Hotcakes(Posted 2006) [#91]
Max3D is cutting edge. B3D is old.

Both are very good things to be, for completely different reasons. There is no competition whatsoever with each other from what I can tell.

When MiniB3D reaches 'complete' as far as you're concerned simon... I think it would be a very wise idea for either you to create a Sourceforge page and hand control over to someone else, or BRL to take it up and offer it alongside Max3D.


xMicky(Posted 2006) [#92]
If BRL would be so kind to recognize the overwhelming resonance to MiniB3D (to me its more attractive than the announced Max3D stuff) - why don't they make it fully and officially to a product of them ? Should this not be possible with a product started by one members of their team ?? They might call it "Blitz 3D Next Generation" and I gladly would pay some money for it, if its Version 1.0 supports 2D graphics too.


Matthew Smith(Posted 2006) [#93]
Don't use the 3d side of things myself, but certainly the benefit of this project is getting existing Blitz3d projects into BlitzMax (almost better than a code converter tool).

I would not have thought it should/would be seen as a conflict to continue the module as it's a great way to bring people over to BlitzMax!

Much in the same way you might convert VB6 into VB.Net, in the end you will (eventually) either re-write it to take advantage of new features/functionality in the advanced product or start your new projects in BlitzMax.

Simon has done a great job and should be congratulated!!


Difference(Posted 2006) [#94]
Just to let you know, I will probably opt against adding stuff like terrain systems, shader systems, bsps, md2s etc to the main release of MiniB3D.


Sounds perfect. My intrest is in a "low end" 3D Engine, and MiniB3D fits the bill perfectly. I think the main thing to add is hardware checks and switches, that'll let it run on low end GFX cards. This is one of the true strenghs of the Blitz3D engine.

I'm really hoping that the any addition of shaders and such, *if they are made*, will be made as optional modules or at least as features that can be turned on and off.

There is also the possibillity to fork the project into a lowend and a highend version. Personally I think that if you want a high end 3D engine, you should go with one of the existing ones or wait for Max3D, but that's just me... ;)

PS: Thanks Terrabit, that matrix stuff works ace!

PPS: I have deployed a BMax OpenGL application on a number of lowend computers last year, and it is went rather well: 9 out of 10 would run the basic stuff though some did need a GFX card driver update.


Oddball(Posted 2006) [#95]
I don't see why this isn't bundle with the BlitzMax install. I see MiniB3D as an advantage to Max not as compatition to B3D. BRL should actively encourage Simon to complete it. But whatever happens I don't think the project should stray from it's original goal of working exactly as B3D does. I feel it's this clearly defined goal that has kept, and will keep, the project on track. If everyone is pulling in the same direction we'll get there quicker.


Dreamora(Posted 2006) [#96]
I don't think that anyone is planning to change the way the core is working, even in cases where B3D worked against a usefull behavior that then had to be faked again.


simonh(Posted 2006) [#97]
ouch must be Blitz Research slapped your hand :(

Not at all - in fact the opposite. Mark has helped with various things and gave his full support to the public release. The decision on how far to take MiniB3D is mine alone.

Don't see any conflict with Max3D. Max3D isn't targeted at the same market.

It doesn't conflict at the moment, if however shaders and particle systems were added to MiniB3D, then it starts edging into Max3D territory.

Nor is Blitz3D

If MiniB3D has more and more features added to it, then MiniB3D becomes MassiveB3D, and Blitz3D becomes MiniBlitz3D. Do you see?

But after all, it would be sad if the only BM based 3D engine would die

It wouldn't die, it would be finished - nothing more to add to it.

Sounds perfect. My intrest is in a "low end" 3D Engine, and MiniB3D fits the bill perfectly. I think the main thing to add is hardware checks and switches, that'll let it run on low end GFX cards

At last, someone on the same wavelength as me.


ozak(Posted 2006) [#98]
I agree with simons decision. After all, we got the source so we can add specific features we need.

We just need those picking/collision funcs :)


Hotcakes(Posted 2006) [#99]
I agree MiniB3D should not add any more than what B3D has, but I think everything simon gave examples of
I will probably opt against adding stuff like terrain systems, shader systems, bsps, md2s etc to the main release of MiniB3D.

with the exception of shaders, should eventually see it in by somebody...


klepto2(Posted 2006) [#100]
As I have written, I'm having Shaders already build in with MiniB3D, I'm not really satisfied how it is currently build into the engine so I have some Questions. Currently the Shader is build in TBrush, but this I have found out isn't a good solution because it is hard to handle if there is no shader, and you want just use standard textures. So I ask you what do you think of this idea:

I will start a TShader type which has a second set of textures
applied to itself. This Shader Type will be handled like TBrush without the whole blend modes etc. . And in the Program you only have to assign the textures used by the shader to the TShader class and could keep the TBrush as a Fallback, if there is no Shader available.

PS: I completely understand you Simon. I think addons could be handled like usermade libs for B3D, so you everyone is able to choose self what he wants in MiniB3D. So thx for this great expandable Engine.


Dreamora(Posted 2006) [#101]
Wouldn't a TShader as an extended TBrush make more sense, at least from the point of handling it as an addon to MiniB3D?
I don't know how you actually integrated it so this could be an extremely worse idea as well.
Just seemed like a good idea to me as you can change the default brush behavior to fit your shader behavior without needing to change / break with other stuff.


Smokey(Posted 2006) [#102]
Hi

First time I hear about minib3d

seem nice, I wonder why not add feature close to blitz3d
since I own B3D the only avantage would be speed probaly and have hability to compile to other platform, I wonder if Blitz Research today still make money of blitz3d since most of people here wait for max3d, for my point I will never get back to b3d because bmax offer much more possibility that Blitzbasic don't have.

by the way great work simon. :)


JonasL(Posted 2006) [#103]
Just downloaded 0.27. Is it just me or did CopyMesh() get broken? My code works just fine in 0.26, but in 0.27 the copied mesh is inside out.


patmaba(Posted 2006) [#104]
dear simonh,

can you please add a collision detection routine.

I don't know how to add a collision sytem like linepick.

But, i have found a doc about sphere tree collision detection

the url of the topic is
http://isg.cs.tcd.ie/spheretree/#examples


I'm starting a building spheretree, but the first step is hard

update the value of the to constant :
LE_MESH is the path of your mesh
LA_PROFONDEUR is the deep of the spheretree.





patmaba(Posted 2006) [#105]
Note 3DMathLib20.bmx us in the import command is
the 3D Math Library v2.0 from Chroma.

You can find the bmx file on code archive section.


ckob(Posted 2006) [#106]
here's sphere collision
http://www.blitzbasic.com/Community/posts.php?topic=63073

if that helps?


ozak(Posted 2006) [#107]
*cough* *codebox* *cough*


*(Posted 2006) [#108]
I think its a brilliant system on its own merits, it certainly shows what BlitzMax is capable of.


deps(Posted 2006) [#109]
Is the next version close to a release? It's quite usable as it is but some bugs makes things a bit complicated to do sometimes.


patmaba(Posted 2006) [#110]
Why not to put your Minib3d Library on http://sourceforge.net/

It's an idea


simonh(Posted 2006) [#111]
New version will be out in a few days.


patmaba(Posted 2006) [#112]
good news


JonasL(Posted 2006) [#113]
Ok, good news! I don't think anyone has confirmed or denied if CopyMesh() is broken in v 0.27. My copied models are suddenly turned inside out! Anyway, is that fixed in the new version or is it just me?


simonh(Posted 2006) [#114]
Yeah, to fix that you need to reverse the vertex order in one of the AddTriangle commands in AddMesh. From v2, v1, v0 to v0, v1, v2.


patmaba(Posted 2006) [#115]
Simonh, In your next version of MiniB3D do you provide a linepick and collisions function like B3d ?


Picklesworth(Posted 2006) [#116]
This has probably been solved, and I really wish I wasn't at risk of asking this a 2nd or 3rd time, but, alas...
I'll make a deal: When I learn this, I will try to round up some other information and add it to a MiniB3d FAQ at BlitzWiki.org.

I am trying to use MiniB3d with a simple but amazing LUA-utilizing thing, but to do so I need to know this:
How can I cast TMesh (or TEntity, I guess) to a Double or an Int?


gman(Posted 2006) [#117]
@Pickle - HandleFromObject/HandleToObject. keep in mind you must Release the handle when you are done with it as it increments the reference counter.


simonh(Posted 2006) [#118]
Simonh, In your next version of MiniB3D do you provide a linepick and collisions function like B3d

All the picking functions are in, no collision functions yet though. I'll probably add some basic sphere->poly collision stuff in the release after next.


DannyD(Posted 2006) [#119]
Getting a few errors in some but not all the examples in the tests folder on Mac os X
Building KBSplines
Compiling:MiniB3D.bmx
flat assembler  version 1.66
4 passes, 0.3 seconds, 701432 bytes.
Compiling:KBSplines.bmx
Compile Error: Type 'TBBType' not found
[C:/Documents and Settings/xxx/Desktop/Drop/MiniB3D-v027/MiniB3D-v027/tests/KBSplines.bmx;16;1]
Build Error: failed to compile C:/Documents and Settings/xxx/Desktop/Drop/MiniB3D-v027/MiniB3D-v027/tests/KBSplines.bmx
Process complete
Any ideas?


simonh(Posted 2006) [#120]
Thread 4