[Blend2cs-user] Re: [Cel-main] Loading mesh from Blender in CS via cel

Matze Braun matze at braunis.de
Wed Nov 3 11:45:35 CET 2004



On Wed, 3 Nov 2004, Jorrit Tyberghein wrote:

> Thomas Degris wrote:
>
>> Hello,
>> 
>> I am currently trying to load simple mesh object from Blender into CS via 
>> cel. The objects don't have any animations (I am not using cal3d). I create 
>> them with Blender and I convert the Blender file into a CS library using 
>> blend2cs (with the -l option).
>> 
>> The mesh is loaded in cel using the following cel code:
>> csRef<iPcMesh> pcmesh = CEL_QUERY_PROPCLASS_ENT(entity, iPcMesh);
>> assert(pcmesh);
>> pcmesh->SetMesh("avatar", "/bugspace/objectlibrary.zip");
>> The entity has the following cel properties: pcactormove, pclinearmovement.
>> 
>> I have different major problems using this method:
>> 1) collision detection between the object and the floor seems to be done 
>> with the origin of the object in Blender instead of the mesh itself. That 
>> means that if the origin of the object is placed bellow the object itself, 
>> then the object will navigate in cel without colliding with the floor (it 
>> will seem to fly). Is that normal ?
>
> CS and CEL use a technique to test CD only with objects that are near. To 
> test if
> two objects are near CS will compute the distance between the 0,0,0 points
> of the objects. This is also the case for lighting. So it is always 
> recommended to
> place the 0,0,0 point of the object at a suitable place in the object and not
> removed from it.
>
>> 
>> 2) I don't understand how objects are rotated in the world. Two objects 
>> orientated with the same angles in Blender will NOT necessarily be 
>> orientated the same way once loaded in cel. On the contrary, two objects 
>> not orientated the same way in Blender may be orientated identically in 
>> cel. It seems that it depends how objects are initially created in Blender, 
>> but I am not sure. Also, modifications in Blender does not seem to be taken 
>> into account in CEL. I am really looking for some informations about that. 
>
> I don't understand this. What do you mean by 'modifications in Blender'? What 
> kind
> of modifications?
This also sounds strange to me, do you have an example file?

>
>> 
>> 3) Objects loaded in CS are all black. I guess it is because lights are not 
>> computed for them. So, I would like to know what to do in cel/Blender  to 
>> get nice textures/lighting with my mesh objects. Any hint ? 
>
> CS should do the lighting. So you must add some lights and
> do -relight on the level.
If the objects are static and won't move then you want to use thing 
meshes (default in blend2cs) and use -relight on the level. For moving 
objects you better use genmeshes which are vertex lighted and get updated 
as the object moves.

Greetings,
 	Matze



More information about the Blend2cs-user mailing list