Point At overrides Lock on rotation

3dOutlaw3dOutlaw Posts: 2,471

I was trying to get a plane "follow" a camera as it moved around, but without tilting.

So I turned the plane 90 degrees, and locked the X and Z rotation. So it's like a mirror standing on its edge, and this means it would only allow the plane to spin around on the Y rotation axis.

Problem is, it seems that "Point At" does not adhere to the "lock" rules, and the planes rotates all axis anyway?

I am just trying to get the plane to spin on the Y-Axis in the direction of the camera, but not "at" the camera. (i.e. don't tilt up/down)

Has anyone done this, or is there a way to actually lock down those rotational axis and use "point at"?

Comments

  • JaderailJaderail Posts: 0
    edited December 1969

    I'm not sure you can lock out all rotation like that with point at in use. I'll play a bit later and see what I find out for you.

  • Richard HaseltineRichard Haseltine Posts: 99,476
    edited December 1969

    Setting limits does lock the parameter, but it doesn't then allow enough play to follow much movement in the camera.

    Using a script, or the Property Hierarchy and the Parameters pane in Edit mode, to add an ERC link works better but still not completely - I get roughly a half-circle of follow before the plane stops. I'm not sure if that's a bug or not.

    // Get selected items
    var items = Scene.getSelectedNodeList();
    
    // make sure there are only two items selected
    if ( items.length == 2 ) {
     var cam = follower = undefined;
     // fin the cmaera, if theer is one
     if ( items[ 0 ].inherits( "DzCamera" ) ) {
      cam = items[ 0 ];
      follower = items[ 1 ];
     }
     else if (items[ 1 ].inherits( "DzCamera" ) ) {
      cam = items[ 1 ];
      follower = items[ 0 ];
     }
     // now, make sure we found a camera
     if ( cam ) {
      // get thwe YRotation controls for both items
      camYRot = cam.getYRotControl();
      folYRot = follower.getYRotControl();
      // Now we link the follower to the camera
      // Create an ERC link from the camera's YRotation
      var link = new DzERCLink( DzERCLink.ERCDeltaAdd , camYRot );
      // And add it to the follower
      folYRot.insertController( link );
     }
    }
  • 3dOutlaw3dOutlaw Posts: 2,471
    edited December 1969

    It appears one of Casuals scripts can do this, thanks for the feedback!

Sign In or Register to comment.