Jump to content

primintinsic access in dops


Varaya

Recommended Posts

Is it possible to access primintrinsics in dops? I have Geometry wich is transformed by a sim. For the second rbd sim i want to make the geometry look at a particular direction. For example to its original direction. So I deleted all Attributes from the first sim to prevent side effects and connected it in to the second sim.

To make it look to a direction i want to use the poplookat node (target is direction) in dops. I enabled VEXpression. This is my VEXpression setup:

target = {1,0,0};
refdir = v@xdir;

up = {0,1,0};
refup = v@ydir;

Now i need the original X direction and the Y direction from my Geo.

 

I could convert the primintrinsic "transform" matrix to the directions, but somehow it is not possible to do that in dops.

 

is there any solution?

Link to comment
Share on other sites

21 hours ago, Varaya said:

Is it possible to access primintrinsics in dops?

@Varaya Packed geometry already give you primintrinsics ... in dops using particles you can access those ..Please post your file and some one with more experiences can help you ..

 

//geometry wranG popforce

f@age += @TimeInc;
int i = chi('activate');
if (i == 1) {

//measure distance between point and rest
vector p1 = point(0,"P", @ptnum);
vector p2 = point(1,"P", @ptnum);
vector pivot = primintrinsic(1,"pivot", @primnum);
setprimintrinsic(0, "pivot", @primnum, pivot, "set");
float dist = distance(p1,p2);

if (dist < (1+@age/3)) {
    //set mix value
    float mix = .1;
    f@mix += mix;
    // blend transformation matrix
    matrix m1 = getpackedtransform(0, @primnum);
    matrix m2 = getpackedtransform(1, @primnum);
    matrix m3 = slerp(m1,m2,mix);
    setpackedtransform(0,@primnum, m3);
    //deactivate stuff
    if (dist < .3) @active = 0;
    if (@mix > 5) @group_ignore = 1;
    
    }

    
}

 

colggg.gif

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...