Project Silent running drones

Ok from the example:
MGROUP_TRANSFORM *mt = new MGROUP_TRANSFORM (LOCALVERTEXLIST,
MAKEGROUPARRAY(vtx), 2);
AddAnimationComponent (anim, 0, 1, mt);

the array vtx or in my case claw is one array

MGROUP_ROTATE *arm1av = new MGROUP_ROTATE (LOCALVERTEXLIST, MAKEGROUPARRAY(claw), 1
,_V(-1.09,-.259,.2), _V(1,0,0), (float)(180*RAD));
claw = _V(-1.09,-.259,.2)//vector3
 
Is claw an array? sure not. You don't even use a pointer (&claw) to compensate the difference (as arrays are handled internally as typed pointer).

Next your CreateAttachmentPoint() does not even slightly resemble the original function.

So: Read the API Reference about all functions you want to use. If I would not have a huge computer graphics assignment in front of me, I would prepare an exam for you.
 
in the h would be :

VECTOR3 claw;

in the cpp it would defined as

claw = _V(-1.09,-.259,.2);

Using the Atlantis RMS code as a guide:
rms_anim[5] = new MGROUP_ROTATE (LOCALVERTEXLIST, MAKEGROUPARRAY(arm_tip), 3,
_V(-2.26,1.7,-6.5), _V(0,0,1), (float)(894*RAD)); // -447 .. +447
anim_arm_wr = CreateAnimation (0.5);
hAC_arm = AddAnimationComponent (anim_arm_wr, 0, 1, rms_anim[5], parent);

I would get

arm1av = new MGROUP_ROTATE (LOCALVERTEXLIST, MAKEGROUPARRAY(claw), 1,
_V(-1.09,-.259,.2), _V(0,0,1), (float)(180*RAD)); //
 
Again: no.

Do you read my posts?
 
Thanks. I'm /have read your posts. CAn we take it one step at a time?


I thought claw set as a Vector 3 made it an array with 3 elements. In the RMS code arm_tip[0], set just like the claw defintionsi
 
What a great idea! Could you animate the touchdown points and play with the mesh to make them walk? Can't wait to see them strolling on the Valley Forge!
 
I might could alter the touchdown points. So if forward or reverse movement then change the touch down point left and the right. Rather than move the legs.

They would fall thru the Valley Forge.
 
Hewey, Dewey, and Louis never looked so good! Can't wait to download.

Has anyone thought about making the Valley Forge?
 
in the h would be :

VECTOR3 claw;

in the cpp it would defined as

claw = _V(-1.09,-.259,.2);

Using the Atlantis RMS code as a guide:
rms_anim[5] = new MGROUP_ROTATE (LOCALVERTEXLIST, MAKEGROUPARRAY(arm_tip), 3,
_V(-2.26,1.7,-6.5), _V(0,0,1), (float)(894*RAD)); // -447 .. +447

arm1av = new MGROUP_ROTATE (LOCALVERTEXLIST, MAKEGROUPARRAY(claw), 1,
_V(-1.09,-.259,.2), _V(0,0,1), (float)(180*RAD));
claw is type VECTOR3.
arm_tip[0], arm_tip[1], arm_tip[2] are type VECTOR3.
arm_tip is type VECTOR3*.
MAKEGROUPARRAY takes type VECTOR3* as its argument.

So:

arm1av = new MGROUP_ROTATE (LOCALVERTEXLIST, MAKEGROUPARRAY(&claw), 1,
_V(-1.09,-.259,.2), _V(0,0,1), (float)(180*RAD));

If you're still not sure why this is so, see the section "Pointers and arrays" here:
http://www.cplusplus.com/doc/tutorial/pointers.html#Pointers and arrays
 
Thanks to Tblaxland, I got the animation to work and attachment to work. Not seen in the RMS code how the attachment is moved to follow animations. In my case the 3 vectors are in claw.
claw = _V(-.139,.096,.224);


DRONEARM = CreateAttachment (false, claw,_V(0,-1,0),_V(0,0,1),"1",false);


ANIMATIONCOMPONENT_HANDLE parent;
//part arm
static UINT arm_groups1_1[4] = {16,17,23,12};
static MGROUP_ROTATE arm1 (0, arm_groups1_1, 4,_V(-1.09,-.009, .164), _V(-1,0,0), (float)(90*RAD));
anim_arm01 = CreateAnimation (0.0);
parent = AddAnimationComponent (anim_arm01, .5, 1, &arm1);
//fore arm and claw
static UINT arm_groups1_2[5] = {13,1,20,21,22};
arm1a = new MGROUP_ROTATE (0, arm_groups1_2, 5,_V(-1.09,-.259,.2), _V(1,0,0), (float)(180*RAD));
anim_arm01a = CreateAnimation (0.0);
AddAnimationComponent (anim_arm01a, 0, .5, arm1a, parent);



arm1av = new MGROUP_ROTATE (LOCALVERTEXLIST, MAKEGROUPARRAY(&claw), 1,
_V(-1.09,-.259,.2), _V(0,0,1), (float)(180*RAD));


AddAnimationComponent (anim_arm01a, 0, .5, arm1av, parent);
 
Not seen in the RMS code how the attachment is moved to follow animations.
I found it in clbkPostStep. Sorry I didn't see this earlier.
Code:
    if (arm_moved) {
        SetAttachmentParams (rms_attach, orbiter_ofs+arm_tip[0], arm_tip[1]-arm_tip[0], arm_tip[2]-arm_tip[0]);
        arm_moved = false;
    }
 
Thanks. I see that. But I guess my question should be is how does the value of claw change with movement.





I found it in clbkPostStep. Sorry I didn't see this earlier.
Code:
    if (arm_moved) {
        SetAttachmentParams (rms_attach, orbiter_ofs+arm_tip[0], arm_tip[1]-arm_tip[0], arm_tip[2]-arm_tip[0]);
        arm_moved = false;
    }
 
Thanks. I see that. But I guess my question should be is how does the value of claw change with movement.
The value of claw is changed automatically by Orbiter when you call SetAnimation. So after SetAnimation is called, you need to call SetAttachmentParams.
 
Ok. SO after this:
SetAnimation(anim_arm01a, arm_proc );

I need :
SetAttachmentParams (DRONEARM,claw);
DRONERARM= attachment handle
claw being the vector 3 position
 
Yes. If it is your intention to write code which does not compile. SetAttachmentParams has another signature as the one you use.
 
I see I guess I need the dir and rot. but I would think that going to change depending on the animation angle,....
 
I see I guess I need the dir and rot. but I would think that going to change depending on the animation angle,....
It depends if you want the attachment direction and rotation to change as the arm moves or not. If not, just set the dir and rot arguments the same as in your CreateAttachment:
Code:
DRONEARM = CreateAttachment (false, claw,[COLOR=Red][B]_V(0,-1,0),_V(0,0,1)[/B][/COLOR],"1",false);

SetAttachmentParams (DRONEARM, claw, [COLOR=Red][B]_V(0,-1,0),_V(0,0,1)[/B][/COLOR]);
        arm_moved = false;
Otherwise you need to define some other vectors that are offset from the claw position by 1 and get these vectors animated the same as the claw is. The dir & rot below are based on your original CreateAttachment, above. I have used an enum for the array index because I think it makes the code clearer.

Code:
// --------------------------------------------------
// declarations
enum AttachmentVectorIndex {POS,DIR,ROT};
VECTOR3 [COLOR=Red][B]claw[3][/B][/COLOR];
// --------------------------------------------------

// --------------------------------------------------
// definitions
claw[POS] = _V(-.139,.096,.224);
claw[DIR] = _V(-.139,.096[COLOR=Red][B]-1.0[/B][/COLOR],.224);
claw[ROT] = _V(-.139,.096,.224[COLOR=Red][B]+1.0[/B][/COLOR]);
DRONEARM = CreateAttachment(false,claw[POS],[COLOR=Red][B]claw[DIR]-claw[POS][/B][/COLOR],[COLOR=Red][B]claw[ROT]-claw[POS][/B][/COLOR],"1",false);
// --------------------------------------------------

// --------------------------------------------------
// define animations
arm1av = new MGROUP_ROTATE(LOCALVERTEXLIST,MAKEGROUPARRAY([COLOR=Red][B]claw[/B][/COLOR]),[B][COLOR=Red]3[/COLOR][/B],_V(-1.09,-.259,.2),_V(0,0,1),(float)(180*RAD));
AddAnimationComponent (anim_arm01a, 0, .5, arm1av, parent);     
// --------------------------------------------------

// --------------------------------------------------
// move attachement
SetAttachmentParams(DRONEARM,claw[POS],[COLOR=Red][B]claw[DIR]-claw[POS[/B][/COLOR]],[COLOR=Red][B]claw[ROT]-claw[POS][/B][/COLOR]);
         arm_moved = false;
// --------------------------------------------------
 
Thanks. here is where the attachment points end. It looks like the attachment rotates in the x direction and then the z direction.
All my animations are in the z direction. fore and aft
end.jpg
 
Back
Top