5
$\begingroup$

Consider this example of the cow

cow = ExampleData[{"Geometry3D", "Cow"}, "GraphicsComplex"];
p = {0, 0, -0.25}

Compare the rotation and reflection transformation

Row[{
  Graphics3D[{EdgeForm[None], cow, 
    GeometricTransformation[cow, ReflectionTransform[{0, 0, 1}, p]]}, 
   ImageSize -> Large, Boxed -> False],
  Graphics3D[{EdgeForm[None], cow, 
    GeometricTransformation[cow, 
     RotationTransform[π, {1, 0, 0}, p]]}, ImageSize -> Large, 
   Boxed -> False]}]

enter image description here

Here the "Classic" lighting

enter image description here

So why does the reflected cow have a different color than the rotated cow?

$\endgroup$
  • $\begingroup$ What happens if you change the settings to Lighting -> "Classic"? $\endgroup$ – J. M. will be back soon Jan 23 '17 at 21:17
  • $\begingroup$ @J.M. The color is still different under Lighting -> "Classic". See the updates. $\endgroup$ – xslittlegrass Jan 23 '17 at 21:25
  • 1
    $\begingroup$ Seems like a bug with the way GraphicsComplex interacts with GeometricTransform, but you can workaround it by using Normal to get rid of the complex: Row[{Graphics3D[{EdgeForm[None], cow, Normal@GeometricTransformation[cow, ReflectionTransform[{0, 0, 1}, p]]}, ImageSize -> Large, Boxed -> False], Graphics3D[{EdgeForm[None], cow, Normal@GeometricTransformation[cow, RotationTransform[\[Pi], {1, 0, 0}, p]]}, ImageSize -> Large, Boxed -> False]}] $\endgroup$ – Jason B. Jan 23 '17 at 22:09
  • 2
    $\begingroup$ It looks like the reflection is turning the polygons inside out, so the normals point in. You could flip them back with flip[x_] := x /. HoldPattern[VertexNormals -> vn_] :> (VertexNormals -> -vn) $\endgroup$ – Simon Woods Jan 23 '17 at 22:17
  • $\begingroup$ @SimonWoods Thanks! I will accept it if you would like to write that into an answer. $\endgroup$ – xslittlegrass Jan 24 '17 at 1:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.