Jason McKesson avatar Jason McKesson committed b492caf

Tut13: Images are done.

Comments (0)

Files changed (28)

 framework/*.vcproj
 Test/*.sln
 Test/*.vcproj
+AllTutorials.sln
+glloader/*.sln
+glloader/*.vcproj
+website/*
Add a comment to this file

Documents/Illumination/Bad Impostor Intersection.png

Added
New image
Add a comment to this file

Documents/Illumination/Bad vs Good Impostor.png

Added
New image
Add a comment to this file

Documents/Illumination/Bad vs Good Impostor2.png

Added
New image
Add a comment to this file

Documents/Illumination/Basic Impostor.png

Added
New image
Add a comment to this file

Documents/Illumination/CircleInPerspective.svg

Added
New image
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" height="200px" width="300px" >
+	<style type="text/css" ><![CDATA[.line_standard
+{
+	stroke-width: 1px;
+}
+
+.background
+{
+	stroke: none;
+	fill: #E0E0E0;
+}
+
+.line_of_proj
+{
+	stroke: red;
+	stroke-dasharray: 4,8;
+	stroke-width: 1px;
+}
+
+.fill_none
+{
+	fill: none;
+}
+
+.fill_transluscent
+{
+	fill-opacity: 0.1;
+	fill: blue;
+}
+
+.fill_black
+{
+	fill: black;
+}
+
+.circle_plane
+{
+	stroke-width: 2px;
+	stroke: black;
+}
+
+.object_projected
+{
+	stroke-width: 8px;
+	stroke: #00C000;
+}
+
+.object
+{
+	stroke-width: 1px;
+	stroke: #00C000;
+}
+
+.black
+{
+	stroke: black;
+}
+
+.projected
+{
+	stroke-width: 8px;
+}
+
+.red
+{
+	stroke: red;
+}
+
+.dashed
+{
+	stroke-dasharray: 4,8;
+}]]></style>
+	<defs />
+	<polygon points="112.5,137.5 187.5,137.5 325,2.1316282072803e-014 -25,2.1316282072803e-014" class="background" />
+	<line x2="143.75" y2="137.5" y1="62.5" x1="131.25" class="line_of_proj" />
+	<line x2="118.75" y2="137.5" y1="62.5" x1="56.25" class="line_of_proj" />
+	<line x2="118.75" y2="137.5" y1="137.5" x1="143.75" class="object_projected" />
+	<circle r="37.5" cy="62.5" cx="93.75" class="object fill_none" />
+	<line x2="56.25" y2="62.5" y1="62.5" x1="131.25" class="circle_plane" />
+	<line x2="187.5" y2="137.5" y1="137.5" x1="112.5" class="black line_standard" />
+	<line x2="0" y2="137.5" y1="137.5" x1="112.5" class="black line_standard dashed" />
+	<line x2="212.5" y2="137.5" y1="137.5" x1="187.5" class="black line_standard dashed" />
+	<circle r="3" cy="175" cx="150" class="black fill_black" />
+	<line x2="150" y2="175" y1="137.5" x1="112.5" class="black line_standard dashed" />
+	<line x2="150" y2="175" y1="137.5" x1="187.5" class="black line_standard dashed" />
+</svg>
Add a comment to this file

Documents/Illumination/CirclePythagorean.svg

Added
New image
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" height="250px" width="350px" >
+	<style type="text/css" ><![CDATA[.__axis1
+{
+	stroke: black;
+	stroke-width: 1px;
+	fill: none;
+}
+
+.vector
+{
+	marker-end: url(#arrow);
+	stroke: darkgreen;
+	stroke-width: 2px;
+}
+
+.__axis_arrow_end1
+{
+	marker-end: url(#__axis_arrow1);
+}
+
+.text-hyp
+{
+	font-weight: bold;
+	font-size: 25px;
+	stroke: none;
+	font-family: monospace;
+	fill: darkorange;
+}
+
+.arrowhead
+{
+	stroke: darkgreen;
+	fill: darkgreen;
+}
+
+.circle
+{
+	stroke: black;
+	fill: none;
+}
+
+.text
+{
+	font-weight: bold;
+	font-size: 25px;
+	stroke: none;
+	font-family: monospace;
+	fill: darkgreen;
+}
+
+.arrowhead-hyp
+{
+	stroke: darkorange;
+	fill: darkorange;
+}
+
+.vector-hyp
+{
+	marker-end: url(#arrow-hyp);
+	stroke: darkorange;
+	stroke-width: 2px;
+}]]></style>
+	<defs >
+		<marker markerWidth="10" markerHeight="8" refX="10" refY="4" markerUnits="userSpaceOnUse" orient="auto" id="__axis_arrow1" >
+			<path d="M 10 4 L 0 0 L 0 8 Z" class="fill_black thin" />
+		</marker>
+		<g id="g_axes" >
+			<line x2="175" y2="250" y1="183.33333333333" x1="175" class="__axis1 __axis_arrow_end1" />
+			<line x2="175" y2="0" y1="183.33333333333" x1="175" class="__axis1 __axis_arrow_end1" />
+			<line x2="350" y2="183.33333333333" y1="183.33333333333" x1="175" class="__axis1 __axis_arrow_end1" />
+			<line x2="0" y2="183.33333333333" y1="183.33333333333" x1="175" class="__axis1 __axis_arrow_end1" />
+		</g>
+	</defs>
+	<defs >
+		<marker markerWidth="10" markerHeight="8" refX="10" refY="4" markerUnits="userSpaceOnUse" orient="auto" id="arrow" >
+			<path d="M 10 4 L 0 0 L 0 8 Z" class="arrowhead" />
+		</marker>
+		<marker markerWidth="10" markerHeight="8" refX="10" refY="4" markerUnits="userSpaceOnUse" orient="auto" id="arrow-hyp" >
+			<path d="M 10 4 L 0 0 L 0 8 Z" class="arrowhead-hyp" />
+		</marker>
+	</defs>
+	<use xlink:href="#g_axes" y="0" x="0" height="250" width="350" />
+	<path d="M 320.83333333333 183.33333333333 A 145.83333333333 145.83333333333 0 1 0 29.166666666667 183.33333333333" class="circle" />
+	<line x2="292.98164501301" y2="183.33333333333" y1="183.33333333333" x1="175" class="vector" />
+	<text y="205.33333333333" x="233.99082250651" class="text" >X</text>
+	<line x2="292.98164501301" y2="97.614650707348" y1="183.33333333333" x1="292.98164501301" class="vector-hyp" />
+	<text y="150.47399202034" x="297.98164501301" class="text-hyp" >Y</text>
+	<line x2="292.98164501301" y2="97.614650707348" y1="183.33333333333" x1="175" class="vector" />
+	<text y="125.47399202034" x="228.99082250651" class="text" >R</text>
+</svg>
Add a comment to this file

Documents/Illumination/Depth Correct Impostor.png

Added
New image

Documents/Illumination/GenCircleInPerspective.lua

+require "SvgWriter"
+require "vmath"
+require "Viewport"
+require "SubImage"
+require "GridAxis"
+require "_utils"
+
+local imageWidth = 300;
+local imageHeight = 200;
+local imageSize = vmath.vec2(imageWidth, imageHeight);
+
+local subImages = SubImage.SubImage(1, 1, imageWidth, imageHeight, 100, 0);
+
+local coordSize = 8;
+
+local vp = Viewport.Viewport(subImages:SubSize(), {0, -1}, coordSize)
+local trans2 = Viewport.Transform2D()
+vp:SetTransform(trans2);
+
+local worldExtents = vp:Extents();
+worldExtents[1] = -worldExtents[1];
+
+local function ProjectPoint(tPoint, projection)
+	if(vmath.vtype(tPoint) == "table") then
+		local ret = {}
+		for i, realPoint in ipairs(tPoint) do
+			ret[i] = ProjectPoint(realPoint, projection)
+		end
+		return ret;
+	end
+
+	local lineDir = tPoint - projection.eyeLoc;
+	local offset = (projection.lineLoc.y - projection.eyeLoc.y) / lineDir.y;
+	return (lineDir * offset) + projection.eyeLoc;
+end
+
+
+----------------------------------
+-- Styles
+local styleLib = SvgWriter.StyleLibrary();
+
+styleLib:AddStyle(nil, "black",
+	SvgWriter.Style():stroke("black"));
+	
+styleLib:AddStyle(nil, "red",
+	SvgWriter.Style():stroke("red"));
+	
+styleLib:AddStyle(nil, "line_of_proj",
+	SvgWriter.Style():stroke("red"):stroke_width("1px"):stroke_dasharray({4, 8}));
+	
+styleLib:AddStyle(nil, "object",
+	SvgWriter.Style():stroke("#00C000"):stroke_width("1px"));
+	
+styleLib:AddStyle(nil, "object_projected",
+	SvgWriter.Style():stroke("#00C000"):stroke_width("8px"));
+	
+styleLib:AddStyle(nil, "line_standard",
+	SvgWriter.Style():stroke_width("1px"));
+	
+styleLib:AddStyle(nil, "projected",
+	SvgWriter.Style():stroke_width("8px"));
+	
+styleLib:AddStyle(nil, "dashed",
+	SvgWriter.Style():stroke_dasharray({4, 8}));
+
+styleLib:AddStyle(nil, "circle_plane",
+	SvgWriter.Style():stroke("black"):stroke_width("2px"));
+	
+	
+styleLib:AddStyle(nil, "fill_black",
+	SvgWriter.Style():fill("black"));
+	
+styleLib:AddStyle(nil, "fill_transluscent",
+	SvgWriter.Style():fill("blue"):fill_opacity(0.1));
+
+styleLib:AddStyle(nil, "fill_none",
+	SvgWriter.Style():fill("none"));
+	
+styleLib:AddStyle(nil, "background",
+	SvgWriter.Style():fill("#E0E0E0"):stroke("none"));
+	
+
+----------------------------------
+-- Point setup.
+
+local lineProjection = {}
+lineProjection.lineLoc = vmath.vec2(0.0, worldExtents[1] * 0.5);
+lineProjection.eyeLoc = vmath.vec2(0.0, worldExtents[1] * 0.75);
+lineProjection.lineWidth = 2.0;
+lineProjection.lineEndPts =
+{
+	vmath.vec2(-lineProjection.lineWidth / 2, lineProjection.lineLoc.y),
+	vmath.vec2(lineProjection.lineWidth / 2, lineProjection.lineLoc.y),
+}
+lineProjection.finalEndPts = vp:Transform(lineProjection.lineEndPts)
+lineProjection.finalEyeLoc = vp:Transform(lineProjection.eyeLoc)
+
+local sideProjLines = {}
+sideProjLines[1] = vmath.vec2(lineProjection.lineEndPts[1])
+sideProjLines[1].x = worldExtents[1];
+sideProjLines[2] = vmath.vec2(lineProjection.lineEndPts[2])
+sideProjLines[2].x = worldExtents[2];
+
+sideProjLines = vp:Transform(sideProjLines);
+
+local projectFrustum =
+{
+	vmath.vec2(lineProjection.lineEndPts[1]),
+	vmath.vec2(lineProjection.lineEndPts[2]),
+}
+
+do
+	local lineDir = lineProjection.lineEndPts[2] - lineProjection.eyeLoc;
+	local offset = (worldExtents[2] - lineProjection.eyeLoc.y) / lineDir.y;
+	projectFrustum[3] = (lineDir * offset) + lineProjection.eyeLoc;
+	lineDir = lineProjection.eyeLoc - lineProjection.lineEndPts[1];
+	offset = (worldExtents[2] - lineProjection.eyeLoc.y) / lineDir.y;
+	projectFrustum[4] = (lineDir * offset) + lineProjection.eyeLoc;
+end
+
+projectFrustum = vp:Transform(projectFrustum);
+
+
+local rectShape =
+{
+	vmath.vec2(0.8, 0.0),
+	vmath.vec2(0.5, 0.0),
+	vmath.vec2(0.5, 1.5),
+	vmath.vec2(0.8, 1.5),
+}
+
+local rectProj = ProjectPoint(rectShape, lineProjection)
+
+rectShape = vp:Transform(rectShape);
+rectProj = vp:Transform(rectProj);
+
+local rectProjOffset = {}
+for i, tPoint in ipairs(rectProj) do
+	rectProjOffset[i] = tPoint + vmath.vec2(0, -1);
+end
+
+local lineShape =
+{
+	vmath.vec2(-3.3, -1.5),
+	vmath.vec2(-0.5, 3.0),
+}
+
+local lineProj = ProjectPoint(lineShape, lineProjection)
+
+lineShape = vp:Transform(lineShape);
+lineProj = vp:Transform(lineProj);
+
+--Circle Location
+local circleCenter = vmath.vec2(-1.5, 0);
+local circleRadius = 1.0;
+
+local circleSizePlane =
+{
+	circleCenter + vmath.vec2(circleRadius, 0),
+	circleCenter - vmath.vec2(circleRadius, 0),
+}
+
+circleCenter = vp:Transform(circleCenter);
+circleRadius = vp:Length(circleRadius);
+
+local lineProj = ProjectPoint(circleSizePlane, lineProjection)
+
+circleSizePlane = vp:Transform(circleSizePlane);
+lineProj = vp:Transform(lineProj);
+
+
+----------------------------------------
+-- The SVG itself
+local writer = SvgWriter.SvgWriter(ConstructSVGName(arg[0]), {imageWidth .."px", imageHeight .. "px"});
+	writer:StyleLibrary(styleLib);
+	writer:BeginDefinitions();
+	writer:EndDefinitions();
+	
+	--Background
+	writer:Polygon(projectFrustum, {"background"})
+	
+	--Projection
+	writer:Line(circleSizePlane[1], lineProj[1], {"line_of_proj"});
+	writer:Line(circleSizePlane[2], lineProj[2], {"line_of_proj"});
+	writer:Line(lineProj[1], lineProj[2], {"object_projected"});
+
+	--Draw circle.
+	writer:Circle(circleCenter, circleRadius, {"object", "fill_none"});
+	writer:Line(circleSizePlane[1], circleSizePlane[2], {"circle_plane"});
+	
+	--Draw the projection plane.
+	writer:Line(lineProjection.finalEndPts[1], lineProjection.finalEndPts[2],
+		{"black", "line_standard"});
+	writer:Line(lineProjection.finalEndPts[1], sideProjLines[1],
+		{"black", "line_standard", "dashed"});
+	writer:Line(lineProjection.finalEndPts[2], sideProjLines[2],
+		{"black", "line_standard", "dashed"});
+	
+	writer:Circle(lineProjection.finalEyeLoc, imageWidth / 100,
+		{"black", "fill_black"})
+	writer:Line(lineProjection.finalEndPts[1], lineProjection.finalEyeLoc,
+		{"black", "line_standard", "dashed"});
+	writer:Line(lineProjection.finalEndPts[2], lineProjection.finalEyeLoc,
+		{"black", "line_standard", "dashed"});
+writer:Close();

Documents/Illumination/GenCirclePythagorean.lua

+require "SvgWriter"
+require "vmath"
+require "Viewport"
+require "SubImage"
+require "GridAxis"
+require "_utils"
+
+local subImages = SubImage.SubImage(1, 1, 350, 250, 100, 0);
+
+local coordSize = 12;
+
+local vp = Viewport.Viewport(subImages:SubSize(), {0, 2}, coordSize)
+local trans2 = Viewport.Transform2D()
+vp:SetTransform(trans2);
+
+local styleLib = SvgWriter.StyleLibrary();
+
+local vectorColor = "darkgreen";
+local vectorFindColor = "darkorange";
+local circleColor = "black";
+local pointSize = 15;
+
+styleLib:AddStyle(nil, "vector", SvgWriter.Style{
+	stroke=vectorColor, stroke_width="2px", marker_end=SvgWriter.uriLocalElement("arrow")});
+styleLib:AddStyle(nil, "arrowhead", SvgWriter.Style{
+	stroke=vectorColor, fill=vectorColor});
+styleLib:AddStyle(nil, "text", SvgWriter.Style{
+	stroke="none", fill=vectorColor, font_weight="bold",
+	font_size="25px", font_family="monospace"});
+	
+styleLib:AddStyle(nil, "vector-hyp", SvgWriter.Style{
+	stroke=vectorFindColor, stroke_width="2px", marker_end=SvgWriter.uriLocalElement("arrow-hyp")});
+styleLib:AddStyle(nil, "arrowhead-hyp", SvgWriter.Style{
+	stroke=vectorFindColor, fill=vectorFindColor});
+styleLib:AddStyle(nil, "text-hyp", SvgWriter.Style{
+	stroke="none", fill=vectorFindColor, font_weight="bold",
+	font_size="25px", font_family="monospace"});
+	
+styleLib:AddStyle(nil, "circle", SvgWriter.Style{
+	stroke=circleColor, fill="none"});
+
+	
+local axisData = GridAxis.GridAxis2D(vp, 
+	SvgWriter.Style{stroke="black", fill="none", stroke_width="1px"},
+	styleLib, false, nil);
+
+--Compute circle.	
+local circleRadius = (coordSize / 2) - 1;
+local vpRadius = vp:Length(circleRadius);
+
+local circlePts =
+{
+	vmath.vec2(circleRadius, 0),
+	vmath.vec2(-circleRadius, 0),
+}
+
+circlePts = vp:Transform(circlePts);
+
+local circlePath = SvgWriter.Path();
+circlePath:M(circlePts[1]):A({vpRadius, vpRadius}, 0, 1, 0, circlePts[2]);
+
+--Compute vectors
+local angle = math.pi * 0.20;
+local circlePos = vmath.vec2(math.cos(angle), math.sin(angle)) * circleRadius;
+
+local vectors =
+{
+	vmath.vec2(0, 0),
+	vmath.vec2(circlePos.x, 0),
+
+	vmath.vec2(circlePos.x, 0),
+	vmath.vec2(circlePos),
+
+	vmath.vec2(0, 0),
+	vmath.vec2(circlePos),
+};
+
+local vectorLabels = 
+{
+	"X", vmath.vec2(0, 22),
+	"Y", vmath.vec2(5, 10),
+	"R", vmath.vec2(-5, -15),
+}
+
+local styles =
+{
+	{{"vector"}, {"text"}}, 
+	{{"vector-hyp"}, {"text-hyp"}}, 
+	{{"vector"}, {"text"}}, 
+};
+
+vectors = vp:Transform(vectors);
+
+local writer = SvgWriter.SvgWriter(ConstructSVGName(arg[0]), {subImages:Size().x .."px", subImages:Size().y .. "px"});
+	writer:StyleLibrary(styleLib);
+	axisData:AddDefinitions(writer, "g_axes");
+	writer:BeginDefinitions();
+		WriteStandardArrowhead(writer, "arrow", {"arrowhead"});
+		WriteStandardArrowhead(writer, "arrow-hyp", {"arrowhead-hyp"});
+	writer:EndDefinitions();
+
+	writer:Use("g_axes", subImages:Offset(1, 1), subImages:SubSize());
+	
+	writer:Path(circlePath, {"circle"});
+
+	for i=1, #vectors, 2 do
+		writer:Line(vectors[i], vectors[i + 1], styles[(i+1)/2][1]);
+		writer:Text(vectorLabels[i],
+			((vectors[i] + vectors[i + 1]) / 2) + vectorLabels[i + 1], styles[(i+1)/2][2]);
+	end
+writer:Close();
Add a comment to this file

Documents/Illumination/Impostor No Perspective.png

Added
New image

Documents/Illumination/PythagoreanTheorem.mathml

+<?xml version="1.0" encoding="UTF-8"?>
+<math xmlns="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <mrow>
+        <mtable>
+            <mtr>
+                <mtd>
+                    <msup>
+                        <mi>X</mi>
+                        <mn>2</mn>
+                    </msup>
+                    <mo>+</mo>
+                    <msup>
+                        <mi>Y</mi>
+                        <mn>2</mn>
+                    </msup>
+                </mtd>
+                <mtd>
+                    <mo>=</mo>
+                </mtd>
+                <mtd>
+                    <msup>
+                        <mi>R</mi>
+                        <mn>2</mn>
+                    </msup>
+                </mtd>
+            </mtr>
+            <mtr>
+                <mtd>
+                    <mi>Y</mi>
+                </mtd>
+                <mtd>
+                    <mo>=</mo>
+                </mtd>
+                <mtd>
+                    <mo>&#xb1;</mo>
+                    <msqrt>
+                        <msup>
+                            <mi>R</mi>
+                            <mn>2</mn>
+                        </msup>
+                        <mo>-</mo>
+                        <msup>
+                            <mi>X</mi>
+                            <mn>2</mn>
+                        </msup>
+                    </msqrt>
+                </mtd>
+            </mtr>
+        </mtable>
+    </mrow>
+</math>
Add a comment to this file

Documents/Illumination/PythagoreanTheorem.svg

Added
New image
+<?xml version="1.0" encoding="utf-8"?>
+<svg:svg xmlns="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg" height="29.230195pt" width="118.595722pt" xmlns:svgmath="http://www.grigoriev.ru/svgmath" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 -18.599473 118.595722 29.230195"><svg:metadata><svgmath:metrics top="29.2301953125" axis="14.6150976563" baseline="10.6307226563" bottom="0.0"/></svg:metadata><svg:g transform="translate(0.000000, -3.984375)"><svg:g transform="translate(0.000000, -3.490254)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.467773" font-family="Times New Roman" font-style="italic" fill="black">X</svg:text><svg:g transform="translate(9.691406, -5.367188)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.130000" font-family="Times New Roman" fill="black">2</svg:text></svg:g><svg:g transform="translate(16.618070, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">+</svg:text></svg:g><svg:g transform="translate(26.052312, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.336914" font-family="Times New Roman" font-style="italic" fill="black">Y</svg:text><svg:g transform="translate(8.003906, -5.367188)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.130000" font-family="Times New Roman" fill="black">2</svg:text></svg:g></svg:g></svg:g><svg:g transform="translate(47.916219, -7.474629)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(85.507025, -3.490254)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.940430" font-family="Times New Roman" font-style="italic" fill="black">R</svg:text><svg:g transform="translate(7.605469, -5.367188)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.130000" font-family="Times New Roman" fill="black">2</svg:text></svg:g></svg:g><svg:g transform="translate(15.156156, 14.135098)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.336914" font-family="Times New Roman" font-style="italic" fill="black">Y</svg:text></svg:g><svg:g transform="translate(47.916219, 10.150723)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(64.283797, 14.135098)"><svg:g transform="translate(0.000000, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.292969" font-family="Times New Roman" fill="black">±</svg:text></svg:g><svg:g transform="translate(7.732605, 0.000000)"><svg:g transform="translate(8.008219, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.940430" font-family="Times New Roman" font-style="italic" fill="black">R</svg:text><svg:g transform="translate(7.605469, -5.367188)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.130000" font-family="Times New Roman" fill="black">2</svg:text></svg:g><svg:g transform="translate(14.532133, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">−</svg:text></svg:g><svg:g transform="translate(23.966375, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.467773" font-family="Times New Roman" font-style="italic" fill="black">X</svg:text><svg:g transform="translate(9.691406, -5.367188)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.130000" font-family="Times New Roman" fill="black">2</svg:text></svg:g></svg:g></svg:g><svg:path stroke-linejoin="miter" d="M -0.000000 -5.423012 L 1.950980 -6.129082 L 4.517455 -0.782258 L 4.405271 -0.323976 L 1.826180 -5.697082 L 1.586180 -5.697082 L 4.412939 0.000000 L 7.354898 -12.018164 L 46.579320 -12.018164" stroke="black" stroke-linecap="butt" stroke-miterlimit="10" stroke-width="0.480000" fill="none"/></svg:g></svg:g></svg:g></svg:svg>

Documents/Illumination/RayEquation.mathml

+<?xml version="1.0" encoding="utf-8"?>
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+	<mtable>
+		<mtr>
+			<mtd>
+				<mover accent="true">
+					<mi>D</mi>
+					<mo>&#x5e;</mo>
+				</mover>
+				<mo>=</mo>
+				<mtext>Ray Direction</mtext>
+			</mtd>
+		</mtr>
+		<mtr>
+			<mtd>
+				<mover accent="true">
+					<mi>O</mi>
+					<mo>&#x21C0;</mo>
+				</mover>
+				<mo>=</mo>
+				<mtext>Ray Origin</mtext>
+			</mtd>
+		</mtr>
+		<mtr>
+			<mtd>
+				<mover accent="true">
+					<mi>P</mi>
+					<mo>&#x21C0;</mo>
+				</mover>
+				<mfenced open="(" close=")" separators=",">
+					<mrow>
+						<mi>t</mi>
+					</mrow>
+				</mfenced>
+				<mo>=</mo>
+				<mover accent="true">
+					<mi>D</mi>
+					<mo>&#x5e;</mo>
+				</mover>
+				<mi>t</mi>
+				<mo>+</mo>
+				<mover accent="true">
+					<mi>O</mi>
+					<mo>&#x21C0;</mo>
+				</mover>
+			</mtd>
+		</mtr>
+	</mtable>
+</math>
Add a comment to this file

Documents/Illumination/RayEquation.svg

Added
New image
+<?xml version="1.0" encoding="utf-8"?>
+<svg:svg xmlns="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg" height="56.531250pt" width="92.104176pt" xmlns:svgmath="http://www.grigoriev.ru/svgmath" viewBox="0 -32.250000 92.104176 56.531250"><svg:metadata><svgmath:metrics top="56.53125" axis="28.265625" baseline="24.28125" bottom="0.0"/></svg:metadata><svg:g transform="translate(0.000000, -3.984375)"><svg:g transform="translate(0.000000, -14.812500)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.690430" font-family="Times New Roman" font-style="italic" fill="black">D</svg:text><svg:g transform="translate(1.696289, -9.328125)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="2.815430" font-family="Times New Roman" fill="black">^</svg:text></svg:g><svg:g transform="translate(12.356773, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(24.457692, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="33.823242" font-family="Times New Roman" fill="black">Ray Direction</svg:text></svg:g></svg:g><svg:g transform="translate(5.868164, 4.312500)"><svg:g transform="translate(1.303711, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.333008" font-family="Times New Roman" font-style="italic" fill="black">O</svg:text></svg:g><svg:g transform="translate(0.000000, -9.720703)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g><svg:g transform="translate(14.606773, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(26.707692, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="26.830078" font-family="Times New Roman" fill="black">Ray Origin</svg:text></svg:g></svg:g><svg:g transform="translate(9.923182, 25.722656)"><svg:g transform="translate(1.766602, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.952148" font-family="Times New Roman" font-style="italic" fill="black">P</svg:text></svg:g><svg:g transform="translate(0.000000, -9.539063)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g><svg:g transform="translate(11.273438, 0.000000)"><svg:g transform="translate(0.000000, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.960938" x="1.998047" font-family="Times New Roman" fill="black">(</svg:text></svg:g><svg:g transform="translate(3.996094, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="1.666992" font-family="Times New Roman" font-style="italic" fill="black">t</svg:text></svg:g><svg:g transform="translate(7.576172, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.960938" x="1.998047" font-family="Times New Roman" fill="black">)</svg:text></svg:g></svg:g><svg:g transform="translate(26.179039, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(36.279953, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.690430" font-family="Times New Roman" font-style="italic" fill="black">D</svg:text><svg:g transform="translate(1.696289, -9.328125)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="2.815430" font-family="Times New Roman" fill="black">^</svg:text></svg:g></svg:g><svg:g transform="translate(45.303391, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="1.666992" font-family="Times New Roman" font-style="italic" fill="black">t</svg:text></svg:g><svg:g transform="translate(51.550133, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">+</svg:text></svg:g><svg:g transform="translate(60.984375, 0.000000)"><svg:g transform="translate(1.303711, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.333008" font-family="Times New Roman" font-style="italic" fill="black">O</svg:text></svg:g><svg:g transform="translate(0.000000, -9.720703)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g></svg:g></svg:g></svg:g></svg:svg>

Documents/Illumination/RayTraceDeriv_1.mathml

+<?xml version="1.0" encoding="utf-8"?>
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+	<mrow>
+		<mfenced open="&#x2225;" close="&#x2225;">
+			<mrow>
+				<mover accent="true">
+					<mi>D</mi>
+					<mo>&#x5e;</mo>
+				</mover>
+				<mi>t</mi>
+				<mo>+</mo>
+				<mover accent="true">
+					<mi>O</mi>
+					<mo>&#x21C0;</mo>
+				</mover>
+				<mo>-</mo>
+				<mover accent="true">
+					<mi>S</mi>
+					<mo>&#x21C0;</mo>
+				</mover>
+			</mrow>
+		</mfenced>
+		<mo>=</mo>
+		<mi>R</mi>
+	</mrow>
+</math>
Add a comment to this file

Documents/Illumination/RayTraceDeriv_1.svg

Added
New image
+<?xml version="1.0" encoding="utf-8"?>
+<svg:svg xmlns="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg" height="16.042969pt" width="104.266930pt" xmlns:svgmath="http://www.grigoriev.ru/svgmath" viewBox="0 -13.453125 104.266930 16.042969"><svg:metadata><svgmath:metrics top="16.04296875" axis="6.57421875" baseline="2.58984375" bottom="1.37109375"/></svg:metadata><svg:g transform="translate(0.000000, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="3.468750" font-family="Lucida Sans Unicode" fill="black">∥</svg:text></svg:g><svg:g transform="translate(10.270836, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.690430" font-family="Times New Roman" font-style="italic" fill="black">D</svg:text><svg:g transform="translate(1.696289, -9.328125)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="2.815430" font-family="Times New Roman" fill="black">^</svg:text></svg:g><svg:g transform="translate(9.023438, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="1.666992" font-family="Times New Roman" font-style="italic" fill="black">t</svg:text></svg:g><svg:g transform="translate(15.270180, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">+</svg:text></svg:g><svg:g transform="translate(24.704422, 0.000000)"><svg:g transform="translate(1.303711, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.333008" font-family="Times New Roman" font-style="italic" fill="black">O</svg:text></svg:g><svg:g transform="translate(0.000000, -9.720703)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g></svg:g><svg:g transform="translate(38.644523, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">−</svg:text></svg:g><svg:g transform="translate(48.078765, 0.000000)"><svg:g transform="translate(2.384766, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.000000" font-family="Times New Roman" font-style="italic" fill="black">S</svg:text></svg:g><svg:g transform="translate(0.000000, -9.720703)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g></svg:g></svg:g><svg:g transform="translate(72.956375, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="3.468750" font-family="Lucida Sans Unicode" fill="black">∥</svg:text></svg:g><svg:g transform="translate(86.560547, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(96.661461, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.940430" font-family="Times New Roman" font-style="italic" fill="black">R</svg:text></svg:g></svg:svg>

Documents/Illumination/RayTraceDeriv_2.mathml

+<?xml version="1.0" encoding="utf-8"?>
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+	<mtable>
+		<mtr>
+			<mtd>
+				<msup>
+					<mfenced open="&#x2225;" close="&#x2225;">
+						<mrow>
+							<mover accent="true">
+								<mi>P</mi>
+								<mo>&#x21C0;</mo>
+							</mover>
+							<mo>-</mo>
+							<mover accent="true">
+								<mi>S</mi>
+								<mo>&#x21C0;</mo>
+							</mover>
+						</mrow>
+					</mfenced>
+					<mn>2</mn>
+				</msup>
+				<mo>=</mo>
+				<msup>
+					<mi>R</mi>
+					<mn>2</mn>
+				</msup>
+			</mtd>
+		</mtr>
+		<mtr>
+			<mtd>
+				<msup>
+					<mfenced open="&#x2225;" close="&#x2225;">
+						<mrow>
+							<mover accent="true">
+								<mi>D</mi>
+								<mo>&#x5e;</mo>
+							</mover>
+							<mi>t</mi>
+							<mo>-</mo>
+							<mover accent="true">
+								<mi>S</mi>
+								<mo>&#x21C0;</mo>
+							</mover>
+						</mrow>
+					</mfenced>
+					<mn>2</mn>
+				</msup>
+				<mo>=</mo>
+				<msup>
+					<mi>R</mi>
+					<mn>2</mn>
+				</msup>
+			</mtd>
+		</mtr>
+	</mtable>
+</math>
Add a comment to this file

Documents/Illumination/RayTraceDeriv_2.svg

Added
New image
+<?xml version="1.0" encoding="utf-8"?>
+<svg:svg xmlns="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg" height="35.109375pt" width="86.079250pt" xmlns:svgmath="http://www.grigoriev.ru/svgmath" viewBox="0 -21.539063 86.079250 35.109375"><svg:metadata><svgmath:metrics top="35.109375" axis="17.5546875" baseline="13.5703125" bottom="0.0"/></svg:metadata><svg:g transform="translate(0.000000, -3.984375)"><svg:g transform="translate(0.665039, -5.044922)"><svg:g transform="translate(0.000000, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="3.468750" font-family="Lucida Sans Unicode" fill="black">∥</svg:text></svg:g><svg:g transform="translate(10.270836, 0.000000)"><svg:g transform="translate(1.766602, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.952148" font-family="Times New Roman" font-style="italic" fill="black">P</svg:text></svg:g><svg:g transform="translate(0.000000, -9.539063)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g><svg:g transform="translate(13.940102, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">−</svg:text></svg:g><svg:g transform="translate(23.374344, 0.000000)"><svg:g transform="translate(2.384766, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.000000" font-family="Times New Roman" font-style="italic" fill="black">S</svg:text></svg:g><svg:g transform="translate(0.000000, -9.720703)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g></svg:g></svg:g><svg:g transform="translate(48.251953, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="3.468750" font-family="Lucida Sans Unicode" fill="black">∥</svg:text></svg:g><svg:g transform="translate(55.189453, -6.752109)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.130000" font-family="Times New Roman" fill="black">2</svg:text></svg:g><svg:g transform="translate(62.782789, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(72.883703, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.940430" font-family="Times New Roman" font-style="italic" fill="black">R</svg:text><svg:g transform="translate(7.605469, -5.367188)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.130000" font-family="Times New Roman" fill="black">2</svg:text></svg:g></svg:g></svg:g><svg:g transform="translate(0.000000, 16.335938)"><svg:g transform="translate(0.000000, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="3.468750" font-family="Lucida Sans Unicode" fill="black">∥</svg:text></svg:g><svg:g transform="translate(10.270836, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.690430" font-family="Times New Roman" font-style="italic" fill="black">D</svg:text><svg:g transform="translate(1.696289, -9.328125)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="2.815430" font-family="Times New Roman" fill="black">^</svg:text></svg:g><svg:g transform="translate(9.023438, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="1.666992" font-family="Times New Roman" font-style="italic" fill="black">t</svg:text></svg:g><svg:g transform="translate(15.270180, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">−</svg:text></svg:g><svg:g transform="translate(24.704422, 0.000000)"><svg:g transform="translate(2.384766, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.000000" font-family="Times New Roman" font-style="italic" fill="black">S</svg:text></svg:g><svg:g transform="translate(0.000000, -9.720703)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g></svg:g></svg:g><svg:g transform="translate(49.582031, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="3.468750" font-family="Lucida Sans Unicode" fill="black">∥</svg:text></svg:g><svg:g transform="translate(56.519531, -9.037266)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.130000" font-family="Times New Roman" fill="black">2</svg:text></svg:g><svg:g transform="translate(64.112867, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(74.213781, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.940430" font-family="Times New Roman" font-style="italic" fill="black">R</svg:text><svg:g transform="translate(7.605469, -5.367188)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.130000" font-family="Times New Roman" fill="black">2</svg:text></svg:g></svg:g></svg:g></svg:g></svg:svg>

Documents/Illumination/RayTraceDeriv_3.mathml

+<?xml version="1.0" encoding="utf-8"?>
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+	<mrow>
+		<mfenced open="(" close=")">
+			<mrow>
+				<mover accent="true">
+					<mi>D</mi>
+					<mo>&#x5e;</mo>
+				</mover>
+				<mi>t</mi>
+				<mo>-</mo>
+				<mover accent="true">
+					<mi>S</mi>
+					<mo>&#x21C0;</mo>
+				</mover>
+			</mrow>
+		</mfenced>
+		<mo>&#xb7;</mo>
+		<mfenced open="(" close=")">
+			<mrow>
+				<mover accent="true">
+					<mi>D</mi>
+					<mo>&#x5e;</mo>
+				</mover>
+				<mi>t</mi>
+				<mo>-</mo>
+				<mover accent="true">
+					<mi>S</mi>
+					<mo>&#x21C0;</mo>
+				</mover>
+			</mrow>
+		</mfenced>
+		<mo>=</mo>
+		<msup>
+			<mi>R</mi>
+			<mn>2</mn>
+		</msup>
+	</mrow>
+</math>
Add a comment to this file

Documents/Illumination/RayTraceDeriv_3.svg

Added
New image
+<?xml version="1.0" encoding="utf-8"?>
+<svg:svg xmlns="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg" height="16.071907pt" width="121.235914pt" xmlns:svgmath="http://www.grigoriev.ru/svgmath" viewBox="0 -13.482063 121.235914 16.071907"><svg:metadata><svgmath:metrics top="16.0719068878" axis="6.57421875" baseline="2.58984375" bottom="0.0578762755102"/></svg:metadata><svg:g transform="translate(0.000000, -3.984375)"><svg:text font-size="17.632653" transform="scale(0.680556, 1)" text-anchor="middle" y="2.745297" x="2.935906" font-family="Times New Roman" fill="black">(</svg:text></svg:g><svg:g transform="translate(3.996094, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.690430" font-family="Times New Roman" font-style="italic" fill="black">D</svg:text><svg:g transform="translate(1.696289, -9.328125)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="2.815430" font-family="Times New Roman" fill="black">^</svg:text></svg:g><svg:g transform="translate(9.023438, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="1.666992" font-family="Times New Roman" font-style="italic" fill="black">t</svg:text></svg:g><svg:g transform="translate(15.270180, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">−</svg:text></svg:g><svg:g transform="translate(24.704422, 0.000000)"><svg:g transform="translate(2.384766, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.000000" font-family="Times New Roman" font-style="italic" fill="black">S</svg:text></svg:g><svg:g transform="translate(0.000000, -9.720703)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g></svg:g></svg:g><svg:g transform="translate(39.973953, -3.984375)"><svg:text font-size="17.632653" transform="scale(0.680556, 1)" text-anchor="middle" y="2.745297" x="2.935906" font-family="Times New Roman" fill="black">)</svg:text></svg:g><svg:g transform="translate(45.970051, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="1.998047" font-family="Times New Roman" fill="black">·</svg:text></svg:g><svg:g transform="translate(51.966149, 0.000000)"><svg:g transform="translate(0.000000, -3.984375)"><svg:text font-size="17.632653" transform="scale(0.680556, 1)" text-anchor="middle" y="2.745297" x="2.935906" font-family="Times New Roman" fill="black">(</svg:text></svg:g><svg:g transform="translate(3.996094, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.690430" font-family="Times New Roman" font-style="italic" fill="black">D</svg:text><svg:g transform="translate(1.696289, -9.328125)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="2.815430" font-family="Times New Roman" fill="black">^</svg:text></svg:g><svg:g transform="translate(9.023438, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="1.666992" font-family="Times New Roman" font-style="italic" fill="black">t</svg:text></svg:g><svg:g transform="translate(15.270180, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">−</svg:text></svg:g><svg:g transform="translate(24.704422, 0.000000)"><svg:g transform="translate(2.384766, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.000000" font-family="Times New Roman" font-style="italic" fill="black">S</svg:text></svg:g><svg:g transform="translate(0.000000, -9.720703)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g></svg:g></svg:g><svg:g transform="translate(39.973953, -3.984375)"><svg:text font-size="17.632653" transform="scale(0.680556, 1)" text-anchor="middle" y="2.745297" x="2.935906" font-family="Times New Roman" fill="black">)</svg:text></svg:g></svg:g><svg:g transform="translate(99.269531, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(109.370445, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.940430" font-family="Times New Roman" font-style="italic" fill="black">R</svg:text><svg:g transform="translate(7.605469, -5.367188)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.130000" font-family="Times New Roman" fill="black">2</svg:text></svg:g></svg:g></svg:svg>

Documents/Illumination/RayTraceDeriv_4.mathml

+<?xml version="1.0" encoding="utf-8"?>
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+	<mrow>
+		<mfenced open="(" close=")">
+			<mrow>
+				<mover accent="true">
+					<mi>D</mi>
+					<mo>&#x5e;</mo>
+				</mover>
+				<mo>&#xb7;</mo>
+				<mover accent="true">
+					<mi>D</mi>
+					<mo>&#x5e;</mo>
+				</mover>
+			</mrow>
+		</mfenced>
+		<msup>
+			<mi>t</mi>
+			<mn>2</mn>
+		</msup>
+		<mo>-</mo>
+		<mn>2</mn>
+		<mfenced open="(" close=")">
+			<mrow>
+				<mover accent="true">
+					<mi>D</mi>
+					<mo>&#x5e;</mo>
+				</mover>
+				<mo>&#xb7;</mo>
+				<mover accent="true">
+					<mi>S</mi>
+					<mo>&#x21C0;</mo>
+				</mover>
+			</mrow>
+		</mfenced>
+		<mi>t</mi>
+		<mo>+</mo>
+		<mfenced open="(" close=")">
+			<mrow>
+				<mover accent="true">
+					<mi>S</mi>
+					<mo>&#x21C0;</mo>
+				</mover>
+				<mo>&#xb7;</mo>
+				<mover accent="true">
+					<mi>S</mi>
+					<mo>&#x21C0;</mo>
+				</mover>
+			</mrow>
+		</mfenced>
+		<mo>=</mo>
+		<msup>
+			<mi>R</mi>
+			<mn>2</mn>
+		</msup>
+	</mrow>
+</math>
Add a comment to this file

Documents/Illumination/RayTraceDeriv_4.svg

Added
New image
+<?xml version="1.0" encoding="utf-8"?>
+<svg:svg xmlns="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg" height="16.071907pt" width="175.777180pt" xmlns:svgmath="http://www.grigoriev.ru/svgmath" viewBox="0 -13.482063 175.777180 16.071907"><svg:metadata><svgmath:metrics top="16.0719068878" axis="6.57421875" baseline="2.58984375" bottom="0.0529672395274"/></svg:metadata><svg:g transform="translate(0.000000, -3.984375)"><svg:text font-size="17.632653" transform="scale(0.680556, 1)" text-anchor="middle" y="2.745297" x="2.935906" font-family="Times New Roman" fill="black">(</svg:text></svg:g><svg:g transform="translate(3.996094, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.690430" font-family="Times New Roman" font-style="italic" fill="black">D</svg:text><svg:g transform="translate(1.696289, -9.328125)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="2.815430" font-family="Times New Roman" fill="black">^</svg:text></svg:g><svg:g transform="translate(11.023442, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="1.998047" font-family="Times New Roman" fill="black">·</svg:text></svg:g><svg:g transform="translate(17.019539, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.690430" font-family="Times New Roman" font-style="italic" fill="black">D</svg:text><svg:g transform="translate(1.696289, -9.328125)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="2.815430" font-family="Times New Roman" fill="black">^</svg:text></svg:g></svg:g></svg:g><svg:g transform="translate(30.039071, -3.984375)"><svg:text font-size="17.632653" transform="scale(0.680556, 1)" text-anchor="middle" y="2.745297" x="2.935906" font-family="Times New Roman" fill="black">)</svg:text></svg:g><svg:g transform="translate(34.035164, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="1.666992" font-family="Times New Roman" font-style="italic" fill="black">t</svg:text><svg:g transform="translate(3.580078, -5.367188)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.130000" font-family="Times New Roman" fill="black">2</svg:text></svg:g></svg:g><svg:g transform="translate(44.541906, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">−</svg:text></svg:g><svg:g transform="translate(53.976148, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.000000" font-family="Times New Roman" fill="black">2</svg:text></svg:g><svg:g transform="translate(59.976148, 0.000000)"><svg:g transform="translate(0.000000, -3.984375)"><svg:text font-size="17.632653" transform="scale(0.680556, 1)" text-anchor="middle" y="2.745297" x="2.935906" font-family="Times New Roman" fill="black">(</svg:text></svg:g><svg:g transform="translate(3.996094, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.690430" font-family="Times New Roman" font-style="italic" fill="black">D</svg:text><svg:g transform="translate(1.696289, -9.328125)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="2.815430" font-family="Times New Roman" fill="black">^</svg:text></svg:g><svg:g transform="translate(11.023442, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="1.998047" font-family="Times New Roman" fill="black">·</svg:text></svg:g><svg:g transform="translate(17.019539, 0.000000)"><svg:g transform="translate(2.384766, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.000000" font-family="Times New Roman" font-style="italic" fill="black">S</svg:text></svg:g><svg:g transform="translate(0.000000, -9.720703)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g></svg:g></svg:g><svg:g transform="translate(32.289071, -3.984375)"><svg:text font-size="17.632653" transform="scale(0.680556, 1)" text-anchor="middle" y="2.745297" x="2.935906" font-family="Times New Roman" fill="black">)</svg:text></svg:g></svg:g><svg:g transform="translate(96.261313, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="1.666992" font-family="Times New Roman" font-style="italic" fill="black">t</svg:text></svg:g><svg:g transform="translate(102.508055, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">+</svg:text></svg:g><svg:g transform="translate(111.942297, 0.000000)"><svg:g transform="translate(0.000000, -3.984375)"><svg:text font-size="15.119227" transform="scale(0.793691, 1)" text-anchor="middle" y="3.287745" x="2.517410" font-family="Times New Roman" fill="black">(</svg:text></svg:g><svg:g transform="translate(3.996094, 0.000000)"><svg:g transform="translate(2.384766, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.000000" font-family="Times New Roman" font-style="italic" fill="black">S</svg:text></svg:g><svg:g transform="translate(0.000000, -9.720703)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g><svg:g transform="translate(13.273442, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="1.998047" font-family="Times New Roman" fill="black">·</svg:text></svg:g><svg:g transform="translate(19.269539, 0.000000)"><svg:g transform="translate(2.384766, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.000000" font-family="Times New Roman" font-style="italic" fill="black">S</svg:text></svg:g><svg:g transform="translate(0.000000, -9.720703)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g></svg:g></svg:g><svg:g transform="translate(34.539071, -3.984375)"><svg:text font-size="15.119227" transform="scale(0.793691, 1)" text-anchor="middle" y="3.287745" x="2.517410" font-family="Times New Roman" fill="black">)</svg:text></svg:g></svg:g><svg:g transform="translate(153.810797, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(163.911711, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.940430" font-family="Times New Roman" font-style="italic" fill="black">R</svg:text><svg:g transform="translate(7.605469, -5.367188)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.130000" font-family="Times New Roman" fill="black">2</svg:text></svg:g></svg:g></svg:svg>

Documents/Illumination/RayTraceDeriv_5.mathml

+<?xml version="1.0" encoding="utf-8"?>
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+    <mtable columnalign="left">
+        <mtr>
+            <mtd>
+                <mi>A</mi>
+                <msup>
+                    <mi>x</mi>
+                    <mn>2</mn>
+                </msup>
+                <mo>+</mo>
+                <mi>B</mi>
+                <mi>x</mi>
+                <mo>+</mo>
+                <mi>C</mi>
+                <mo>=</mo>
+                <mn>0</mn>
+            </mtd>
+        </mtr>
+        <mtr>
+            <mtd>
+                <mi>x</mi>
+                <mo>=</mo>
+                <mfrac>
+                    <mrow>
+						<mo>-</mo>
+						<mi>B</mi>
+						<mo>&#xb1;</mo>
+						<msqrt>
+							<msup>
+								<mi>B</mi>
+								<mn>2</mn>
+							</msup>
+							<mo>-</mo>
+							<mn>4</mn>
+							<mi>A</mi>
+							<mi>C</mi>
+						</msqrt>
+                    </mrow>
+                    <mrow>
+						<mn>2</mn>
+						<mi>A</mi>
+                    </mrow>
+                </mfrac>
+            </mtd>
+        </mtr>
+        <mtr>
+            <mtd>
+				<mi>A</mi>
+				<mo>=</mo>
+				<mover accent="true">
+					<mi>D</mi>
+					<mo>&#x5e;</mo>
+				</mover>
+				<mo>&#xb7;</mo>
+				<mover accent="true">
+					<mi>D</mi>
+					<mo>&#x5e;</mo>
+				</mover>
+				<mo>=</mo>
+				<mn>1</mn>
+            </mtd>
+        </mtr>
+        <mtr>
+            <mtd>
+				<mi>B</mi>
+				<mo>=</mo>
+				<mo>-</mo>
+				<mn>2</mn>
+				<mfenced open="(" close=")">
+					<mrow>
+						<mover accent="true">
+							<mi>D</mi>
+							<mo>&#x5e;</mo>
+						</mover>
+						<mo>&#xb7;</mo>
+						<mover accent="true">
+							<mi>S</mi>
+							<mo>&#x21C0;</mo>
+						</mover>
+					</mrow>
+				</mfenced>
+			</mtd>
+        </mtr>
+        <mtr>
+            <mtd>
+				<mi>C</mi>
+				<mo>=</mo>
+				<mfenced open="(" close=")">
+					<mrow>
+						<mover accent="true">
+							<mi>S</mi>
+							<mo>&#x21C0;</mo>
+						</mover>
+						<mo>&#xb7;</mo>
+						<mover accent="true">
+							<mi>S</mi>
+							<mo>&#x21C0;</mo>
+						</mover>
+					</mrow>
+				</mfenced>
+				<mo>-</mo>
+				<msup>
+					<mi>R</mi>
+					<mn>2</mn>
+				</msup>
+            </mtd>
+        </mtr>
+    </mtable>
+</math>
Add a comment to this file

Documents/Illumination/RayTraceDeriv_5.svg

Added
New image
+<?xml version="1.0" encoding="utf-8"?>
+<svg:svg xmlns="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg" height="95.305485pt" width="84.379149pt" xmlns:svgmath="http://www.grigoriev.ru/svgmath" viewBox="0 -51.637117 84.379149 95.305485"><svg:metadata><svgmath:metrics top="95.3054848831" axis="47.6527424416" baseline="43.6683674416" bottom="0.0"/></svg:metadata><svg:g transform="translate(0.000000, -3.984375)"><svg:g transform="translate(0.000000, -36.527899)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.250977" font-family="Times New Roman" font-style="italic" fill="black">A</svg:text><svg:g transform="translate(7.916016, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.061523" font-family="Times New Roman" font-style="italic" fill="black">x</svg:text><svg:g transform="translate(5.724609, -5.367188)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.130000" font-family="Times New Roman" fill="black">2</svg:text></svg:g></svg:g><svg:g transform="translate(20.567289, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">+</svg:text></svg:g><svg:g transform="translate(30.001531, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.940430" font-family="Times New Roman" font-style="italic" fill="black">B</svg:text></svg:g><svg:g transform="translate(37.607000, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.061523" font-family="Times New Roman" font-style="italic" fill="black">x</svg:text></svg:g><svg:g transform="translate(45.998273, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">+</svg:text></svg:g><svg:g transform="translate(55.432515, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.001953" font-family="Times New Roman" font-style="italic" fill="black">C</svg:text></svg:g><svg:g transform="translate(67.209211, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(77.310125, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.000000" font-family="Times New Roman" fill="black">0</svg:text></svg:g></svg:g><svg:g transform="translate(0.000000, -15.032676)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.061523" font-family="Times New Roman" font-style="italic" fill="black">x</svg:text><svg:g transform="translate(9.057945, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(19.744797, -3.984375)"><svg:g transform="translate(0.585938, -1.940409)"><svg:g transform="translate(0.000000, -2.828906)"><svg:text font-size="8.520000" text-anchor="middle" y="2.828906" x="2.402490" font-family="Times New Roman" fill="black">−</svg:text></svg:g><svg:g transform="translate(5.278314, 0.000000)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.797705" font-family="Times New Roman" font-style="italic" fill="black">B</svg:text></svg:g><svg:g transform="translate(12.571528, -2.828906)"><svg:text font-size="8.520000" text-anchor="middle" y="2.828906" x="2.338008" font-family="Times New Roman" fill="black">±</svg:text></svg:g><svg:g transform="translate(19.481675, 0.000000)"><svg:g transform="translate(6.476824, 0.000000)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.797705" font-family="Times New Roman" font-style="italic" fill="black">B</svg:text><svg:g transform="translate(5.399883, -3.810703)"><svg:text font-size="8.000000" text-anchor="middle" y="0.000000" x="2.000000" font-family="Times New Roman" fill="black">2</svg:text></svg:g><svg:g transform="translate(11.293214, -2.828906)"><svg:text font-size="8.520000" text-anchor="middle" y="2.828906" x="2.402490" font-family="Times New Roman" fill="black">−</svg:text></svg:g><svg:g transform="translate(17.991526, 0.000000)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.130000" font-family="Times New Roman" fill="black">4</svg:text></svg:g><svg:g transform="translate(22.251526, 0.000000)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="3.018193" font-family="Times New Roman" font-style="italic" fill="black">A</svg:text></svg:g><svg:g transform="translate(27.871897, 0.000000)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.841387" font-family="Times New Roman" font-style="italic" fill="black">C</svg:text></svg:g></svg:g><svg:path stroke-linejoin="miter" d="M 0.000000 -4.433561 L 1.543393 -5.010805 L 3.681786 -0.555820 L 3.602274 -0.230151 L 1.454785 -4.704085 L 1.284385 -4.704085 L 3.607780 0.000000 L 6.012966 -9.851211 L 40.807364 -9.851211" stroke="black" stroke-linecap="butt" stroke-miterlimit="10" stroke-width="0.340800" fill="none"/></svg:g></svg:g><svg:g transform="translate(25.790271, 7.369746)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.130000" font-family="Times New Roman" fill="black">2</svg:text><svg:g transform="translate(4.260000, 0.000000)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="3.018193" font-family="Times New Roman" font-style="italic" fill="black">A</svg:text></svg:g></svg:g><svg:line stroke-width="0.585938" x1="0.000000" x2="61.460914" stroke="black" stroke-linecap="butt" stroke-dasharray="none" y1="0.000000" y2="0.000000" fill="none"/></svg:g></svg:g><svg:g transform="translate(0.000000, 7.173008)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.250977" font-family="Times New Roman" font-style="italic" fill="black">A</svg:text><svg:g transform="translate(11.249352, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(21.350266, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.690430" font-family="Times New Roman" font-style="italic" fill="black">D</svg:text><svg:g transform="translate(1.696289, -9.328125)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="2.815430" font-family="Times New Roman" fill="black">^</svg:text></svg:g></svg:g><svg:g transform="translate(32.373707, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="1.998047" font-family="Times New Roman" fill="black">·</svg:text></svg:g><svg:g transform="translate(38.369805, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.690430" font-family="Times New Roman" font-style="italic" fill="black">D</svg:text><svg:g transform="translate(1.696289, -9.328125)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="2.815430" font-family="Times New Roman" fill="black">^</svg:text></svg:g></svg:g><svg:g transform="translate(50.726579, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(60.827493, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.000000" font-family="Times New Roman" fill="black">1</svg:text></svg:g></svg:g><svg:g transform="translate(0.000000, 26.022259)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.940430" font-family="Times New Roman" font-style="italic" fill="black">B</svg:text><svg:g transform="translate(10.938805, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(23.706383, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">−</svg:text></svg:g><svg:g transform="translate(33.140625, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.000000" font-family="Times New Roman" fill="black">2</svg:text></svg:g><svg:g transform="translate(39.140625, 0.000000)"><svg:g transform="translate(0.000000, -3.984375)"><svg:text font-size="17.632653" transform="scale(0.680556, 1)" text-anchor="middle" y="2.745297" x="2.935906" font-family="Times New Roman" fill="black">(</svg:text></svg:g><svg:g transform="translate(3.996094, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.690430" font-family="Times New Roman" font-style="italic" fill="black">D</svg:text><svg:g transform="translate(1.696289, -9.328125)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="2.815430" font-family="Times New Roman" fill="black">^</svg:text></svg:g><svg:g transform="translate(11.023442, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="1.998047" font-family="Times New Roman" fill="black">·</svg:text></svg:g><svg:g transform="translate(17.019539, 0.000000)"><svg:g transform="translate(2.384766, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.000000" font-family="Times New Roman" font-style="italic" fill="black">S</svg:text></svg:g><svg:g transform="translate(0.000000, -9.720703)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g></svg:g></svg:g><svg:g transform="translate(32.289071, -3.984375)"><svg:text font-size="17.632653" transform="scale(0.680556, 1)" text-anchor="middle" y="2.745297" x="2.935906" font-family="Times New Roman" fill="black">)</svg:text></svg:g></svg:g></svg:g><svg:g transform="translate(0.000000, 45.115866)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="4.001953" font-family="Times New Roman" font-style="italic" fill="black">C</svg:text><svg:g transform="translate(11.776695, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(21.877609, 0.000000)"><svg:g transform="translate(0.000000, -3.984375)"><svg:text font-size="15.119227" transform="scale(0.793691, 1)" text-anchor="middle" y="3.287745" x="2.517410" font-family="Times New Roman" fill="black">(</svg:text></svg:g><svg:g transform="translate(3.996094, 0.000000)"><svg:g transform="translate(2.384766, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.000000" font-family="Times New Roman" font-style="italic" fill="black">S</svg:text></svg:g><svg:g transform="translate(0.000000, -9.720703)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g><svg:g transform="translate(13.273442, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="1.998047" font-family="Times New Roman" fill="black">·</svg:text></svg:g><svg:g transform="translate(19.269539, 0.000000)"><svg:g transform="translate(2.384766, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.000000" font-family="Times New Roman" font-style="italic" fill="black">S</svg:text></svg:g><svg:g transform="translate(0.000000, -9.720703)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g></svg:g></svg:g><svg:g transform="translate(34.539071, -3.984375)"><svg:text font-size="15.119227" transform="scale(0.793691, 1)" text-anchor="middle" y="3.287745" x="2.517410" font-family="Times New Roman" fill="black">)</svg:text></svg:g></svg:g><svg:g transform="translate(63.079438, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">−</svg:text></svg:g><svg:g transform="translate(72.513680, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.940430" font-family="Times New Roman" font-style="italic" fill="black">R</svg:text><svg:g transform="translate(7.605469, -5.367188)"><svg:text font-size="8.520000" text-anchor="middle" y="0.000000" x="2.130000" font-family="Times New Roman" fill="black">2</svg:text></svg:g></svg:g></svg:g></svg:g></svg:svg>

Documents/Illumination/SphereEquation.mathml

+<?xml version="1.0" encoding="utf-8"?>
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+	<mtable>
+		<mtr>
+			<mtd>
+				<mi>R</mi>
+				<mo>=</mo>
+				<mtext>Sphere Radius</mtext>
+			</mtd>
+		</mtr>
+		<mtr>
+			<mtd>
+				<mover accent="true">
+					<mi>S</mi>
+					<mo>&#x21C0;</mo>
+				</mover>
+				<mo>=</mo>
+				<mtext>Sphere Center</mtext>
+			</mtd>
+		</mtr>
+		<mtr>
+			<mtd>
+				<mfenced open="&#x2225;" close="&#x2225;">
+					<mrow>
+						<mover accent="true">
+							<mi>P</mi>
+							<mo>&#x21C0;</mo>
+						</mover>
+						<mo>-</mo>
+						<mover accent="true">
+							<mi>S</mi>
+							<mo>&#x21C0;</mo>
+						</mover>
+					</mrow>
+				</mfenced>
+				<mo>=</mo>
+				<mi>R</mi>
+			</mtd>
+		</mtr>
+	</mtable>
+</math>
Add a comment to this file

Documents/Illumination/SphereEquation.svg

Added
New image
+<?xml version="1.0" encoding="utf-8"?>
+<svg:svg xmlns="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg" height="47.753906pt" width="95.092457pt" xmlns:svgmath="http://www.grigoriev.ru/svgmath" viewBox="0 -27.861328 95.092457 47.753906"><svg:metadata><svgmath:metrics top="47.75390625" axis="23.876953125" baseline="19.892578125" bottom="0.0"/></svg:metadata><svg:g transform="translate(0.000000, -3.984375)"><svg:g transform="translate(1.198242, -15.544922)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.940430" font-family="Times New Roman" font-style="italic" fill="black">R</svg:text><svg:g transform="translate(10.938805, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(23.039723, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="34.828125" font-family="Times New Roman" fill="black">Sphere Radius</svg:text></svg:g></svg:g><svg:g transform="translate(0.000000, 3.556641)"><svg:g transform="translate(2.384766, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.000000" font-family="Times New Roman" font-style="italic" fill="black">S</svg:text></svg:g><svg:g transform="translate(0.000000, -9.720703)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g><svg:g transform="translate(14.606773, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(26.707692, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="34.154297" font-family="Times New Roman" fill="black">Sphere Center</svg:text></svg:g></svg:g><svg:g transform="translate(7.764975, 22.658203)"><svg:g transform="translate(0.000000, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="3.468750" font-family="Lucida Sans Unicode" fill="black">∥</svg:text></svg:g><svg:g transform="translate(10.270836, 0.000000)"><svg:g transform="translate(1.766602, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.952148" font-family="Times New Roman" font-style="italic" fill="black">P</svg:text></svg:g><svg:g transform="translate(0.000000, -9.539063)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g><svg:g transform="translate(13.940102, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">−</svg:text></svg:g><svg:g transform="translate(23.374344, 0.000000)"><svg:g transform="translate(2.384766, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.000000" font-family="Times New Roman" font-style="italic" fill="black">S</svg:text></svg:g><svg:g transform="translate(0.000000, -9.720703)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="5.636719" font-family="Lucida Sans Unicode" fill="black">⇀</svg:text></svg:g></svg:g></svg:g><svg:g transform="translate(48.251953, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.468750" x="3.468750" font-family="Lucida Sans Unicode" fill="black">∥</svg:text></svg:g><svg:g transform="translate(61.856125, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(71.957039, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="3.940430" font-family="Times New Roman" font-style="italic" fill="black">R</svg:text></svg:g></svg:g></svg:g></svg:svg>

Documents/Illumination/Tutorial 13.xml

         <para>The tutorial project <phrase role="propername">Basic Impostor</phrase> demonstrates
             this technique. It shows a scene with several spheres, a directional light, and a moving
             point light source.</para>
-        <!--TODO: Picture of this tutorial.-->
+        <figure>
+            <title>Basic Impostor</title>
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="Basic%20Impostor.png"/>
+                </imageobject>
+            </mediaobject>
+        </figure>
         <para>The camera movement is controlled in the same way as previous tutorials. The
                 <keycap>T</keycap> key will toggle a display showing the look-at point. The
                 <keycap>-</keycap> and <keycap>=</keycap> keys will rewind and fast-forward the
                 sphere's center to that point on the surface.</para>
             <para>Let's look at the 2D case. To have a 2D vector direction, we need an X and Y
                 coordinate. If we only have the X, but we know that the vector has a certain length,
-                then we can compute the Y based on the Pythagorean theorem:</para>
-            <!--TODO: Diagram of the 2D case of finding Y based on X and a diagonal.
-TODO: Equation of Pythagorean theorem, then reformulated to solve for Y.-->
+                then we can compute the Y component of the vector based on the Pythagorean
+                theorem:</para>
+            <figure>
+                <title>Circle Point Computation</title>
+                <mediaobject>
+                    <imageobject>
+                        <imagedata fileref="CirclePythagorean.svg" format="SVG"/>
+                    </imageobject>
+                </mediaobject>
+            </figure>
+            <informalfigure>
+                <mediaobject>
+                    <imageobject>
+                        <imagedata fileref="PythagoreanTheorem.svg" format="SVG"/>
+                    </imageobject>
+                </mediaobject>
+            </informalfigure>
             <para>We simply use the 3D version of this. We have X and Y from
                     <varname>mapping</varname>, and we know the length is 1.0. So we compute the Z
                 value easily enough. And since we are only interested in the front-side of the
         <para>To see how, toggle back to rendering the mesh on sphere <keycap>1</keycap> (the
             central blue one). Then move the camera so that the sphere is at the left edge of the
             screen. Then toggle back to impostor rendering.</para>
-        <!--TODO: Picture of the bad sphere impostor, both before and after.-->
+        <figure>
+            <title>Bad Impostor</title>
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="Impostor%20No%20Perspective.png"/>
+                </imageobject>
+            </mediaobject>
+        </figure>
         <para>What's going on here? The mesh sphere seems to be wider than the impostor sphere. This
             must mean that the mesh sphere is doing something our impostor isn't. Does this have to
             do with the inaccuracy of the mesh sphere?</para>
             mapping between the surface and the sphere is static; it doesn't change based on the
             viewing angle.</para>
         <para>Consider this 2D case:</para>
-        <!--TODO: Diagram of 2D case of perspective projection and sphere impostor off to the left.-->
-        <para>When viewing the sphere off to the side like this, we shouldn't be able to see the
-            left-edge of the sphere facing perpendicular to the camera. And we should see some of
-            the sphere on the right that is behind the plane.</para>
+        <figure>
+            <title>Circle Projection</title>
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="CircleInPerspective.svg" format="SVG"/>
+                </imageobject>
+            </mediaobject>
+        </figure>
+        <para>The line through the circle represents the square we drew. When viewing the sphere off
+            to the side like this, we shouldn't be able to see the left-edge of the sphere facing
+            perpendicular to the camera. And we should see some of the sphere on the right that is
+            behind the plane.</para>
         <para>So how do we solve this?</para>
         <para>Use better math. Our last algorithm is a decent approximation if the spheres are
             somewhat small. But if the spheres are reasonably large (which also can mean close to
         <para>A ray is a direction and a position; it represents a line extending from the position
             along that direction. The points on the ray can be expressed as the following
             equation:</para>
-        <!--TODO: Equation for a ray.-->
+        <equation>
+            <title>Ray Equation</title>
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="RayEquation.svg" format="SVG"/>
+                </imageobject>
+            </mediaobject>
+        </equation>
         <para>The <varname>t</varname> value can be positive or negative, but for our needs, we'll
             stick with positive values.</para>
         <para>For each fragment, we want to create a ray from the camera position in the direction
             and normal for our lighting equation.</para>
         <para>The math for this is fairly simple. The equation for the points on a sphere is
             this:</para>
-        <!--TODO: Equation for a sphere. |P - S| = R-->
-        <para>For any point P, if this equation is true, then P is on the sphere. So we can
-            substitute our ray equation for P:</para>
-        <!--TODO: Equation, Ray substituted for P. |Dt + O - S| = R-->
+        <equation>
+            <title>Sphere Equation</title>
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="SphereEquation.svg" format="SVG"/>
+                </imageobject>
+            </mediaobject>
+        </equation>
+        <para>For any point P, if this equation is true, if the length between that point and the
+            sphere's center equals the radius, then P is on the sphere. So we can substitute our ray
+            equation for P:</para>
+        <informalequation>
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="RayTraceDeriv_1.svg" format="SVG"/>
+                </imageobject>
+            </mediaobject>
+        </informalequation>
         <para>Our ray goes from the camera into the scene. Since we're in camera space, the camera
-            is at the origin. So O can be eliminated from the equation.</para>
-        <para>To solve for t, we need to get rid of that length. One way to do it is to re-express
-            the sphere equation as the length squared. So then we get:</para>
-        <!--TODO: Equation for a sphere: |P - S|^2 = R^2
-Then |Dt - S|^2 = R^2-->
+            is at the origin. So O can be eliminated from the equation. To solve for
+                <varname>t</varname>, we need to get rid of that length. One way to do it is to
+            re-express the sphere equation as the length squared. So then we get:</para>
+        <informalequation>
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="RayTraceDeriv_2.svg" format="SVG"/>
+                </imageobject>
+            </mediaobject>
+        </informalequation>
         <para>The square of the length of a vector is the same as that vector dot-producted with
             itself. So let's do that:</para>
-        <!--TODO: Equation: (Dt - S)DOT(Dt - S) = R^2-->
+        <informalequation>
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="RayTraceDeriv_3.svg" format="SVG"/>
+                </imageobject>
+            </mediaobject>
+        </informalequation>
         <para>The dot product is distributive. Indeed, it follows most of the rules of scalar
             multiplication. This gives us:</para>
-        <!--TODO: Equation: (DDOTD)t^2 -2DDOTS*t + SDOTS = R^2 -->
+        <informalequation>
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="RayTraceDeriv_4.svg" format="SVG"/>
+                </imageobject>
+            </mediaobject>
+        </informalequation>
         <para>While this equation has a lot of vector elements in it, as far as t is concerned, it
-            is a scalar equation. Indeed, it is a quadratic equation, with respect to t. Ahh, good
+            is a scalar equation. Indeed, it is a quadratic equation, with respect to t. Ah, good
             old algebra.</para>
-        <!--TODO: Equation: the Quadratic Formula
-A, B, C from the above.-->
+        <informalequation>
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="RayTraceDeriv_5.svg" format="SVG"/>
+                </imageobject>
+            </mediaobject>
+        </informalequation>
         <para>In case you've forgotten, the part under the square root in the quadratic formula is
-            called the determinant. If this value is negative, then the equation has no solution. In
-            terms of our ray test, this means the ray misses the sphere.</para>
+            called the discriminant. If this value is negative, then the equation has no solution.
+            In terms of our ray test, this means the ray misses the sphere.</para>
         <para>As you may recall, the square root can be either positive or negative. This gives us
             two t values. Which makes sense; the ray hits the sphere in two places: once going in,
             and once coming out. The correct t value that we're interested in is the smallest one.
                 there was no need to make another code project for it. To see the ray-traced
                 version, press the <keycap>J</keycap> key; all impostors will use the perspective
                 version. To go back to the flat version, press <keycap>L</keycap>.</para>
-            <!--TODO: Picture, comparing the non-perspective version to the perspective one. And to the mesh.-->
-            <para>Much better.</para>
+            <figure>
+                <title>Bad vs. Good</title>
+                <mediaobject>
+                    <imageobject>
+                        <imagedata fileref="Bad%20vs%20Good%20Impostor2.png"/>
+                    </imageobject>
+                </mediaobject>
+            </figure>
+            <para>The top is the original, the middle is the actual mesh, and the bottom is our new
+                ray traced version.</para>
             <para>The <function>Impostor</function> function in the fragment shader implements our
                 ray tracing algorithm. More importantly are the changes to the vertex shader's
                 computation of the impostor square:</para>
     gl_Position = cameraToClipMatrix * cameraCornerPos;
 }</programlisting>
             </example>
-            <para>We have expanded the size of the square by 50%. What is the purpose of
-                this?</para>
-            <para>Recall that, when you look sidelong at the sphere, it shifts to the side a bit.
-                This also means that it no longer fits into a radius-sized square from the
-                perspective of camera space. Rather than finding a clever way to compute the exact
-                extent of the sphere based on things like the viewport, the perspective matrix, and
-                so forth, it's much easier to just make the square bigger. Sure, you'll end up
-                running the rasterizer rather more than strictly necessary. But it's overall much
-                simpler.</para>
+            <para>We have expanded the size of the square by 50%. What is the purpose of this? Well,
+                let's look at our 2D image again.</para>
+            <informalfigure>
+                <mediaobject>
+                    <imageobject>
+                        <imagedata fileref="CircleInPerspective.svg" format="SVG"/>
+                    </imageobject>
+                </mediaobject>
+            </informalfigure>
+            <para>The black line represents the square we used originally. There is a portion to the
+                left of the projection that we should be able to see. However, with proper ray
+                tracing, it wouldn't fit onto the area of the radius-sized square.</para>
+            <para>This means that we need to expand the size of the square. Rather than finding a
+                clever way to compute the exact extent of the sphere's area projected onto a square,
+                it's much easier to just make the square bigger. This is even moreso considering
+                that such math would have to take into account things like the viewport and the
+                perspective matrix. Sure, we will end up running the rasterizer rather more than
+                strictly necessary. But it's overall much simpler.</para>
         </section>
     </section>
     <section>
         <title>Deceit in Depth</title>
         <para>While the perspective version looks great, there remains one problem. Move the time
             around until the rotating grey sphere ducks underneath the ground.</para>
-        <!--TODO: Picture of the grey sphere intersecting the ground, in perspective mode.-->
+        <figure>
+            <title>Bad Intersection</title>
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="Bad%20Impostor%20Intersection.png"/>
+                </imageobject>
+            </mediaobject>
+        </figure>
         <para>Hmm. Even though we've made it look like a mathematically perfect sphere, it doesn't
             act like one to the depth buffer. As far as it is concerned, it's just a circle
             (remember: <literal>discard</literal> prevents depth writes and tests as well).</para>
         <para>But we do have the ability to write a depth value ourselves. To see how this is done,
             load up the tutorial (using the same code again) and press the <keycap>H</keycap> key.
             This will cause all impostors to use depth-correct shaders.</para>
-        <!--TODO: Picture comparing the grey sphere before and after depth correction.-->
+        <figure>
+            <title>Depth Correct Impostor</title>
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="Depth%20Correct%20Impostor.png"/>
+                </imageobject>
+            </mediaobject>
+        </figure>
         <para>This shader is identical to the ray traced version, except for these lines in the
             fragment shader:</para>
         <example>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.