-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IRT viewerの表示がおかしい #470
Comments
こういう時はすべての出力を注意深く見ておくのが重要ですよね.よく見ると以下のような表示がでているはずです.
Detect very large/small objects(0.000661), change perspective
で,これはopenglのfar/nearを自動で決めるコードが入っているので,
(objects (list (make-cube 100 100 100) (make-cube 1000 1000 1 :pos #f(0 0
-100))))
みたいにすると,いい感じに見えるとおもいますが,それ以外に
(setq gl::*perspective-far* 30000 gl::*perspective-near* 200)
としてデフォルト値に戻す方法がありそうです.
あとは本格的に,
(when bbox
(let (diag vang vt vp sc)
(setq vt (send bbox :center))
(setq diag (apply #'max (coerce (send bbox :diagonal) cons))
vang (* 0.5 (send self :viewer :viewing :view-angle)))
;; object size should be within 10%-1000% of view angle
;; when current object size exceed this limitation, then update the
perspective
;;(warning-message 3 "Current object size ~A~%" (/ diag (* (norm
(v- viewpoint viewtarget)) (tan vang))))
;;(warning-message 3 " *near* ~7,3f, ~A~%" gl::*perspective-near* (*
(/ diag (tan vang)) 0.1))
;;(warning-message 3 " *far* ~7,3f, ~A~%" gl::*perspective-far* (*
(/ diag (tan vang)) 10))
(when (or (> gl::*perspective-near* (* (/ diag (tan vang)) 0.6))
(< gl::*perspective-far* (* (/ diag (tan vang)) 10)))
(warning-message 2 "Detect very large/small objects(), change
perspective~%" (/ diag (tan vang)))
(warning-message 2 " from *near* ~7,3f, *far* ~7,3f~%"
gl::*perspective-near* gl::*perspective-far*)
(setq gl::*perspective-near* (* (/ diag (tan vang)) 0.3)
gl::*perspective-far* (* (/ diag (tan vang)) 20))
(warning-message 2 " to *near* ~7,3f, *far* ~7,3f~%"
gl::*perspective-near* gl::*perspective-far*)
)
(setq vp (scale (* 2 (/ diag (tan vang))) (normalize-vector (v-
viewpoint viewtarget))))
(print (list vp vt))
(send self :viewtarget vt)
(send self :viewpoint (v+ vt vp))
))
(send self :look1)
(send self :draw-objects))
とか計算方法を治す,というのもあります.
…--
◉ Kei Okada
2017-11-24 0:08 GMT+09:00 Naoya Yamaguchi <[email protected]>:
(objects (list (make-cube 100 100 100)))
をすると以下のような表示になっていい感じだと思うのですが、
[image: make_cube_100]
<https://user-images.githubusercontent.com/19769486/33178877-e85b36f8-d0aa-11e7-85e8-9b0037689497.png>
新しくeusを立ち上げて
(objects (list (make-cube 10 10 10)))
(objects (list (make-cube 100 100 100)))
をすると以下のような表示になってしまいます。
[image: make_cube_10]
<https://user-images.githubusercontent.com/19769486/33178912-07dc940e-d0ab-11e7-9c47-c7c3f640e51e.png>
どうすれば直るでしょうか?
CC. @mmurooka <https://github.com/mmurooka>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#470>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAeG3DjBzvtV3S2BOqDKox6zb7R_Drc-ks5s5YpsgaJpZM4Qo44Q>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
をすると以下のような表示になっていい感じだと思うのですが、
新しくeusを立ち上げて
をすると以下のような表示になってしまいます。
どうすれば直るでしょうか?
CC. @mmurooka
The text was updated successfully, but these errors were encountered: