DC confusion... help needed
-
I am trying to learn how to make a Dynamic Component, but I am stuckā¦
My problem is a bit hard to explain, but bare with me.
I am making a configurable spotlight for MaxwellRender. You can turn it, and adjust the reflecting parabola to get different angles for the spotlight. Just the rotation would have been easy, but combining the scaling of the parabola and rotating so that it stays correctly positioned became a problem because the center of rotation is outside the parabola component, so I had to brush up my very vague memories of trigonometry to define the position of the scaled and rotated component. Probably already lost you there didnāt Iā¦
Now to my actual question:
I can make the trigonometric formulas work, but when entering the angle zero degrees the formula is incorrect, because I get a division by zero. (It works fine with all other angles). How do I awoid this?I made an attempt to explain myself on a picture in the skippy. Try setting the FrontRotate value to zero, and look at the X position attribute of the Mirror child component.
Well, if I didnāt loose you yet then you are a smart one .
-
I have ran into similar things. Do you know what the value of w should be when the error occurs? Does w=zero if TAN(A/2)=zero? If I remember right, even if there is a division by zero in a conditional statement... it still results in an error even if that "condition" value is not returned.
Could you do something like...
A= [whatever]
aPass= IF(A=0,1000,CURRENT("A"))
w= h/tan(aPass/2)Maybe not the ideal example, but I am thinking if the aPass condition is met where A=0, you could plug in some outlier value that could then later be flagged... like:
RealW= IF(w=[outlier value],0,current("w")
I am not a math whiz, but I do know how to make the "cents" sign and this is my 2Ā¢
MC
-
Thanks Matthew,
I'll try that. The value should be zero at zero, so this should be easy.
Sheik
Advertisement