http:^^www.cs.cornell.edu^info^people^shim^meng^meng_report.html
来自「This data set contains WWW-pages collect」· HTML 代码 · 共 387 行 · 第 1/2 页
HTML
387 行
MIME-Version: 1.0
Server: CERN/3.0
Date: Sunday, 01-Dec-96 18:58:27 GMT
Content-Type: text/html
Content-Length: 14495
Last-Modified: Tuesday, 06-Aug-96 02:25:38 GMT
<HTML><HEAD><TITLE>Viewing System</TITLE></HEAD><BODY BACKGROUND = "wall.gif"><CENTER><H1><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><A HREF = "http://www.cs.cornell.edu/Info/People/shim/MENG/ViewingSystem.html">Viewing System </A><BR><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><A HREF = "http://www.cs.cornell.edu/Info/Department/Meng/">Master of Engineering </A> Project <P></H1><H2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><A HREF = "http://www.cs.cornell.edu/Info/People/shim/shim.html"> Eric Young-Sang Shim</A> <BR><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><A HREF = "http://www.cs.cornell.edu"> Computer Science Department</A>, <!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><A HREF = "http://www.cornell.edu"> Cornell University </A><P></H2><H3>Advisor : Professor <!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><A HREF="http://www.tc.cornell.edu/~bruce/">Bruce Land </A> </H3></CENTER><P><HR><H2>Table of Contents</H2><UL><H3><LI><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><A HREF="#introduction">Introduction</A><LI><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><A HREF="#equations">Equations</A><LI><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><A HREF="#implementation">Implementation</A><LI><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><A HREF="#howThisWorks">How this program works</A><LI><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><A HREF="#conclusion">Conclusion</A><LI><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><A HREF="#acknowledgement">Acknowledgements</A><LI><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><A HREF="#reference">References</A></H3></UL><HR><A NAME="introduction"></A><H2>Introduction</H2><P><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><IMG ALIGN = LEFT SRC = "http://www.cs.cornell.edu/Info/People/shim/MENG/MENGlogo.gif">Although various three-dimentional display devices exist, mostcomputer graphics view surfaces are two-dimentional. Thus athree-dimentional pipeline - the jargon term used to describe thevarious processes in converting from three-dimentional worldcoordinate space to a two-dimentional representation - must contain aprojective transformation and a viewing transformation, the minimumrequirements to convert a three-dimentional scene to a two-dimentionalprojection.<P>I have designed and implemented the Viewing System IV which wascarefully explained in the "3D Computer Graphics" by Alan Watt using <!WA14><!WA14><!WA14><!WA14><!WA14><!WA14><!WA14><!WA14><!WA14><!WA14><!WA14><!WA14><A HREF = "http://java.sun.com"> JAVA </A>. <BR>All the objects are created in the <B>world coordinatesystem</B> which is conventionally represented as a right-handedsystem. We can consider a transformation, <I><B>T</B>view</I> from aworld coordinate system to a viewing coordinate system (<I>Xv, Yv,Zv</I>). Here, in viewing coordinate system, vertices are expressedin a left-handed coordinate system with the origin sometimes known asthe <B>view point</B> or <B>view reference point</B> which isrepresented as the position of a viewer's eye or the position at whicha virtual camera is placed. Then, the second transformation,<I><B>T</B>pers</I> is applied to project three-dimensional points in<B>view space</B> onto the the three-dimensional screen space(<I>Xs,Ys, Zs</I>). Then, I projected the vertices from screen space onto theprojection space which is two-dimentional <B>view plane</B> tosimulate the camera transformation. <P>A full viewing system will also determine a <B>viewvolume</B>(truncated view frustum), which is thesubset of world coordinate space which is to be included in thetransformation process. As far as a general three-dimensionalrendering pipeline is concerned, I needed to define a view volume.To define this view volume, I needed to specify a near plane, a farplane and a view plane window. The specific plane formula will bepresented in the <!WA15><!WA15><!WA15><!WA15><!WA15><!WA15><!WA15><!WA15><!WA15><!WA15><!WA15><!WA15><A HREF="#equations">Equations</A> section of thisreport. <BR> Since it was very hard to create the view frustum in the world coordinate system, I have created the view frustumin the viewing coordinate space and apply inverse <I><B>T</B>view</I>matrix to the view frustum that has created in the viewing coordinatesystem. By doing this, I was able to create the view frustum in theworld coordinate system. Also, the three dimentional clipping shouldbe performed in the viewing coordinate space. <BR><BR><BR><HR><A NAME="equations"></A><H2>Equations</H2><P>We need a viewing direction vector N, and up vector V and an optionalvector U. The following equations are showing how to obtain thesevectors. <P><!WA16><!WA16><!WA16><!WA16><!WA16><!WA16><!WA16><!WA16><!WA16><!WA16><!WA16><!WA16><IMG ALIGN = BOTTOM SRC = "http://www.cs.cornell.edu/Info/People/shim/MENG/EQUATIONS/N.gif"> <P>N vector is a viewing direction vector and is obtained by calculatingcamera to position subtract camera from position. This N vector isused when we calculate the Tview Matrix.<P><!WA17><!WA17><!WA17><!WA17><!WA17><!WA17><!WA17><!WA17><!WA17><!WA17><!WA17><!WA17><IMG ALIGN = BOTTOM SRC = "http://www.cs.cornell.edu/Info/People/shim/MENG/EQUATIONS/V.gif"> <P>V vector is a up vector. Because B must be perpendicular to N, we needa strategy that can take care of this care where the user entered N isnot perpendicular to M. Since the user entered V vector is just aestimated V vector, we need to calculate the V vector by apply thisequation. This V vector is also used when we calculate the TviewMatrix. <P><!WA18><!WA18><!WA18><!WA18><!WA18><!WA18><!WA18><!WA18><!WA18><!WA18><!WA18><!WA18><IMG ALIGN = BOTTOM SRC = "http://www.cs.cornell.edu/Info/People/shim/MENG/EQUATIONS/U.gif"> <P>U vector is an optional vector that could be obtained by cross productof N and V vector resulting in a left-handed coordinate system. Also,this U vector is used when we calculate the Tview Matrix.<P> <!WA19><!WA19><!WA19><!WA19><!WA19><!WA19><!WA19><!WA19><!WA19><!WA19><!WA19><!WA19><IMG ALIGN = BOTTOM SRC = "http://www.cs.cornell.edu/Info/People/shim/MENG/EQUATIONS/Tview.gif"> <P><I><B>T</B>view</I> matrix is obtained simply by calculating thisequation. This Tview can transform any points in world coordinatesystem into the viewing coordinate system. T matrix translates theobject, and B matrix roates the object where <B>T</B> and <B>B</B> arethe followings. <P> <!WA20><!WA20><!WA20><!WA20><!WA20><!WA20><!WA20><!WA20><!WA20><!WA20><!WA20><!WA20><IMG ALIGN = BOTTOM SRC = "http://www.cs.cornell.edu/Info/People/shim/MENG/EQUATIONS/T.gif"> <P><!WA21><!WA21><!WA21><!WA21><!WA21><!WA21><!WA21><!WA21><!WA21><!WA21><!WA21><!WA21><IMG ALIGN = BOTTOM SRC ="http://www.cs.cornell.edu/Info/People/shim/MENG/EQUATIONS/B.gif"> <P>Now, we have to have someway to transform from the viewing coordinatesystem into the world coordinate system. In the case of view frustumwhich was created in the viewing coordinate system, and needed to betransformed to world coordinate system. <P><!WA22><!WA22><!WA22><!WA22><!WA22><!WA22><!WA22><!WA22><!WA22><!WA22><!WA22><!WA22><IMG ALIGN = BOTTOM SRC = "http://www.cs.cornell.edu/Info/People/shim/MENG/EQUATIONS/Tview-1.gif"> <P><I><B>T</B>view inverse</I> matrix is obtained simply by calculating thisequation. This Tview inverse can transform any points in viewing coordinatesystem into the world coordinate system. B transpose matrix translates theobject, and T(-x) matrix roates the object. <P>After we have create the object in the world coordinate system, andtransform the points into the viewing coordinate system, we need totransform the points in viewing coordinate system into the screencoordinate system again. By doing this, we are finally be able tosimulate the camera transformation from world coordinate system toscreen coordinate system. <P><!WA23><!WA23><!WA23><!WA23><!WA23><!WA23><!WA23><!WA23><!WA23><!WA23><!WA23><!WA23><IMG ALIGN = BOTTOM SRC = "http://www.cs.cornell.edu/Info/People/shim/MENG/EQUATIONS/XYZw.gif"> <P>where <P><!WA24><!WA24><!WA24><!WA24><!WA24><!WA24><!WA24><!WA24><!WA24><!WA24><!WA24><!WA24><IMG ALIGN = BOTTOM SRC = "http://www.cs.cornell.edu/Info/People/shim/MENG/EQUATIONS/Tpers.gif"> <P><I><B>T</B>pers</I> matrix is obtained simply by calculating thisequation. This <I><B>T</B>pers</I> matrix is consists of d, f and hvalues that the user has entered from the user interface. d is thedistance from the camera to the near plane. Incidently, the view planeis the same as the near plane in this viewing system. f is thedistance from the camera to the far plane. Finally, the h value isthe half of the height of the view plane window. <P>As I create the view frustum, I should be able to specify the sixplanes. There are Xv, Yv and two Zv values. Xv specifies the twoplanes of the view frustum. Yv specifies the top and the bottom planesof the view frustum. And the Zv specifies the front(near plane andview plane) plane and the far plane. <P><!WA25><!WA25><!WA25><!WA25><!WA25><!WA25><!WA25><!WA25><!WA25><!WA25><!WA25><!WA25><IMG ALIGN = BOTTOM SRC = "http://www.cs.cornell.edu/Info/People/shim/MENG/EQUATIONS/Xv.gif"> <P><!WA26><!WA26><!WA26><!WA26><!WA26><!WA26><!WA26><!WA26><!WA26><!WA26><!WA26><!WA26><IMG ALIGN = BOTTOM SRC = "http://www.cs.cornell.edu/Info/People/shim/MENG/EQUATIONS/Yv.gif"> <P><!WA27><!WA27><!WA27><!WA27><!WA27><!WA27><!WA27><!WA27><!WA27><!WA27><!WA27><!WA27><IMG ALIGN = BOTTOM SRC = "http://www.cs.cornell.edu/Info/People/shim/MENG/EQUATIONS/Zv1.gif"> <P><!WA28><!WA28><!WA28><!WA28><!WA28><!WA28><!WA28><!WA28><!WA28><!WA28><!WA28><!WA28><IMG ALIGN = BOTTOM SRC = "http://www.cs.cornell.edu/Info/People/shim/MENG/EQUATIONS/Zv2.gif"> <P><P><HR><A NAME="implementation"></A><H2>Implementation</H2><P>In this project, I have implemented 14 classes which represents eachobjects in this Viewing System. I will introduce all the classes andbriefly go over each class' class definition in this section.<P><STRONG>Class definitions</STRONG><DL><DT><STRONG>cameraTransformation</STRONG> <DD>The main program. This class creates all the buttons,canvases, text fields. And this class contains user input data,<I><B>T</B>view</I>, and <I><B>T</B>pers</I> matrixs. Also, thisclass initialize all the necessary variables, and handle all theevents that user entered such as mouse click or enter the value ofcamera location, camera to, V vector, and V, H, F values. <P>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?