B3D Blitz Creation
Blitz3D Forums/Blitz3D Programming/B3D Blitz Creation
| ||
If you we're to Create an animated Mesh in the Blitz3D programming language, using createmesh, adding vertex, etc. How would you create bones/joints? Would you use pivots for joints? Or would you recreate the vertexes at different points for each anim sequence? If you have two surfaces with vertexes in the same position, does it store 2 vertexes, or can they be hooked togethor the same way? Or would you be better off using multiple child meshes with a parent mesh? Does an yone have a method to making a b3D mesh with joints?,textures and animation using bb code? thanks |
| ||
You have to save the B3D data to a file and re-load it to get bone animation. |
| ||
is their a sample/prog that will save the b3d data to a file?? And how does it know where i want the bones? |
| ||
He meant you have to create a full b3d file by hand (which involves understanding the .b3d format) and then load it, because you can't add/remove bones to a loaded mesh. It's pretty painfull... If you plan to do so, look in the "spec & utils" section. |
| ||
For example. if i wanted to create a mesh with two 1 sided flat sqaures on top of each other vertically,to get a 3 part animation sequence(or even 2), where the top sqaure/surf2 would bend at a 45/90 anglebackwards like its a closing door? then how do i output the animation sequences into b3d, the textures, or the joints also? thanks for any input [code] Graphics3D 800,600,16,3 SetBuffer BackBuffer() light=CreateLight() RotateEntity light,90,0,0 cam=CreateCamera() PositionEntity cam,5,0,-30 mesh=CreateMesh() ;creates the first surface surf1=CreateSurface(mesh) v1=AddVertex(surf1,0,10,0,0,1);upper left corner v2=AddVertex(surf1,10,10,0,1,1);upper right corner v3=AddVertex(surf1,10,0,0,1,0);lower right corner v4=AddVertex(surf1,0,0,0,0,0);lower left corner tri1=AddTriangle(surf1,v1,v2,v3) tri2=AddTriangle(surf1,v1,v3,v4) ;now creating the second surface, note its just two flat ;1 sided boxes one located on top of the other surf2=CreateSurface(mesh) v5=AddVertex(surf2,10,10,0,1,0);lower right corner v6=AddVertex(surf2,0,10,0,0,1);lower left corner v7=AddVertex(surf2,10,20,0,1,1);upper right corner v8=AddVertex(surf2,0,20.0,0,1);upper left corner tri3=AddTriangle(surf2,v8,v7,v5) tri4=AddTriangle(surf2,v8,v5,v6) tex=LoadTexture("c:\grass.bmp") ;note vertex 5 and 2 are the same as is vertex 6 and 1, say if the top mesh was to swing like a door ;how can i save it so that surf2(the top one) would "swing" back 45 and then 90 for 2 sep anim seqs? EntityTexture mesh,tex UpdateNormals mesh RenderWorld Flip WaitKey() ClearWorld End |
| ||
Hi Gauge, You can find the b3d file specs, format and sample code on the Specs & Utils section of this site. Also, in the code archives, I think there are a couple of loaders/decompilers for .b3d (though I'm not 100% how detailed they are). As to joints and animations, unless you're doing really simple animations, it would be best to use a utility to do the anim stuff. In a nutshell though, a joint is a pivot, that you parent vertices too in a mesh.. You can have a hierarchal skeleton by having a root "joint", and then parenting other joints to the root, creating a joint chain (each being dependent on the previous). Animations are then interpolated/tweened as changes in rotation and position of the joints over a given time, or # of frames. To my knowledge, that's the basics. I don't know if it helped answer your questions, or confuse you more ;-)) .. Hope it helps |