Crystal Space
Welcome, Guest. Please login or register.
April 21, 2014, 06:48:25 am

Login with username, password and session length
Search:     Advanced search
8990 Posts in 2037 Topics by 7600 Members
Latest Member: Chandrabeck
* Home Help Search Login Register
  Show Posts
Pages: [1]
1  Crystal Space Development / Support / Re: Attach a mesh to a Socket on: September 06, 2008, 03:49:41 pm
Guys A fixed my problem! Wink

However Thanks! Wink

2  Crystal Space Development / Support / Attach a mesh to a Socket on: September 05, 2008, 11:37:03 am
Hi,
I'm trying to attach a mesh to a socket, what I want is that this mesh can follow the movement of
the socket positioned on another mesh. I followed this link http://www.crystalspace3d.org/trac/CS/attachment/ticket/340/sockets.txi
but there a thing that I don't understand on the source code (that I report hereunder):


bool AttachMesh (iMeshWrapper* actorMesh, const char* socketName,
106           const char* objectFactoryName)
107   @{
108     iMeshFactoryWrapper* objectFactory = engine->GetMeshFactories ()
109           ->FindByName (objectFactoryName);
110     if (!objectFactory) return false;
111     csRef<iMeshWrapper> object = engine->CreateMeshWrapper (objectFactory,
112           objectFactoryName);
113     csRef<iGeneralMeshState> genstate = scfQueryInterface<iGeneralMeshState> (
114           GetMesh ()->GetMeshObject ());
115     if (genstate)
116     {
117       csRef<iGenMeshAnimationControl> skelstate = genstate
118           ->GetAnimationControl ();
119       if (skelstate)
120       {
121         csRef<iGenMeshSkeletonControlState> ctlstate =
122           scfQueryInterface<iGenMeshSkeletonControlState> (skelstate);
123         if (ctlstate)
124         {
125           csRef<iSkeleton> skel = ctlstate->GetSkeleton ();
126           if (skel)
127           {
128             iSkeletonSocket* skelsocket = skel->FindSocket (socketName);
129             if (!skelsocket) return false;
130             object->QuerySceneNode ()->SetParent (actorMesh->QuerySceneNode ());
131             skelsocket->SetSceneNode (object->QuerySceneNode ());
132             return true;
133           }
134         }
135       }
136     }
137   @}


This method get three parameters, the name of the mesh with socket, the name
of the socket, and the objectFactoryName that really I have no idea what
is......can be the name of the mesh that I want to attach? I tryed to put this name
but without success...

Any Suggest? Wink

Thanks!

3  Crystal Space Development / Support / Socket Problems on: August 11, 2008, 11:48:24 pm
I'm trying to parent a mesh to a socket and this is the piece of source code...but it doesn't work! Is there a better way of doing this?  We are using genmesh for our characters:


csRef<iMeshWrapper> mesh_bowl = Sys->Engine->FindMeshObject("bowl_lib");
csRef<iMeshWrapper> mesh_dog = Sys->Engine->FindMeshObject("dog_lib");
 
csRef<iGeneralMeshState> spstate ( scfQueryInterface<iGeneralMeshState> (mesh_dog->GetMeshObject ()));
csRef<iGenMeshSkeletonControlState> animcontrol ( scfQueryInterface<iGenMeshSkeletonControlState> (spstate->GetAnimationControl ()));
iSkeleton* skeleton = animcontrol->GetSkeleton ();
 
iSkeletonSocket* socket = skeleton->FindSocket("socketMouth");
 
mesh_bowl->QuerySceneNode()->SetParent( socket->GetSceneNode() ) ;
 
mesh_bowl->GetMovable()->UpdateMove();

Is there a different approach (set the transformation
of a socket to a mesh) and the "right" approach (use "setparent")?

We are using an svn version "12 March 2008" as it was deemed more stable for us, on WinXP sp3, Nvidia 8800gt for video and compiling in Visual Studio 2005.
4  Crystal Space Development / Support / how can I place a camera on the head of a mesh? on: July 28, 2008, 12:07:53 am
Hi Guys!
I have a mesh (a dog) I want to move it around the space
the mesh with collision detection system and I want to place the camera on the
head of the mesh, this is my code:

I create a collider called collider_dog:*

 csRef<iMeshWrapper> mesh_dog = engine->FindMeshObject("dog_lib");
     collider_dog.SetCollideSystem (cdsys);
   collider_dog.SetEngine (engine);
   csVector3 legs_dog (0.2f, 1.7f, 0.2f);
   csVector3 body_dog (0.2f, 2.2f, 0.2f);
   csVector3 shift_dog (0, -1.7f, 0);

   collider_dog.InitializeColliders ( mesh_dog, legs_dog, body_dog, shift_dog);

   collider_dog.SetCD(true);


on
ProcessFrame() I do:*

ProcessFrame(){

[.....]

if(UPKey_isPressed){

      view_dog->GetCamera ()->Move ( 0.01f * CS_VEC_FORWARD,true);
        csRef<iMeshWrapper> mesh = engine->FindMeshObject("dog_lib");
            collider_dog.Move ( float (elapsed_time) / 1000.0f, 1.0f, csVector3(0,0,1), 0 );

       csVector3 rot = collider_dog.GetRotation ();

       float radian = 0.0174532925f;
       float angle = (rot.y*365)/6.0f;

        float y = view_dog->GetCamera()->GetTransform().GetOrigin().y;

        mesh->GetMovable()->SetPosition( csVector3( mesh->GetMovable()->GetPosition().x + (float)sin(angle*radian) * 0.05f,
                                                   y,
                                                    mesh->GetMovable()->GetPosition().z + (float)cos(angle*radian) * 0.05f ) );


      mesh->GetMovable()->UpdateMove();


}

 // place the camera on the head of the mesh

 csRef<iMeshWrapper> mesh = engine->FindMeshObject("dog_lib");
 csOrthoTransform transform = bone_dog->GetFullTransform()*mesh->GetMovable()->GetFullTransform();

 transform.RotateThis( csXRotMatrix3 (PI)*csYRotMatrix3 (PI) ) ;

 view->GetCamera()->SetTransform(  transform );

 collider_dog.Move ( float (elapsed_time) / 1000.0f, 1.0f, 0, 0 );


[...]

}*

*OK, the result is that mesh is moving but the y axis is ignored
and seem to be always on a fixed value...


What is wrong? Sad This problem drive me crazy! SadSadSad

Thanks....
5  Crystal Space Development / Game Content Creation / Re: genmesh Model animation on: March 31, 2008, 06:29:37 am
Ok, found out the problem, you need to have lighter2 turned off, or have a hacked version of lighter2 since it has a bug in it that prevents it from exporting properly.
6  Crystal Space Development / Game Content Creation / Re: genmesh Model animation on: March 25, 2008, 03:42:41 am
Does anyone have a solution for this?  I keep getting errors no matter how I rig the mesh to the armature.  This is the main error I get:

crystalspace.genmeshfactoryloader.parse:  Render buffer vertex count(5998) different from factory vertex count (7602)
crystalspace.genmeshfactoryloader.parse:  [node: library,meshfact(name=Character),params,renderbuffer(name=bones indices)]
crystalspace.genmeshfactoryloader.parse:  Render buffer vertex count(5998) different from factory vertex count (7602)
crystalspace.genmeshfactoryloader.parse:  [node: library,meshfact(name=Character),params,renderbuffer(name=bones weights)]

I have parented the armature to the mesh as stated in the tutorial, I did a quick create vertex groups using Create From Closest Bones and it worked, but the mesh was animated but messed up in the walktest because I had to do the weight painting.  After weight painting the mesh it gives me this error.  There is no Armature modifier assigned, everything is animated and weighted fine in Blender, but crashes with this error on export.  Thanks for any help, this will really help us move forward once we figure this out.
7  Crystal Space Development / Game Content Creation / Re: genmesh Model animation on: March 20, 2008, 07:53:28 am
Thanks we got the model_esq2.blend file to work but we had to open blender first, then open the exporter, then open the model so it doesn't crash it right off the back.  From there as you said it ran fine when you go to Run, Ctrl+R but not in Viewmesh. 

Now we are just trying to figure out the proper way to rig a model for this as it seems none of the rigs we had created prior to this work.  One model we had just rotates forward in a 360 degree circle then stops.  The others are static, no matter how I set them up in Blender.  We already know it needs vertex groups and the mesh parented to the armature, and followed the export tutorial as we got the other example blend file working, but there seems to be something else throwing it off we don't know about.  Any suggestions there?
8  Crystal Space Development / Game Content Creation / Re: genmesh Model animation on: March 18, 2008, 02:38:08 pm
Hi me and my team are having trouble just viewing the animation in Viewmesh, it crashes every time we load the animation.  Also in the game engine it is not exporting the animations either.  We have followed the blender2crystal tutorial to a tee.  Is there a test file we can use to see if the exporter or the viewmesh program is broken?  We are using the SVN versions of both.
9  Crystal Space Development / Game Content Creation / Re: Questions on Models w/ Bones on: March 10, 2008, 12:31:19 am
I am interested in this too, I'd also like to know the timeline on this as well, as I am working on a project using CS.  There is almost no information that I can gleam from the website at all about this new animation system or how it will be implemented.  We can contribute if we knew where to start looking and what is already done.
10  Crystal Space Development / Support / Re: Question about blender2crystal on: February 25, 2008, 03:05:48 am
Did this problem ever get solved?  I got this error using the SVN version of the Blender2Crystal plugin, and followed the artist's install to a tee.  Please post the information regarding the fix for everyone, or maybe someone can update the Blender2Crystal page for a fix using the SVN version.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 6.202 seconds with 17 queries.