Commits

Jason McKesson  committed 18bc807

Images finished for Tuts 00-11.

  • Participants
  • Parent commits 0794d2b

Comments (0)

Files changed (13)

File Documents/Basics/Tutorial 02.xml

                         sizeof(float))]</literal>. And so on.</para>
                 <para>The data flow from the buffer object to the vertex shaders looks like this
                     now:</para>
-                <!--TODO: show two data chunks from the buffer becoming a single set of attribute data. Then show these
-data sets going to vertex shader invocations. Show at least 3 vertex shaders.-->
+                <figure>
+                    <title>Multiple Vertex Attributes</title>
+                    <mediaobject>
+                        <imageobject>
+                            <imagedata fileref="VertexShaderTwoAttributes.svg" format="SVG"/>
+                        </imageobject>
+                    </mediaobject>
+                </figure>
                 <para>As before, every 3 vertices process is transformed into a triangle.</para>
             </section>
         </section>

File Documents/Basics/VertexShaderDataFlow.svg

Old
Old image
New
New image

File Documents/Basics/VertexShaderTwoAttributes.svg

Added
New image

File Documents/Illumination/BarycentricTriangle.svg

Old
Old image
New
New image

File Documents/Illumination/BarycentricTriangleEdge.svg

Old
Old image
New
New image

File Documents/Illumination/GenBarycentricTriangle.lua

 	SvgWriter.Style():stroke("black"):fill("black"));
 	
 styleLib:AddStyle(nil, "label",
-	SvgWriter.Style():stroke("black"):stroke_width("1px"):font_size(textSize .. "px")
+	SvgWriter.Style():stroke("none"):fill("black"):font_size(textSize .. "px")
 		:font_family("monospace"):text_anchor("middle"));
 
 styleLib:AddStyle(nil, "vertex_label",
-	SvgWriter.Style():stroke("black"):stroke_width("1px"):font_size(textSize .. "px")
+	SvgWriter.Style():stroke("none"):fill("black"):font_size(textSize .. "px")
 		:font_family("monospace"):font_weight("bold"):text_anchor("middle"));
 
 local function Output(convertName, barycoords)

File Documents/Positioning/CoordinateEquation.mathml

 <?xml version="1.0" encoding="utf-8"?>
 <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
 	<mrow>
+		<mi>X</mi>
 		<mfenced open="[" close="]" separators=",">
 			<mtable>
 				<mtr>
 				</mtr>
 			</mtable>
 		</mfenced>
-		<mi>X</mi>
 		<mo>+</mo>
+		<mi>Y</mi>
 		<mfenced open="[" close="]" separators=",">
 			<mtable>
 				<mtr>
 				</mtr>
 			</mtable>
 		</mfenced>
-		<mi>Y</mi>
 		<mo>+</mo>
+		<mi>Z</mi>
 		<mfenced open="[" close="]" separators=",">
 			<mtable>
 				<mtr>
 				</mtr>
 			</mtable>
 		</mfenced>
-		<mi>Z</mi>
 		<mo>+</mo>
 		<mfenced open="[" close="]" separators=",">
 			<mtable>

File Documents/Positioning/CoordinateEquation.svg

Old
Old image
New
New image

File Documents/Positioning/GenInterpolateDirection.lua

+require "SvgWriter"
+require "vmath"
+require "Viewport"
+require "SubImage"
+require "_utils"
+
+local subImageSize = 300;
+
+local subImages = SubImage.SubImage(1, 1, subImageSize, subImageSize, 50, 0);
+
+local coordSize = 2;
+
+local vp = Viewport.Viewport(subImages:SubSize(), {0, 0}, coordSize)
+local trans2 = Viewport.Transform2D()
+vp:SetTransform(trans2);
+
+local scaleFactor = 0.25;
+
+-- Styles
+local styleLib = SvgWriter.StyleLibrary();
+local pointSize = 9;
+
+styleLib:AddStyle(nil, "circle", SvgWriter.Style{stroke="black", fill="none"});
+styleLib:AddStyle(nil, "center", SvgWriter.Style{stroke="none", fill="black"});
+
+styleLib:AddStyle(nil, "short_path",
+	SvgWriter.Style{stroke="blue", stroke_width="8px", fill="none", stroke_opacity="0.3"});
+styleLib:AddStyle(nil, "long_path",
+	SvgWriter.Style{stroke="red", stroke_width="8px", fill="none", stroke_opacity="0.3"});
+	
+styleLib:AddStyle(nil, "vector",
+	SvgWriter.Style{stroke="black", stroke_width="2px", fill="none", marker_end=SvgWriter.uriLocalElement("arrow")});
+	
+styleLib:AddStyle(nil, "arrowhead",
+	SvgWriter.Style():stroke("none"):fill("black"));
+	
+styleLib:AddStyle(nil, "label",
+	SvgWriter.Style():stroke("none"):fill("black"):font_size("14pt")
+		:font_family("monospace"):text_anchor("middle"));
+
+--Circle
+local centerPt = vmath.vec2(0, 0);
+local radius = 0.8
+
+--Vectors
+local vectorAngles = {20, 140, 200}
+local vectorEndpts = {}
+
+for i, angle in ipairs(vectorAngles) do
+	local radAngle = math.rad(angle);
+	vectorEndpts[#vectorEndpts + 1] =
+		vmath.vec2(math.cos(radAngle), math.sin(radAngle)) * radius;
+end
+
+--Labels
+local labelLocs = {};
+
+for i, endPt in ipairs(vectorEndpts) do
+	labelLocs[#labelLocs + 1] = (endPt + centerPt) / 2.0;
+end
+
+local labelData =
+{
+	{"q1", vmath.vec2(0, 25)},
+	{"q2", vmath.vec2(17, -7)},
+	{"-q1", vmath.vec2(0, 25)},
+}
+
+--Transform
+centerPt = vp:Transform(centerPt);
+radius = vp:Length(radius);
+vectorEndpts = vp:Transform(vectorEndpts);
+labelLocs = vp:Transform(labelLocs);
+
+--Arcs
+local shortArc = SvgWriter.Path();
+shortArc:M(vectorEndpts[2]):A({radius, radius}, 0, 0, 0, vectorEndpts[3])
+
+local longArc = SvgWriter.Path();
+longArc:M(vectorEndpts[2]):A({radius, radius}, 0, 0, 1, vectorEndpts[1])
+
+local writer = SvgWriter.SvgWriter(ConstructSVGName(arg[0]), {(subImages:Size().x + 1) .."px", (subImages:Size().y + 1) .. "px"});
+	writer:StyleLibrary(styleLib);
+	writer:BeginDefinitions();
+		writer:BeginGroup(nil, "g_point");
+			writer:Circle(vmath.vec2(0, 0), pointRadius, {"vertex"});
+		writer:EndGroup();
+		WriteStandardArrowhead(writer, "arrow", {"arrowhead"})
+	writer:EndDefinitions();
+	
+	writer:Circle(centerPt, radius, {"circle"});
+	
+	for i, endPt in ipairs(vectorEndpts) do
+		writer:Line(centerPt, endPt, {"vector"});
+	end
+	
+	writer:Path(shortArc, {"short_path"});
+	writer:Path(longArc, {"long_path"});
+
+	writer:Circle(centerPt, 8, {"center"});
+	
+	for i, labelPos in ipairs(labelLocs) do
+		writer:Text(labelData[i][1], labelPos + labelData[i][2], {"label"});
+	end
+
+writer:Close();

File Documents/Positioning/InterpolateDirection.svg

Added
New image

File Documents/Positioning/TransformOrder.mathml

             <mtable>
               <mtr>
                 <mtd>
-                  <mn>3</mn>
+                  <mn>2</mn>
                 </mtd>
                 <mtd>
                   <mn>0</mn>
             <mtable>
               <mtr>
                 <mtd>
-                  <mn>3</mn>
+                  <mn>2</mn>
                 </mtd>
                 <mtd>
                   <mn>0</mn>
                   <mn>0</mn>
                 </mtd>
                 <mtd>
-                  <mn>6</mn>
+                  <mn>4</mn>
                 </mtd>
               </mtr>
               <mtr>
             <mtable>
               <mtr>
                 <mtd>
-                  <mn>3</mn>
+                  <mn>2</mn>
                 </mtd>
                 <mtd>
                   <mn>0</mn>

File Documents/Positioning/TransformOrder.svg

Old
Old image
New
New image

File Documents/Positioning/Tutorial 08.xml

                 does not affect its orientation.</para>
             <para>While the two quaternions represent the same orientation, they aren't the same as
                 far as interpolation is concerned. Consider a two-dimensional case:</para>
-            <!--TODO: Picture of a vector q1, a vector q2, and -q1. The angle between -q1 and q2 should be less than 90 degrees.-->
+            <figure>
+                <title>Interpolation Directions</title>
+                <mediaobject>
+                    <imageobject>
+                        <imagedata fileref="InterpolateDirection.svg" format="SVG"/>
+                    </imageobject>
+                </mediaobject>
+            </figure>
             <para>If the angle between the two quaternions is greater than 90°, then the
                 interpolation between them will take the <quote>long path</quote> between the two
                 orientations. Which is what we see in the <keycap>Q</keycap> to <keycap>E</keycap>