mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
101.88k stars 35.32k forks source link

Getting a 'flat' view with Camera (WebGL) #1511

Closed squarefeet closed 12 years ago

squarefeet commented 12 years ago

Hi all,

Bit of an odd and possibly silly question (I'm new to THREE), but is it possible to 'flatten' the view seen by a camera, so rather than showing the 3d perspective view, it shows a 'flat' view from the top/bottom/left/right/etc., where all the objects in the scene are shown on the same plane/axis?

A good example of this are the views you get in a 3d rendering program like Cinema 4d, as shown by these screenshots: http://justcreative.com/wp-content/uploads/2008/04/cinema4d.jpg and http://www.tutorialguide.net/images/cinema_4d/0001/003.jpg

If there's nothing already in THREE.js, do you guys know of any theory behind how this functionality would be implemented (in my head, for a front view [looking down the z axis], the camera would just set all z vertices to 0, for example)?

Cheers :)

ColasMarko commented 12 years ago

OrthographicCamera should do the job, you'll only need to give the right view direction.

squarefeet commented 12 years ago

Oh, of course! Thanks Kovleouf.