1

First of all, I have this code which creates a curved surface that looks like a flying carpet.

#include "colors.inc"

camera {
    location <5,140,25>
    look_at <0, 0, 0>   
    angle 7}                              


light_source {
    <20, 20, 20>  
    White

}


#declare Ball =
 sphere{<0,0,0>,0.25   


   texture{
     pigment{color rgb<1,0.65,0.0>}
     finish {diffuse 0.9 phong 1}
    }// end of texture 


 }// end of sphere


#declare E = 5;
#declare Z = -E;    // start value Z
#declare EndZ = E;  // end value Z
#declare Step = 0.2;// step value 

//------- loop start Z:
#while ( Z < EndZ + Step)


  #declare X = -E; // start value X
  #declare EndX = E; // end value X   


  //------ loop start X:
  #while ( X < EndX + Step)

  object{Ball
  translate<X,0.05*X*sin(X-2*Z)
           + 0.1*Z*cos(3*X-Z),Z>}

  #declare X = X+Step;//next X value
  #end // --------------- loop end X


#declare Z = Z+Step;//next Z value


#end // --------------- loop end Z     

The output of this code: flying carpet

now I want to map an simple image like this

example pattern image

Instead of yellow balls, I want map that simple pattern on the curved surface so that pattern can be wavy kind of looking.

I have tried to map the ball and loop it, but obviously the output was not the single square wave-looking image. (I don't want that picture repeated, just single curved image.)

would that be possible??

Thank you..

Yun Tae Hwang
  • 1,249
  • 3
  • 18
  • 30

1 Answers1

0

Currently you pre-declare a sphere and then translate it. If you apply a texture then it will be translated along with the sphere, so all will get the same texture.

Use the loop to create the sphere with the proper coordinates at once, inside a union. Then apply the texture to that union. Scale and position the texture accordingly.

ingo
  • 117
  • 10