<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Computer Graphics</title>
	<link>http://cgi.cse.unsw.edu.au/~cs3421/wordpress</link>
	<description>COMP3421/COMP9415 Session 2, 2008</description>
	<pubDate>Mon, 25 Aug 2008 17:25:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.3</generator>
	<language>en</language>
			<item>
		<title>Week 5 podcast</title>
		<link>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/26/week-5-podcast/</link>
		<comments>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/26/week-5-podcast/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 16:21:59 +0000</pubDate>
		<dc:creator>TimLambert</dc:creator>
		
	<category>podcast</category>
		<guid isPermaLink="false">http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/26/week-5-podcast/</guid>
		<description><![CDATA[Here.

I finished 3D modelling, covered clipping, and started 3D viewing.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cse.unsw.edu.au/%7Ecs3421/slides/audio/COMP3421wk05.mp3">Here.</a></p></p>

<p>I finished 3D modelling, covered clipping, and started 3D viewing.</p>
]]></content:encoded>
			<wfw:commentRSS>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/26/week-5-podcast/feed/</wfw:commentRSS>
<enclosure url='http://www.cse.unsw.edu.au/%7Ecs3421/slides/audio/wk5a.mp3' length='652702' type='audio/mpeg'/>
<enclosure url='http://www.cse.unsw.edu.au/%7Ecs3421/slides/audio/wk5b.mp3' length='29712694' type='audio/mpeg'/>
<enclosure url='http://www.cse.unsw.edu.au/%7Ecs3421/slides/audio/wk5c.mp3' length='13294102' type='audio/mpeg'/>
<enclosure url='http://www.cse.unsw.edu.au/%7Ecs3421/slides/audio/COMP3421wk05.mp3' length='26698739' type='audio/mpeg'/>
		</item>
		<item>
		<title>3D Viewing</title>
		<link>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/25/3d-viewing/</link>
		<comments>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/25/3d-viewing/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 16:00:52 +0000</pubDate>
		<dc:creator>TimLambert</dc:creator>
		
	<category>lectures</category>
		<guid isPermaLink="false">http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/25/3d-viewing/</guid>
		<description><![CDATA[(Hill 2nd ed 358-390, 704-711; 3rd ed 327-361, 668-669)

My slides (ODF) Slides in PDF  

Vrml examples

Chapter 3 of the OpenGL programmer&#8217;s guide on Modeling and Viewing.

BSP Tree Applet
]]></description>
			<content:encoded><![CDATA[<p>(Hill 2nd ed 358-390, 704-711; 3rd ed 327-361, 668-669)</p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/slides/COMP3421-view.odp">My slides</a> (ODF) <a href="http://www.cse.unsw.edu.au/~cs3421/slides/COMP3421-view.pdf">Slides in PDF  </a></p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/slides/vrml/viewing.html">Vrml examples</a></p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/opengl-redbook-1.1/chapter03.html">Chapter 3</a> of the OpenGL programmer&#8217;s guide on Modeling and Viewing.</p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/slides/bsp/">BSP Tree Applet</a></p>
]]></content:encoded>
			<wfw:commentRSS>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/25/3d-viewing/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Clipping</title>
		<link>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/25/clipping/</link>
		<comments>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/25/clipping/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 15:38:02 +0000</pubDate>
		<dc:creator>TimLambert</dc:creator>
		
	<category>lectures</category>
		<guid isPermaLink="false">http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/25/clipping/</guid>
		<description><![CDATA[Hill (2nd ed 189-194; 3rd Ed 178-183)

My slides (ODF) Slides in PDF  
]]></description>
			<content:encoded><![CDATA[<p>Hill (2nd ed 189-194; 3rd Ed 178-183)</p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/slides/COMP3421-clip.odp">My slides</a> (ODF) <a href="http://www.cse.unsw.edu.au/~cs3421/slides/COMP3421-clip.pdf">Slides in PDF  </a></p>
]]></content:encoded>
			<wfw:commentRSS>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/25/clipping/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Lab 1</title>
		<link>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/21/lab-1/</link>
		<comments>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/21/lab-1/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 14:42:47 +0000</pubDate>
		<dc:creator>TimLambert</dc:creator>
		
	<category>labs</category>
		<guid isPermaLink="false">http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/21/lab-1/</guid>
		<description><![CDATA[In this lab, we will be looking at a couple of OpenGL programs that can be used to help us understand how OpenGL does things. They were written by Nate Robins. What they do is show us a little snippet of OpenGL code with constants in place. These constants can then be changed by dragging [...]]]></description>
			<content:encoded><![CDATA[<p>In this lab, we will be looking at a couple of OpenGL programs that can be used to help us understand how OpenGL does things. They were written by Nate Robins. What they do is show us a little snippet of OpenGL code with constants in place. These constants can then be changed by dragging the mouse.</p>

<p>To run the programs at CSE, do the following:</p>

<pre><code>% 3421
% cd ~cs3421/public_html/labs/nate
</code></pre>

<p>If you want to run things at home, then you can go to Nate Robin&#8217;s page for the tutors, which is <a href="http://www.xmission.com/~nate/tutors.html">here</a>. This has source and executables for Windows and MacOS. If you are a linux user, then you may find the following <a href="http://cgi.cse.unsw.edu.au/~cs3421/labs/nate/Makefile">makefile</a> useful for getting it to compile. (Note: You might to adjust the paths probably to tell it where your implementation of OpenGL is).</p>

<h3>Shapes</h3>

<p>To get the shapes demo up and running type</p>

<pre><code>% ./shapes
</code></pre>

<p>This will start the first little demo we are going to have a look at. Shapes shows you all the different types of primitives that can go between glBegin() and glEnd() statements. Note that while in class we have been using Java, and here it is C, the differences are mostly cosmetic.</p>

<p>In the left window you have the output from OpenGL, and in the right window you have the code that generated that output. Note that to have a look at options, you can right click the mouse in either window (each has different options). For example, if you right click in the screen-space view, you can choose to toggle colours at vertices.</p>

<p>Have a play with the applet. Get a grip of the various types of things you can do with OpenGL. Also, try to break things. Try to get polygons that don&#8217;t behave as they should etc.</p>

<p>Here are some questions to guide your experimenting.</p>

<ul>
<li>If you toggle vertices, what happens to the colour of the polygon?</li>
<li>Why does OpenGL have this interpolation of colour features? Why does a polygon engine allow you to set corner colours individually and then interpolate between them?</li>
<li>What type of shapes would you use quadrilateral strips, triangle fans and triangle strips?</li>
<li>Surely, you don&#8217;t need polygons AND quads AND triangle strips AND quad strips. Isn&#8217;t just polygons enough? What about line loops and line strips &#8230; surely we could implement just lines and polygons? Why does OpenGL support these strange and exotic data structures? </li>
</ul>

<h3>Transformations</h3>

<p>To get started with the transformation demo, at the prompt type:</p>

<pre><code>% ./transformation
</code></pre>

<p>This allows you to manipulate a variety of different models (right-click in the screen space view). Again, experiment with various settings and objects. The goal is to discover how various changes affect and interact. You may wish to use the following questions to direct your interaction.</p>

<ul>
<li>In the initial order of operation, in what order are the three operations done?</li>
<li>What is the order of parameters to glRotatef()?</li>
<li>Is this order of operations the &#8220;natural&#8221; order to do these transformations in? Why do you think that the designers chose this particular order of transformations?</li>
<li>Try swapping the order of the rotations and the translations. First try to work out the effect of first rotating by 90 degrees and then translating by 3 units, and then compare this with the opposite order?</li>
<li>What is the relationship between the &#8220;world-space view&#8221; and the &#8220;screen space view&#8221;? Why is it, that, for example, translating by negative values in the x direction actually leave the model where it is and moves the camera back? Is moving the camera along positive z the same as moving the objects in the scene by negative z? </li>
</ul>
]]></content:encoded>
			<wfw:commentRSS>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/21/lab-1/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Week 5 Tutorial</title>
		<link>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/20/week-5-tutorial/</link>
		<comments>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/20/week-5-tutorial/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 13:32:16 +0000</pubDate>
		<dc:creator>TimLambert</dc:creator>
		
	<category>Tutorial Questions</category>
		<guid isPermaLink="false">http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/20/week-5-tutorial/</guid>
		<description><![CDATA[

Question 1


Consider the following x-y pairs.







Assuming x and y were two axes in a right handed coordinate system, would the z axis for each of these point into the page or out of the page?


Question 2


You have two vectors v1=(-1, -1, 0) and v2=(4, 2, 0). 



(a) What is the dot product of the two [...]]]></description>
			<content:encoded><![CDATA[<p><a id="more-30"></a></p>

<h3>Question 1</h3>

<p>
Consider the following x-y pairs.
</p>

<p>
<img src="http://www.cse.unsw.edu.au/~cs3421/tutes/wk9/coord-2.gif">
</p>

<p>
Assuming x and y were two axes in a right handed coordinate system, would the z axis for each of these point into the page or out of the page?
</p>

<h3>Question 2</h3>

<p>
You have two vectors v1=(-1, -1, 0) and v2=(4, 2, 0). 
</p>

<p>
(a) What is the dot product of the two vectors? <br />
(b) Normalise the two vectors. <br />
(c) what is the cosine of the angle between the two vectors? <br />
(d) What is the cross product of the two vectors?
</p>

<h3>Question 3</h3>

<p>(a) The old CSE <a href="http://www.cse.unsw.edu.au/~lambert/logo/cselogo.html">logo</a> is made from 35 small 3D cubes.  Each of these cubes
has a side length of 0.7 units.  Find the transformation that
transforms a basic cube with centre (0,0,0) and a side length of 2
(such that corners are (1,1,1) and (-1,-1,-1)) to the small cube with
centre (0,4,2) (one of the cubes in the logo).
<br />
(b) Consider a local to world transformation, with the basis
(0.35,0,0), (0,0.35, 0) and (0,0,0.35) for u,v and n respectively, and
with offset (0, 4, 2). Is this an orthogonal basis? Orthornormal? What
is the matrix for the local to world transformation in this case?
</p>

<h3>Question 4</h3>

<p>Consider the following sequence of matrix operations in OpenGL. Show what happens to the modelview matrix stack after each operation, and calculate where the points A, B, C and D get transformed to in world space (NOTE: For convenience, the usual jogl &#8220;gl.&#8221; has been removed). In other words, where do A, B, C and D end up?</p>

<pre>
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glScalef(3,3,3);
glBegin(GL_POINTS); <-- A
glVertex3f(1,2,1); 
glEnd(); 
glRotatef(90, 0, 1, 0);
glBegin(GL_POINTS);
glVertex3f(2,1,3); <-- B
glEnd();
glPushMatrix();
glTranslatef(1,0,0);
glMultMatrix(1,0,0,0,0,2,0,0,0,0,1,0,0,0,0,1);
glPopMatrix();
glBegin(GL_POINTS);
glVertex3f(0,2,0); <-- C
glEnd(); 
glTranslatef(0,1,0);
glBegin(GL_POINTS); 
glVertex3f(1,0,0); <-- D
glEnd();
</pre>
]]></content:encoded>
			<wfw:commentRSS>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/20/week-5-tutorial/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Protected: Week 5 Solution</title>
		<link>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/20/week-5-solution/</link>
		<comments>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/20/week-5-solution/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 13:30:00 +0000</pubDate>
		<dc:creator>TimLambert</dc:creator>
		
	<category>Tutorial Solutions</category>
		<guid isPermaLink="false">http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/20/week-5-solution/</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://cgi.cse.unsw.edu.au/~cs3421/wordpress/wp-pass.php" method="post">
    <p>This post is password protected. To view it please enter your password below:</p>
    <p><label>Password: <input name="post_password" type="password" size="20" /></label> <input type="submit" name="Submit" value="Submit" /></p>
    </form>
]]></content:encoded>
			<wfw:commentRSS>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/20/week-5-solution/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Luxo Jr</title>
		<link>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/20/luxo-jr/</link>
		<comments>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/20/luxo-jr/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 15:46:01 +0000</pubDate>
		<dc:creator>TimLambert</dc:creator>
		
	<category>not on the exam</category>
		<guid isPermaLink="false">http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/20/luxo-jr/</guid>
		<description><![CDATA[The video was saw this week was Luxo Jr.
]]></description>
			<content:encoded><![CDATA[<p>The video was saw this week was <a href="http://en.wikipedia.org/wiki/Luxo_Jr.">Luxo Jr</a>.</p>
]]></content:encoded>
			<wfw:commentRSS>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/20/luxo-jr/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Week 4 podcast</title>
		<link>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/18/week-4-podcast/</link>
		<comments>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/18/week-4-podcast/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 11:23:32 +0000</pubDate>
		<dc:creator>TimLambert</dc:creator>
		
	<category>podcast</category>
		<guid isPermaLink="false">http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/18/week-4-podcast/</guid>
		<description><![CDATA[On 3D modelling. Get it here.
]]></description>
			<content:encoded><![CDATA[<p>On 3D modelling. Get it <a href="http://www.cse.unsw.edu.au/~cs3421/slides/audio/COMP3421wk04.mp3">here</a>.</p>
]]></content:encoded>
			<wfw:commentRSS>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/18/week-4-podcast/feed/</wfw:commentRSS>
<enclosure url='http://www.cse.unsw.edu.au/~cs3421/slides/audio/wk4a.mp3' length='2053030' type='audio/mpeg'/>
<enclosure url='http://www.cse.unsw.edu.au/~cs3421/slides/audio/wk4b.mp3' length='22089622' type='audio/mpeg'/>
<enclosure url='http://www.cse.unsw.edu.au/~cs3421/slides/audio/wk4c.mp3' length='21764110' type='audio/mpeg'/>
<enclosure url='http://www.cse.unsw.edu.au/~cs3421/slides/audio/COMP3421wk4.mp3' length='22878288' type='audio/mpeg'/>
<enclosure url='http://www.cse.unsw.edu.au/~cs3421/slides/audio/COMP3421wk04.mp3' length='28862601' type='audio/mpeg'/>
		</item>
		<item>
		<title>OpenGL Example Programs</title>
		<link>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/18/opengl-example-programs/</link>
		<comments>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/18/opengl-example-programs/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 07:56:18 +0000</pubDate>
		<dc:creator>TimLambert</dc:creator>
		
	<category>lectures</category>
		<guid isPermaLink="false">http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/18/opengl-example-programs/</guid>
		<description><![CDATA[firstAttempt: The famous three dot program from page 46 of Hill.

polyLineDraw: OpenGL and mouse input.

polyTess: OpenGL polygon tesselation.

Toy1: Simplest 3D program - draw the teapot.

Toy2: Calls Starwars to make an X wing fighter.

Toy3: Rotating about x, y and z axes

ToyFinal: Big demo of all the objects list below

StarWars: Use matrix stack to make a Xwing

Function2D: [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cse.unsw.edu.au/~cs3421/jogl/examples/firstAttempt.java">firstAttempt</a>: The famous three dot program from page 46 of Hill.</p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/jogl/examples/polyLineDraw.java">polyLineDraw</a>: OpenGL and mouse input.</p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/jogl/examples/polyTess.java">polyTess</a>: OpenGL polygon tesselation.</p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/jogl/examples/Toy1.java">Toy1</a>: Simplest 3D program - draw the teapot.</p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/jogl/examples/Toy2.java">Toy2</a>: Calls Starwars to make an X wing fighter.</p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/jogl/examples/Toy3.java">Toy3</a>: Rotating about x, y and z axes</p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/jogl/examples/ToyFinal.java">ToyFinal</a>: Big demo of all the objects list below</p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/jogl/examples/StarWars.java">StarWars</a>: Use matrix stack to make a Xwing</p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/jogl/examples/Function2D.java">Function2D</a>: A surface defined by the sinc function.</p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/jogl/examples/BezierPatch.java">BezierPatch</a>: One Bezier patch defined by 16 control points.</p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/jogl/examples/FractalTree.java">FractalTree</a>: A simple fractal tree</p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/jogl/examples/CSELogo.java">CSELogo</a>: The Old CSE logo</p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/jogl/examples/trackball.java">trackball</a>: Uses quaternions to create a virtual trackball.  The code is converted from C code in GLUT, so it&#8217;s ugly.</p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/jogl/examples/Vector3D.java">Vector3D</a>: 3D vector functions like cross product.</p>
]]></content:encoded>
			<wfw:commentRSS>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/18/opengl-example-programs/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>3D Modeling</title>
		<link>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/18/3d-modeling/</link>
		<comments>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/18/3d-modeling/#comments</comments>
		<pubDate>Sun, 17 Aug 2008 17:50:27 +0000</pubDate>
		<dc:creator>TimLambert</dc:creator>
		
	<category>lectures</category>
		<guid isPermaLink="false">http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/18/3d-modeling/</guid>
		<description><![CDATA[Hill (2nd ed 144-178, 233-257, 287-337; 3rd ed 132-160, 214-237, 264-313)

My slides (ODF) Slides in PDF  

Vrml examples

Chapter 3 of the OpenGL programmer&#8217;s guide on Modeling and Viewing.
]]></description>
			<content:encoded><![CDATA[<p>Hill (2nd ed 144-178, 233-257, 287-337; 3rd ed 132-160, 214-237, 264-313)</p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/slides/COMP3421-model.odp">My slides</a> (ODF) <a href="http://www.cse.unsw.edu.au/~cs3421/slides/COMP3421-model.pdf">Slides in PDF  </a></p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/slides/vrml/modelling.html">Vrml examples</a></p>

<p><a href="http://www.cse.unsw.edu.au/~cs3421/opengl-redbook-1.1/chapter03.html">Chapter 3</a> of the OpenGL programmer&#8217;s guide on Modeling and Viewing.</p>
]]></content:encoded>
			<wfw:commentRSS>http://cgi.cse.unsw.edu.au/~cs3421/wordpress/2008/08/18/3d-modeling/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
