b3d display
Archives Forums/Blitz3D SDK Programming/b3d display
| ||
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. |
| ||
well as far as I know, You would need an openGL/dx object . not sure where to find though. |
| ||
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) |
| ||
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? |
| ||
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. |
| ||
Thanks Dreamora! I'll take a look to this fitmesh command. Didn't know about it |
| ||
Can you please give an idea of how to get this 3 points? there have been 5 years since I played with 3D stuff... |
| ||
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 |
| ||
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 |
| ||
Thanks beaker! |