title: my raytracing reflection look strange
body: <p>im learning raytracing and im adding the reflection to my raytracing.but the reflection of the spheres look flat.i don't know why.</p>
  
  <p>i rendered the normalized reflection and the color pic out. hope someone could help me. thanks.</p>
  
  <p>the code of the reflection :  </p>
  
  <pre><code>Color getColor( Vect pos,Vect dir,const vector&lt;Source*&gt; &amp;lights,const vector&lt;Object*&gt; &amp;objects,double ambient,int index,double accuracy,int deep){  
      Color win_obj_color = objects[index]-&gt;getColor();  
      Vect win_obj_normal =  objects[index]-&gt;getNormalAt(pos);  
      Color final_color(win_obj_color*ambient);  
      double dir_normal = win_obj_normal*dir;  
  
      if (dir_normal &gt;0) return final_color;  
  
      Vect reflect_dir = (dir +2*win_obj_normal).normalize();
  
      if (objects[index]-&gt;reflectivity()&gt;0 &amp;&amp; deep&gt;0) {  
          Ray reflect_ray(pos,reflect_dir);   
          vector&lt;index_line&gt;  reflection_detection =           check_intersections(objects,reflect_ray,accuracy);     
          if (reflection_detection.size()!=0)  {
          //final_color+=Color(reflect_dir);
              final_color += getColor(reflect_ray.origin+reflect_ray.direction*reflection_detection[0].distance,reflect_ray.direction,lights,objects,ambient,reflection_detection[0].index,accuracy,deep-1)*(-dir_normal)*objects[index]-&gt;reflectivity();
  
          }
      }  
   ....
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/UxSjG.jpg" alt="reflecting direction">
  <img src="https://i.stack.imgur.com/En0yT.jpg" alt="enter image description here"></p>
  
  <p>finally i get the correct reflection.</p>
  
  <p>the problem is here
       <code>Vect reflect_dir = (dir +2*win_obj_normal).normalize();</code><br>
  this will turn the reflect_dir almost the same as the object's normal direction.<br>
  I change the formula of the reflect_dir calculation and get the correct result
      <code>Vect reflect_dir = (dir-2*dir_normal*obj_normal).normalize();</code>
  <img src="https://i.stack.imgur.com/yBWaT.jpg" alt="enter image description here"></p>