b3d display

Archives Forums/Blitz3D SDK Programming/b3d display

ziggy(Posted 2008) [#1]
I need a way to show a mesh using visual basic + blitz3DSdk in a way the mesh fits the current canvas size so it is not too big and it is not too small.
Any ideas how to do this? I'm working on a preciew application.


Mr. Slat(Posted 2008) [#2]
well as far as I know, You would need an openGL/dx object . not sure where to find though.


Dreamora(Posted 2008) [#3]
sounds like a job for fitmesh + camerapicking the 4 corners of your canvas (assuming you have 2 planes one below the object and 1 behind vertically)


ziggy(Posted 2008) [#4]
I already have the canvas created and embeded on my application. The problem is how to set the size of the mesh in order to be sure it fits on the canvas size. I think this is a B3D api question, so any experienced B3D user could lend a hand?


Dreamora(Posted 2008) [#5]
place alpha 0 planes below and vertically behind the "scene", that are pickable
then camerapick from 3 of the canvas edges -> 3 points
3 of them will be enough to use fitmesh to fit your object into that scene.


ziggy(Posted 2008) [#6]
Thanks Dreamora!
I'll take a look to this fitmesh command. Didn't know about it


ziggy(Posted 2008) [#7]
Can you please give an idea of how to get this 3 points? there have been 5 years since I played with 3D stuff...


MCP(Posted 2008) [#8]
Hi ziggy, I usually rescale the mesh so that it has a radius of 1.0 then just setup the camera to look at it close enough to fill the viewport area. As all meshes will then be the same size, they should all fit nicely in the viewport area :)

Cheers


Beaker(Posted 2008) [#9]
Graphics3D 800,600
SetBuffer BackBuffer()

c = CreateCamera()
CameraProjMode c,2
CameraZoom c,0.7
MoveEntity c,0,0,-5.5

b = LoadMesh("dwarf4.b3d")
;b = LoadMesh("arobot.b3d")
TurnEntity b,0,180,0

FitMesh b,-1,-1,-1,2,2,2,True

box = CreateCube()
EntityAlpha box,0.3

While Not KeyDown(1)

	RenderWorld
	Flip
	TurnEntity b,0,0.1,0
	Delay 3	
Wend
End



ziggy(Posted 2008) [#10]
Thanks beaker!