Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am rendering a world environment simulation in Mathematica with Graphics3D code:

Show[{
Graphics3D[{
Lighting -> "Neutral",
Green, 
Polygon[{{-10, -10, 0}, {-10, 10, 0}, {10, 10, 0}, {10, -10, 
   0}}],
Red, Cone[{{0, 0, 0}, {0, 0, .1}}, 1/2],
White, 
Table[Sphere[
   Table[{0, 0, 10} + {rx, ry, rz} + {r, r, r/3} /. 
     r :> RandomReal[]*4, {5}], 
   2] /. {rx -> RandomReal[{-20, 20}], 
   ry -> RandomReal[{-20, 20}], rz -> RandomReal[{-1, 3}]}, {30}]
}, Boxed -> False, Background -> Blue, 
ImageSize -> {900, 900*41/54}, SphericalRegion -> True],
ContourPlot3D[
x^2 + y^2 == 10^2, {x, -10, 10}, {y, -10, 10}, {z, 0, .6}, 
Mesh -> None, Lighting -> "Neutral", 
ContourStyle -> Darker[Green]]
}]

If the camera is positioned far away from the scene so that everything is in view range, it renders fine:

somewhat cloudy

However, when I specify the desired camera parameters:

ViewVector -> {{0, 0, .1}, {0, 1, .1}}, ViewAngle -> 54 \[Degree]

The rendering becomes weird:

weird rendering

The bottom part of the green rectangle is cut off and the blue background is displayed instead, and the red cone is very weird as well. Is there a way to display this scene properly?

edit: Solved with

ViewRange -> {0.1, 100}

This is not optimal, because it does not take 0 or Automatic for a minimum value, All causes the cut-off in the above example, and it does not take Infinity or Automatic for a maximum value.

share|improve this question
    
Could be the objects are overlapping and rendering poorly. What happens if you move the cone slightly higher off the 'ground'? –  cormullion Jun 7 '13 at 13:36
    
The cone is then rendered correctly, but the scene is still cut off at the bottom: i.imgur.com/qmtF9Of.png –  shrx Jun 7 '13 at 13:38
1  
ContourPlot3D[x^2 + y^2 == 10^2, {x, -10, 10}, {y, -10, 10}, {z, 0, .6}, Mesh -> None, Lighting -> "Neutral", ContourStyle -> Darker[Green]] - are you aware that there's a Cylinder[] primitive? –  J. M. Jun 7 '13 at 13:39
1  
Yes, but it has bottom and top faces, which I don't want displayed in this case. –  shrx Jun 7 '13 at 13:41
    
In that case, you use Tube[] with a suitable setting for CapForm[]. –  J. M. Jun 7 '13 at 13:44

1 Answer 1

up vote 1 down vote accepted

Solved with

ViewRange -> {0.1, 100}

This is not optimal, because it does not take 0 or Automatic for a minimum value, All causes the cut-off in the above example, and it does not take Infinity or Automatic for a maximum value.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.