Complicated Problem with canvases and cameras

BlitzMax Forums/MiniB3D Module/Complicated Problem with canvases and cameras

Sanctus(Posted 2007) [#1]
I'm trying to make a map editor... and I have a main canvas where I show all the stuff... but I also have some canvases for previewing some objects that are going to be placed...
It all works on until I show up the preview canvas... then it starts to draw it but somehow it also draws that convas on the main canvas...
Here is a screen shot

Here are some code that migh me helpful to understand


UpdateObjects(5) is for showing some objects and UpdateObjects(4) is for hiding them


z4g0(Posted 2007) [#2]
(sorry i'm reply to your question :( .... but how you get the "2D line" 3D Grid? with a lot of cameraproject? )


CASO(Posted 2007) [#3]
Can you post a example because I don't really know what to do with the functions.

On another note, it might be a good idea to put this in a worklog so we can see your progress.


Sanctus(Posted 2007) [#4]
oh... I made a custom mesh... that has the triangles like a line...
Here is the code
Function CreateGrid:Tmesh(sgx:Int,sgy:Int,sx:Float,sy:Float)
	Local mesh:Tmesh = CreateMesh()
	Local surf:TSurface = mesh.CreateSurface()
	Local i:Int,vcount:Int=-1
	
	
	For i = 0 To sgx
		surf.AddVertex(-sgx*sx/2,0,i-sgy*sy/2)
		surf.AddVertex(sgx-sgx*sx/2,0,i-sgy*sy/2)
		vcount = vcount + 2
		surf.addtriangle(vcount-1,vcount,vcount-1)
	Next
	
	For i = 0 To sgy
		surf.addvertex(i-sgx*sx/2,0,-sgy*sy/2)
		surf.addvertex(i-sgy*sx/2,0,sgy-sgy*sy/2)
		vcount = vcount + 2
		surf.addtriangle(vcount-1,vcount,vcount-1)
	Next
	ScaleEntity mesh,sx,0,sy
	mesh.updatebuffer()
	MoveEntity mesh,1,0,1
	
	Return mesh
End Function



Sanctus(Posted 2007) [#5]
Btw on some systems it doesn't get drawn... or it gets drawn in a weird way...
Maybe Klepto will add one made out of the clasic GlLine or wathever it was.. so that every system will be able to draw the grid


z4g0(Posted 2007) [#6]
ahh! was on wireframe on!! didn't see the prev code, sorry!
Thanks anyway!


Sanctus(Posted 2007) [#7]
It doesn't meather if its wire or not...


klepto2(Posted 2007) [#8]
The next version will have 3Dline meshes built in. It is some kind of grid surface. You will add 3d lines to each surface and then all of them are drawn with the brush assigned.

btw: the current extended version already supports canvas graphics. You only have to keep track to reset the Cameraviewport for each camera.


Sanctus(Posted 2007) [#9]
THe thing is that I use Minib3dExt 0.31(or close) cuz the newer one does not work for me... I mean I replaced it in the game.. and it works but when I replace it in the app it doesn't render anymore altough I did modify the renderer like in the example...