rohitvarkey / ThreeJS.jl

Julia interface to WebGL using Three-js custom elements and Patchwork.jl
https://rohitvarkey.github.io/ThreeJS.jl
Other
56 stars 15 forks source link

Fixed resizing bug, made aspect ratio of camera default to renderer aspect ratio #42

Closed izaid closed 8 years ago

izaid commented 8 years ago

This PR is essentially a follow-on to https://github.com/rohitvarkey/ThreeJS.jl/pull/38. What was going on there was that the renderer was simply always expanding to some very large default size, and it was not resizable -- so it could not be in layouts, etc.

I fixed that bug, but it led to some strangeness in other places. For one, the camera aspect ratio was always set at 16 / 9. I have changed this so that the camera aspect ratio now defaults to the the aspect ratio of the renderer in which it is contained (probably what most people want), though an explicit aspect ratio can still be passed in.

As a consequence of the above and the earlier PR, the camera and lighting in the examples needs to be slightly readjusted. I have done so for rotatingcube.jl, which is nicely doing what it was before but with an aspect ratio of the renderer window and the renderer window being set to a sensible size. The other examples will follow.

The accompanying PR is https://github.com/rohitvarkey/three-js/pull/8.

codecov-io commented 8 years ago

Current coverage is 87.09% (diff: 100%)

Merging #42 into master will not change coverage

@@             master        #42   diff @@
==========================================
  Files             3          3          
  Lines            93         93          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits             81         81          
  Misses           12         12          
  Partials          0          0          

Powered by Codecov. Last update 0d7928c...b465c2f