Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    3d gradient math question

    SDK Help
    0
    3
    435
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 28/02/2003 at 22:55, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   8.012 
      Platform:    Mac  ;  
      Language(s) :     C++  ;

      ---------
      i'm trying to make a 3d linear gradient between two points, but i'm having trouble with my math... can anyone help?

      ok, to make it clear in math terms , i have two points in space (gdata.start and gdata.end), i want to work out the distance of my point "p" from the plane who's normal is defined by gdata.end-gdata.start, with the point gdata.start being on the plane.

      what am i doing wrong? (oh and i want the result in terms of the length of the distance between my start and end points).

      gdata.start=Vector(0,-100,24);
      gdata.end=Vector(0,100,0);
      Vector norm=(gdata.end-gdata.start);
      r=(p-gdata.start)*!norm/Len(norm);

      heeeelp!

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 01/03/2003 at 04:48, xxxxxxxx wrote:

        (!(end-start))*(p-start)

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 01/03/2003 at 10:58, xxxxxxxx wrote:

          great thanks, does the trick nicely 🙂 (and much more consise than my equation)

          1 Reply Last reply Reply Quote 0
          • First post
            Last post