Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Maxon Cinema 4D Xpresso math issue

  • Xpresso math issue

    Posted by Daniel Moore on July 14, 2014 at 5:28 am

    I’m working on an Xpresso program to fit x number of slats within a frame. As the frame dimensions are changed, the spacing between slats is kept uniform. As the number of slats or their width changes, likewise the spacing between them remains uniform. I’ve got it almost there but notice a problem with the math derived from the two formula’s in place. First, it I keep it to whole numbers things are almost perfect. There is a .015″ shift to the left of the slat members in the frame. But for that it would be perfect.
    Second, if I venture into using float values, say making a slat width of 1.375″, the shift within the frame takes on that error, plus the initial .015″ error. It’s quite predictable it seems even though I’ve checked all values are floats (except slat count) and I’ve dialed in step values where possible in the .001 range to aid precision.

    I’m hoping someone can shed some light on why this is happening. I admit, I’ve looked at this problem for way too long to be objective anymore and have no further insight as to what in the heck is going on.

    I trust it’s OK to link to the scene file:

    https://copy.com/Cqoil7PYxSdDeg0Y

    Any and all ideas are welcome!

    Brian Jones replied 12 years ago 2 Members · 3 Replies
  • 3 Replies
  • Brian Jones

    July 14, 2014 at 4:42 pm

    it’s encouraged to share the file (assuming it’s not huge 🙂 makes it so much easier to figure out…

    try this, cloner was not at zero so I centered it and changed the formula that feeds into the cloners Transform value.

    7738_adaptivelattice2.c4d.zip

  • Daniel Moore

    July 14, 2014 at 6:14 pm

    I can’t thank you enough for your help with this. It works beautifully and the transform formula is an eye opener. I was certain I had to include the first space (or P. X) in the formula for some reason.

    To get the cloner back to zero, entering zero in the coordinate manager was all it took? This may seem a silly question but I only have a handful of hours logged in C4D.

  • Brian Jones

    July 14, 2014 at 6:21 pm

    yes, it’s just entering 0 in the coordinate manager. That’s always possible (unless you are driving a value with an xpresso or have the value locked with a Protect tag) so you can put in any value you want without having to move the object around in the viewport when some values are hard to hit exactly

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy