Home Technical Talk

How to invert a value in max?

polycounter lvl 7
Offline / Send Message
Artist_in_a_box polycounter lvl 7
Hi guys. I recently got playing with the expose tool seen here [ame="http://www.youtube.com/watch?v=qzw_X-vxwYU"]Expose Transform Trick for 3ds Max - YouTube[/ame]

Its awesome but I am wanting to invert the effect, so the height gets larger the closer the dummy is. Essentially I need the height number to increase as the distance decreases. Can someone give me a clue as to how to go about this please?

I believe I need to invert the number output from the distance slot in the expose tool in the wire parameters as in the video he uses some basic math to divide and multiply the output but inverting the value seem to be above me, that or I am overlooking some simple solution.

Thanks for the help.

Replies

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    0 - whatever number comes out ?
  • Artist_in_a_box
    Offline / Send Message
    Artist_in_a_box polycounter lvl 7
    I just tried that and a number of other means of inverting the number and what I ended up doing was making the height of the box go down instead of up. But it still increased on both axes by sending the dummy further away. I think I may be going the wrong way around this.
  • joeriv
    Offline / Send Message
    joeriv polycounter lvl 7
    unless I am overlooking something: (within this, since I don't think you would be able to do something like get the distance to for example the box that is furthest away, or store values somewhere).

    You will need to have some sort of maximum value. (if the dummy is on top of a box, it would be impossible to know how what the height of the box should be without some sort of relation to something else).

    So take the amount of boxes on a row/column * the size, and use the number.
    so 500 (for example) - the distance.
  • Artist_in_a_box
    Offline / Send Message
    Artist_in_a_box polycounter lvl 7
    I figured it out, or rather I found someone smarter than me who posted a video on youtube doing something similar. The issue was that as one number increases I needed the other number to decrease.
    The answer was to divide 1 by the distance then multiply the result. So in the wire parameters box I put (1/Distance)*10. I did some tweaking and ended up with (10/Distance)*30 which gave me the result of the box getting bigger the closer the dummy is.

    If I am honest I cant explain why this works as I ran the numbers in the calculator and didn't get any minus results, just 0.0002 e.t.c.

    [ame="http://www.youtube.com/watch?v=n_hfxqLi6Rc"]3ds Max Expose Transform Helper tutorial #2 - YouTube[/ame]

    Check this video out for the tutorial.

    Thanks for the help guys.
  • Mrfred
    Offline / Send Message
    Mrfred polycounter lvl 4
    all you need to do is a cross product.
    edit: tested and worked fine
  • Artist_in_a_box
    Offline / Send Message
    Artist_in_a_box polycounter lvl 7
    Thanks. I will give that a go. The method I am using works but I even asked the artist who posted the video and he said he has no idea, just that it does. I will give your method a go however as the method I am using doesn't give you complete control as you say.

    Thanks
  • Artist_in_a_box
    Offline / Send Message
    Artist_in_a_box polycounter lvl 7
    (I have scrapped this, I got this next step to work but then ran into other issues, I think I am going the wrong way about it. I will come back to this at a later date when I have learned some more. Thanks)

    I am studying Maxscript now. I think it is about time I get to grips with it. I have another question relating to this.

    I have a path of blocks arranged like dominos. I want the dominos to move upwards on the world Z axis like a Mexican Wave. The plan was I would use the method mentioned above to lift the blocks up by moving a dummy object along a path underneath them and the blocks will lift as they go.

    This was working in a roundabout way until I tried to switch out the height function in the wire parameters for Position Z. I thought this would be a simple switch but when I attach the distance to the Position Z it doesn't do anything.

    I think I am punching above my weight at the moment but am going to give this one last shot before I scrap it.

    Cheers
Sign In or Register to comment.