va3c / viewer

3D Model Viewer with Three.js
http://va3c.github.io/viewer/
183 stars 118 forks source link

zoomout will cause part of model hidding #5

Open flower4wine opened 9 years ago

flower4wine commented 9 years ago

Hello Masters,

I tried viewer and it's awesome !

However, I encounter a visual problem: while zooming out, a model will be hidden by part. If I zoom in, the missing part will show up again. Anything I need to pay attention? Like camera settings, near/far clip, or any other stuff? Thanks a lot !

Last but not least, thank you much for this project.

Best Regards, David Tan

theo-armour commented 9 years ago

Hi David

Glad to hear that you are happy with the vA3C Viewer.

The issue you describe most likely relates to the PerspectiveCamera.far variable. See:

http://mrdoob.github.io/three.js/docs/#Reference/Cameras/PerspectiveCamera

Currently this variable is set manually in the default template file:

https://github.com/va3c/viewer/blob/gh-pages/va3c-viewer-html5/r6/template-basic.html#L28

If there are issues, you can call the Zoom Extents function by clicking on its icon at the bottom of the menu. Here is the function:

https://github.com/va3c/viewer/blob/gh-pages/va3c-viewer-html5/r6/jath-three.js#L108-152

This function resets the camera near and far distances according to the size of the data in the drawing.

Because the function has to examine every single object in the drawing, it is kind of 'expensive'. But we should look into doing this automatically if the drawing is not too large.

I will add such a feature to the Read Map.

Thank you for the feedback.

Any other issues? Or wishlist items?

Theo

On Thu, Oct 9, 2014 at 7:38 PM, flower4wine notifications@github.com wrote:

Hello Masters,

I tried viewer and it's awesome !

However, I encounter a visual problem: while zooming out, a model will be hidden by part. If I zoom in, the missing part will show up again. Anything I need to pay attention? Like camera settings, near/far clip, or any other stuff? Thanks a lot !

Last but not least, thank you much for this project.

Best Regards, David Tan

— Reply to this email directly or view it on GitHub https://github.com/va3c/viewer/issues/5.

flower4wine commented 9 years ago

Hi Theo,

Many thanks for your so quick reply!

I'm working on revit2.html, instead of the HTML5 version you mentioned. Anyway, I get it done by change far distance from 10000 to 50000. Cheers! :-)

Best Regards, David Tan