3d model interaction

Blitz3D Forums/Blitz3D Beginners Area/3d model interaction

NRJ(Posted 2016) [#1]
I want to use a building/house model in blitz3d which have several doors and windows in it, how do I interact with it and open/close it, when a key is pressed. I have softwares like wings3d and blender. 


Thanks, in advance....


Midimaster(Posted 2016) [#2]
you have two possibilities: one is to create animation sequences in your 3D-Designer and load it with "LoadAnimMesh"...

The other way is to create individual 3D-Object and position/move/turn them direct in Blitz3D. Here is a very old demo of me, that creates a chest of drawers only by using a lot of "3D wooden boards" and a opens one of the drawers

you need this holz.png image:





RemiD(Posted 2016) [#3]
@Midimaster>>Nice demo :)
Maybe try to use scalemesh, positionmesh, rotatemesh, to create your meshes (instead of scaleentity, positionentity, rotateentity)


@nrj>>You can create your mesh with premade parts inside Blitz3d and then you will be able to turn move some parts as you want, and you will be able to consider some turning moving parts for collisions.
Or you can create the mesh with all parts and the animation in your favorite modeling rigging skinning animation tool, then set the influences of some joints/bones over the vertices of some parts, then export the rigged skinned animated mesh, then retrieve the joints/bones, then turn move the joints/bones to turn move the parts (or play a premade animation to turn move the parts...)


NRJ(Posted 2016) [#4]
@Midimaster

I run your code, it is good but I don't want to use it, as it will be very complicated to use it in large building structures. I am trying to Create animated meshes in blender but it will take me some time as I am new to blitz3d and blender.


RemiD(Posted 2016) [#5]
@nrj>>Basically you want to model different parts, then create different joints/bones, then set the influences (weight=1.0) of each joint/bone over the vertices of each corresponding part, then either create the animation (in Blender) and use animateentity (in Blitz3d), or retrieve each joint/bone with FindChild (in Blitz3d), and turn move it with turnentity/moventity (in Blitz3d).


NRJ(Posted 2016) [#6]
@REMID

Exactly, I want to make the whole model in blender with doors in it, and I want to animate it in blitz3d when the player collides with the door.

I have made a glass breaking animation in blender but when I use it in blitz3d, it gives me an error " entity has no animation" , I think I have made some mistake in exporting the file from blender in 3ds format.

Does anybody here have some knowledge of working in blender?


RemiD(Posted 2016) [#7]
@nrj>>You want to make sure that the number of joints/bones inside blender and the number of joints/bones in the exported b3d file is the same. (you can check by importing the b3d mesh in blender or in fragmotion (trial version) or in ultimateunwrap3d (trial version))
And if not, you want to use findchild to get the root joint/bone of the skeleton (some tools add a pivot at the root of the mesh, parent of the root of the joint/bone of the skeleton...).
Then you want to use extractanimseq() on the root joint/bone of the skeleton to get the animation you want.
Then you want to use animate() on the root joint/bone of the skeleton to animate your mesh.


NRJ(Posted 2016) [#8]
@RemiD

From which software I can convert 3ds file to b3d format?


Midimaster(Posted 2016) [#9]
my idea was not to build your complete world from blitz3d primitives....

But think about designing the house without doors and windows in Blender as one model. Then design seperately one door and one window model, then load all models in Blitz3D and create window entities by copying it from the window mesh and place them at the correct positions in the house entity. The same with the doors...


RemiD(Posted 2016) [#10]
@nrj>>from what i know, blender can do that, fragmotion can do that, ultimate unwrap 3d can do that, anim8or can do that if you use this converter ( http://perso.wanadoo.fr/philippe.c/installation/an8tob3d.exe ) (but except fragmotion which exports the b3d file correctly, not sure if the others exporters export the b3d file correctly (with the exact same surfaces, vertices, triangles, normals, joints/bones, animations))

The last b3d exporter (v3.0) for blender can be found here : http://www.mediafire.com/download/ex7sedw91m6bu0n/B3DExport.zip
(you'll need blender 2.74 + python 3.4.3)


NRJ(Posted 2016) [#11]
@RemiD
Thank you RemiD for providing information of the available softwares resources, it will definitely solve my problem.

@Midimaster
Your suggestion of designing the house without doors in blender is also good, placing door and Windows at the exact positions will require time to implement it.


Rick Nasher(Posted 2016) [#12]
Perhaps of some usage:

Opening/closing doors:
http://www.blitzbasic.com/codearcs/codearcs.php?code=1880
http://www.blitzbasic.com/codearcs/codearcs.php?code=1970

I practically like this one, which I've used in a building successfully.
Breakable glass:
http://www.blitzbasic.com/Community/posts.php?topic=22803
Although it could do with a little bit of random sized pieces.