RFRONT - motion editor for DarkBasic(C) Dmitriy Korabelnikov 2004 This help is incomplete (as editor itself) but full functional. Analyzing some information about 3D I thought about what hell we have with 2D images in the end of 80s. (We still have it) Remember Microsoft Basic (gwbasic, Quick Basic) with many stupid "graphics modes" such as SCREEN 1, SCREEN 2,... Most of them were CGA and EGA modes, but who cares now. No double buffering, no way to save and load pictures, no sprites, nothing. 2D programmers were so cool that time, and 2D qwest games were so interesting. Now there are many standard formats of 2D images and many ways and libraries to load them. I just imagine: what if our "super cool and modern" days of 3D is the same CGA era, but in 3D? Maybe .X format of 3D files is a kind of lame raw .BMP format, only in 3D? And so, I understood all 3D. Warning: The proposed DBA source code works only in DarkBasic Classic 1.13 (with memblock and DLL support) DarkBasic Pro has other internal format of mesh and I found some bugs in CHANGE MESH command of DBPro (for instance texture disappears after CHANGE MESH) Please test the latest versions of DBPro compiler. But anyway, X files created by RFront can be loaded to DBPro. 1] Select a model to animate using mouse. Do not select *_m1.x ... *_m4.x files. This files are output files and can not be edited once again. Press Enter or F5 to load model. 2] Now you can see something like this. You can rotate camera around model using Del, End. Three transparent blue planes can be moved using arrow keys and PgUp, PgDn. They can be used to find coordinates in 3D. First 3 values from the left side are coordinates of planes intersection. 3] Press F7 to enter preset mode. Now you can adjust skeleton. Click on green cubes and move them using buttons 1-6. If you are not sure, that cube is at the good place, simply rotate camera using Del, End. 4] Now you must have something like this. 5] Using Up and Down keys move horisontal plane slightly under hands and mark position using F2. Now move horisontal plane slightly above hands and mark position using F3. Save final skeleton by F1. Go back to animation mode by F7. 6] Now click on any rotating point of model. For example, on shoulder. Rotate using 1-6 keys. 7] Now click on other rotating point of model. Make any form you want. Don't screw too much. If you are mistaken, reload model by F5. 8] Suppose, you complete a desired pose.
Now you can save this pose in one of 4 slots by F1-F4. For example for this model
jenny.x resulting files can be jenny_m1.x, jenny_m2.x, jenny_m3.x, jenny_m4.x 9] See example twoants.dba for some info how to use poses for animation.
First of all, you must include next functions to your code:
Make a smooth animation from poses. This function use linear interpolation, so do not try to rotate hand to 90 degrees. Use more (not 2) poses for complex animation. (see _flip.dba)
Now how it looks in main code.
Now the key: main loop
More source code. The very important part of RFront is a function xsave, which saves meshes in binary .X format. (There is a SAVE MESH command in DarkBasicPro but this function works even better). Look at source in _xsave.dba More help in progress (I think). Later! |