I've reached again this dead-end (for me).
I'm trying to finish my CraneCameraRig with the last important feature: Do proper pan while in target mode.
I mean; the Rig I already have can switch between:
-Normal mode (with pan and tilt controls)
-Targeted mode (follows an object, and the pan/tilt controllers become offsets to adjust framing.).
It works but, when in target mode, the pan is bad because the pan head is tilted.
Again, I need to build my own "look at" function. And this time I need it to work in the four quadrants.
My problem:
- If I set an expression for X-rotation
atan2(y'-y,z'-z) Works perfect in all quadrants.
- If set the expression to Z-Rotation
atan2(x'-x,z'-z) Perfect Z tracking all around too.
But, if I set both expressions simultaneously, it seems one value is perturbing the other and does not solve the quadrant change any more.
Note: due to rig construction, instead of ponting the Z axis to the target, I'm poniting Y, but that's not relevant.This is a minimal scene containing the problem:
- Code: Select all
{
Tools = ordered() {
helper = Shape3D {
NameSet = true,
Inputs = {
["Transform3DOp.Translate.Z"] = Input {
Value = -5,
Expression = "-SurfaceCylinderInputs.Height/2",
},
["Transform3DOp.Rotate.X"] = Input { Value = 90, },
Shape = Input { Value = FuID { "SurfaceCylinderInputs" }, },
["MtlStdInputs.MaterialID"] = Input { Value = 3, },
["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 4, },
["SurfaceCylinderInputs.Radius"] = Input { Value = 0.04, },
["SurfaceCylinderInputs.Height"] = Input { Value = 10, },
["SurfaceCylinderInputs.SubdivisionLevelBase"] = Input { Value = 3, },
["SurfaceCylinderInputs.ObjectID.ObjectID"] = Input { Value = 5, }
},
ViewInfo = OperatorInfo { Pos = { 853, 260 } },
},
TARGET_MOVETHIS = Shape3D {
NameSet = true,
Inputs = {
["Transform3DOp.Translate.X"] = Input { Value = -6.47769075517161, },
["Transform3DOp.Translate.Y"] = Input { Value = 3.58967256230106, },
["Transform3DOp.Translate.Z"] = Input { Value = -2.49235762543579, },
Shape = Input { Value = FuID { "SurfaceSphereInputs" }, },
["MtlStdInputs.MaterialID"] = Input { Value = 1, },
["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1, },
["SurfaceSphereInputs.Radius"] = Input { Value = 0.34, },
["SurfaceSphereInputs.ObjectID.ObjectID"] = Input { Value = 3, }
},
ViewInfo = OperatorInfo { Pos = { 1082, 202 } },
},
CAM_MOVETHIS = Shape3D {
CtrlWZoom = false,
NameSet = true,
Inputs = {
SceneInput = Input {
SourceOp = "helper",
Source = "Output",
},
["Transform3DOp.Translate.X"] = Input { Value = -8.27141386342268, },
["Transform3DOp.Translate.Y"] = Input { Value = 1.7791611753255, },
["Transform3DOp.Translate.Z"] = Input { Value = -0.0633333150819293, },
["Transform3DOp.Rotate.X"] = Input {
SourceOp = "Expression2",
Source = "NumberResult",
},
["Transform3DOp.Rotate.Y"] = Input {
SourceOp = "Expression1",
Source = "NumberResult",
},
["MtlStdInputs.MaterialID"] = Input { Value = 2, },
["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 2, }
},
ViewInfo = OperatorInfo { Pos = { 854, 306 } },
},
Expression2 = Expression {
CtrlWZoom = false,
NameSet = true,
Inputs = {
n1 = Input {
Value = -8.27141386342268,
Expression = "CAM_MOVETHIS.Transform3DOp.Translate.X",
},
n2 = Input {
Value = 1.7791611753255,
Expression = "CAM_MOVETHIS.Transform3DOp.Translate.Y",
},
n3 = Input {
Value = -0.0633333150819293,
Expression = "CAM_MOVETHIS.Transform3DOp.Translate.Z",
},
n4 = Input {
Value = -6.47769075517161,
Expression = "TARGET_MOVETHIS.Transform3DOp.Translate.X",
},
n5 = Input {
Value = 3.58967256230106,
Expression = "TARGET_MOVETHIS.Transform3DOp.Translate.Y",
},
n6 = Input {
Value = -2.49235762543579,
Expression = "TARGET_MOVETHIS.Transform3DOp.Translate.Z",
},
n7 = Input { Value = -3.41628771292701, },
NumberExpression = Input { Value = "atan2(n5-n2,n6-n3)", },
NumberControls = Input { Value = 1, },
NameforNumber1 = Input { Value = "plate X", },
NameforNumber2 = Input { Value = "plate Y", },
NameforNumber3 = Input { Value = "plate Z", },
NameforNumber4 = Input { Value = "T X", },
NameforNumber5 = Input { Value = "T Y", },
NameforNumber6 = Input { Value = "T Z", },
},
},
Expression1 = Expression {
CtrlWZoom = false,
Inputs = {
n1 = Input {
Value = -8.27141386342268,
Expression = "CAM_MOVETHIS.Transform3DOp.Translate.X",
},
n2 = Input {
Value = 1.7791611753255,
Expression = "CAM_MOVETHIS.Transform3DOp.Translate.Y",
},
n3 = Input {
Value = -0.0633333150819293,
Expression = "CAM_MOVETHIS.Transform3DOp.Translate.Z",
},
n4 = Input {
Value = -6.47769075517161,
Expression = "TARGET_MOVETHIS.Transform3DOp.Translate.X",
},
n5 = Input {
Value = 3.58967256230106,
Expression = "TARGET_MOVETHIS.Transform3DOp.Translate.Y",
},
n6 = Input {
Value = -2.49235762543579,
Expression = "TARGET_MOVETHIS.Transform3DOp.Translate.Z",
},
n7 = Input { Value = -3.41628771292701, },
NumberExpression = Input { Value = "180+atan2(n4-n1,n6-n3)", },
NumberControls = Input { Value = 1, },
NameforNumber1 = Input { Value = "plate X", },
NameforNumber2 = Input { Value = "plate Y", },
NameforNumber3 = Input { Value = "plate Z", },
NameforNumber4 = Input { Value = "T X", },
NameforNumber5 = Input { Value = "T Y", },
NameforNumber6 = Input { Value = "T Z", },
},
},
Merge3D1 = Merge3D {
Inputs = {
SceneInput1 = Input {
SourceOp = "TARGET_MOVETHIS",
Source = "Output",
},
SceneInput2 = Input {
SourceOp = "CAM_MOVETHIS",
Source = "Output",
},
SceneInput3 = Input {
SourceOp = "zero",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { 1102, 307 } },
},
zero = Text3D {
NameSet = true,
Inputs = {
Size = Input { Value = 0.51, },
Font = Input { Value = "Open Sans", },
StyledText = Input { Value = "0,0,0", },
Style = Input { Value = "Bold", },
Extrusion = Input { Value = 1, },
ExtrusionProfile = Input {
SourceOp = "zeroExtrusionProfile",
Source = "Value",
},
ExtrusionDepth = Input { Value = 0.1514, },
ManualFontKerningPlacement = Input {
Value = StyledText {
Array = {
},
Value = ""
},
},
},
ViewInfo = OperatorInfo { Pos = { 1229, 307 } },
},
zeroExtrusionProfile = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.0196116135138184, 0.098058067569092 }, Flags = { Linear = true } },
[0.2] = { 1, LH = { 0.180388386486182, 0.901941932430908 }, RH = { 0.3, 1 }, Flags = { Linear = true } },
[0.8] = { 1, LH = { 0.7, 1 }, RH = { 0.819611613513818, 0.901941932430908 }, Flags = { Linear = true } },
[1] = { 0, LH = { 0.980388386486182, 0.098058067569092 }, Flags = { Linear = true } }
}
},
SplineColor = { Red = 192, Green = 128, Blue = 64 },
NameSet = true,
}
}
}
Any help?