miniB3D - part4

163 replies to this topic
Posted 1+ years ago #151
AdamRedwoods

I've been working on collisions. It pretty much works now, after I've rewritten it countless times. It was difficult, took much longer than I expected. There are very few good math explanations online, they all leave something out. I also created a hybrid distance squared poly order versus the common normalized time, which helped.

Hopefully something by this weekend, I'm just trying to get smoother responses as the sphere crosses from poly to poly edge.

 
Posted 1+ years ago #152
julesd

Just want to confirm this, "implemented mojo using miniB3D"

Does this mean I can use these commands to do the drawing in the miniB3D
canvas?

Does this also mean it is not possible to use original mojo commands in the miniB3D canvas?

 
Posted 1+ years ago #153
julesd

is there a writepixel,or readpixel commands implemented,if not will there be something similar implemented soon?

fillcolor command would be nice to.

 
Posted 1+ years ago #154
AdamRedwoods

Does this also mean it is not possible to use original mojo commands in the miniB3D canvas?

some of the targets allow it, some don't (uses RestoreMojo2D() in OnRender()). we have to wait until a stable monkey V67 before i can figure out if it can be done.

i haven't tried Rone's implementation, but the base miniB3D uses a mysprite.Draw( x,y ) command to take care of most HUD needs. this uses the standard ScaleSprite, RotateSprite as well. YOu just have to do a EntityHide() after setup.

is there a writepixel,or readpixel commands implemented,if not will there be something similar implemented soon?

minib3d v0.33 (coming soon) allows dynamic pixel reading and writing to all targets.

 
Posted 1+ years ago #156
Xaron

Very nice, Adam! :)

 
Posted 1+ years ago #157
Rone

Just want to confirm this, "implemented mojo using miniB3D"

Does this mean I can use these commands to do the drawing in the miniB3D
canvas?

Yes...basically

Tested on glfw, html5, xna and d3d11(all v67b). Also added fontmachine yesterday. Seems fast and stable!
Unfortunately, I had to touch TTexture(PRESERVE SIZE flag added)... did not want to annoy with automatic scaling

I probably missed one or two functions:

Function B2DInit()
Function B2DEnd()
Function B2DLoadImage:B2DImage( path$,frameCount=1,flags=B2DImage.DefaultFlags)
Function B2DLoadImage:B2DImage( path$,frameWidth,frameHeight,frameCount,flags= B2DImage.DefaultFlags)
Function B2DEndRender()
Function B2DBeginRender()
Function B2DSetBlend( blend )
Function B2DGetBlend()
Function B2DDrawImage( image:B2DImage,x#,y#,frame=0 )
Function B2DDrawImage( image:B2DImage,x#,y#,rotation#,scaleX#,scaleY#,frame=0 )
Function B2DDrawImageRect( image:B2DImage,x#,y#,srcX,srcY,srcWidth,srcHeight,frame=0 )
Function B2DDrawImageRect( image:B2DImage,x#,y#,srcX,srcY,srcWidth,srcHeight,rotation#,scaleX#,scaleY#,frame=0 )
Function B2DDrawTextureRect( texture:TTexture,x#,y#,srcX,srcY,srcWidth,srcHeight)
Function B2DDrawTextureRect( texture:TTexture,x#,y#,srcX,srcY,srcWidth,srcHeight,rotation#,scaleX#,scaleY#)
Function B2DDrawTexture(texture:TTexture, x#, y#)
Function B2DDrawTexture(texture:TTexture, x#, y#, rotation#,scaleX#,scaleY#)
Function B2DDrawRect(x#,y#,width#,height#)
Function B2DDrawLine(x0#,y0#,x1#,y1#, linewidth# = 1 )
Function B2DDrawOval(x#,y#,w#,h#)
Function B2DDrawCircle( x#,y#,r# )
Function B2DSetMatrix( m#[] )
Function B2DSetMatrix( ix#,iy#,jx#,jy#,tx#,ty# )
Function B2DGetMatrix#[]()
Function B2DGetMatrix( matrix#[] )
Function B2DPushMatrix()
Function B2DPopMatrix()
Function B2DTransform( ix#,iy#,jx#,jy#,tx#,ty# )
Function B2DTransform( m#[] )
Function B2DTranslate:Void(x#,y#)
Function B2DScale(sx#,sy#)
Function B2DRotate(angle#)
Function B2DSetColor(r#,g#,b#)
Function B2DGetColor#[]()
Function B2DSetAlpha(a#)
Function B2DGetAlpha#()
Function B2DSetScissor( x#,y#,width#,height# )
Function B2DGetScissor#[]()
Function B2DSetFont( font:B2DImage,firstChar=32 )
Function B2DGetFont:Image()
Function B2DTextWidth#( text$ )
Function B2DTextHeight#()
Function B2DFontHeight#()
Function B2DDrawText( text$,x#,y#,xalign#=0,yalign#=0 )

https://github.com/sascha-schmidt217/minib3d-monkey/tree/minib3d.0.32_d3d11/util
https://github.com/sascha-schmidt217/minib3d-monkey/blob/minib3d.0.32_d3d11/ttexture.monkey
firepaint sample:
https://github.com/sascha-schmidt217/minib3d-monkey/blob/minib3d.0.32_d3d11/examples/firepaint2d.monkey

Please let me know, if errors occur!

In general, it seems that xna/d3d11 have SamplerStates issues(also seen in TText). Would appreciate any help!

@Adam
you mean some time ago, that you found a problem with XNA Draw() and you fixed it...was this related to pixel perfect drawing??
I only ask because d3d11 has the same problem and I don't want to spend time if you have already found the error, which is probably the same in d3d11...

 
Posted 1+ years ago #158
Amon

Any news on the release, Adam?

 
Posted 1+ years ago #159
Xaron

Don't push him to hard! He's doing an amazing job and that collision stuff will work, I'm really sure. So far I can already work with the existing stuff.

 
Posted 1+ years ago #160
StoneFaceEXE

Just to point out a thing that maybe was already pointed out.
Minib3d on android does not support foldering of data files.

I had two similar projects, with only one difference - 2nd project's files were placed in folders inside .data folder. GLFW handled them okay, but on android it refused to load anything that is not in the root directory of .data folder.

Dunno if that was already known, just in case )

UPD: Nevermind again stupid post of mine. It's just android target that ignores folders that start with _

 
Posted 1+ years ago #161
Xaron

Hehe, well yes, I just wondered because it works here...

 
Posted 1+ years ago #163
Xaron

Nice! Keep up your great work, I really appreciate it!

 
Posted 1+ years ago #164
julesd

@Rone

re-posted in part 5