Maxon Developers
    • Downloads
      • All Downloads
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
      • Cinema 4D Python Examples
      • Cinema 4D C++ Examples
      • Project Tool
      • SDK Database
    • Documentation
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
    • Forum
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Forums
      • Overview
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • News & Information
      • Downloads
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Register
    • Login

    InitGLimage question

    SDK Help
    0
    2
    50
    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 05/06/2006 at 05:22, xxxxxxxx wrote:

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

      ---------
      I want to show a custom image for my shader. Is there any way to identify where a corresponding pixel of the passed BaseBitmap is in the world space? Or at least the direction from eye view?

      My shader is on a sky object.

      Thanks

      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 05/06/2006 at 07:29, xxxxxxxx wrote:

        what I actually want to do is something like the c4d sky preview in the editor. I tried a spherical conversion, but my code creates distortion:

        for(LONG y=0;y<bmp->GetBh();++y)  
             {            
                  float v = float(y)/(bmp->GetBh()-1);  
                  float phi = Mix(90,-90,v);  
          
                  for(LONG x=0;x<bmp->GetBw();++x)  
                  {                 
                       float u = float(x)/(bmp->GetBw()-1);  
                         
                       float theta = u*360;  
          
                       float theta_rad          = Rad(theta);  
                       float phi_rad          = Rad(phi);  
          
                       Vector wp = Vector(sin(phi_rad) * cos(theta_rad),  
                                                sin(phi_rad) * sin(theta_rad),  
                                                cos(phi_rad));
        

        Any help appreciated

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