tengge1/ShadowEditor

How to implement view button functionalities?

Whitew2015 opened this issue · 1 comments

Hello I am implementing several buttons in the Three.js editor's toolbar that would allow me to change the view of the model with a click of a button. But I do not know how to implement the functionalities for them. Here's a snippet of my code for it so far:
toolbar

add OrthographicCamera and PerspectiveCamera. When show perspective view, use PerspectiveCamera to render the scene; when orthographic view, use OrthographicCamera to render the scene.

Use OrthographicCamera when we show front view, side view and top view. The diffierence is the camera position and rotation.

I implemented this function in this file: https://github.com/tengge1/ShadowEditor/blob/master/web/src/event/ViewEvent.js. You can reference to it.