InitGLimage question

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

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