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

    Convert temperature to color

    SDK Help
    0
    4
    375
    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

      On 15/02/2017 at 08:53, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R16 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      I want to convert a color temperature to a real color (vector).

      There is an xpresso node "Color Temperature" that does precisely what I want.
      However, in R16 I cannot find a C++ routine that does the same.

      In R18 there is a conversion routine, but I cannot find it in R16.
      const Vector rgb = ColorKelvinTemperatureToRGB(kelvin);

      There is no lib_colorchooser.h file.

      What can I do?

      -Pim

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

        On 16/02/2017 at 01:46, xxxxxxxx wrote:

        Hi Pim,

        as stated in the docs this function got introduced with R18. And the new Color Chooser (which lib_colorchooser is there for) got introduced with R17, which is the reason why you can't find the header before in the SDK.
        Before R18 there was no functional equivalent for ColorKelvinTemperatureToRGB(), sorry.

        But using your favorite search engine, it should be easy to find a conversion algorithm in source. Don't know if it's good or not (and in no way MAXON is responsible or connected to the site or its owner), it was the simply first search hit: Tanner Helland - How to Convert Temperature (K) to RGB

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

          On 16/02/2017 at 01:51, xxxxxxxx wrote:

          Hi Andreas,

          Thanks for confirming what I expected and yes, I found something on the Internet.
          Thanks, Pim

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

            On 17/02/2017 at 04:01, xxxxxxxx wrote:

            Can sound like a hack. But you can add a light. Change her color temperature (you could do this also in R11 if i'm right at least in R13 you can). Update the light.
            Then grab the color from light wich c4d will automaticly set the color when you update it 😉

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