<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: A Cliffside Cliffhanger	</title>
	<atom:link href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/feed/" rel="self" type="application/rss+xml" />
	<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/</link>
	<description>Explore an abandoned island.</description>
	<lastBuildDate>Sat, 12 Jan 2013 21:59:09 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9</generator>
	<item>
		<title>
		By: Gian		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-326842</link>

		<dc:creator><![CDATA[Gian]]></dc:creator>
		<pubDate>Sat, 12 Jan 2013 21:59:09 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-326842</guid>

					<description><![CDATA[Things can be really tricky when even things in the code base have some problems ;) you should draw a grid representing the plane while dragging, to visualize &quot;3D-ness&quot; ;) I&#039;ve seen it useful also when moving objects not along a single axis but 2 (dragging the center of the object for example) so you can understand better where are you moving the object without having to change the view to check so often.
Also the grid could be setup up by the artists with a certain step and translation cointrained to that (when snapping is enabled). Also the grid step can be half the size of the object in that axis.
Just some ideas i implemented these last weeks for placings fornitures and other objects inside 3d models of bathrooms and other virtual rooms :) 
I also implemented aligning bounding boxes sides of objects each other to have them side by side. 
Don&#039;t know if they can be useful for a videogame editor :)]]></description>
			<content:encoded><![CDATA[<p>Things can be really tricky when even things in the code base have some problems ;) you should draw a grid representing the plane while dragging, to visualize &#8220;3D-ness&#8221; ;) I&#8217;ve seen it useful also when moving objects not along a single axis but 2 (dragging the center of the object for example) so you can understand better where are you moving the object without having to change the view to check so often.<br />
Also the grid could be setup up by the artists with a certain step and translation cointrained to that (when snapping is enabled). Also the grid step can be half the size of the object in that axis.<br />
Just some ideas i implemented these last weeks for placings fornitures and other objects inside 3d models of bathrooms and other virtual rooms :)<br />
I also implemented aligning bounding boxes sides of objects each other to have them side by side.<br />
Don&#8217;t know if they can be useful for a videogame editor :)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Raigan		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-296377</link>

		<dc:creator><![CDATA[Raigan]]></dc:creator>
		<pubDate>Tue, 08 Jan 2013 14:21:11 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-296377</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-291093&quot;&gt;Casey Muratori&lt;/a&gt;.

That makes sense - elegant!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-291093">Casey Muratori</a>.</p>
<p>That makes sense &#8211; elegant!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Casey Muratori		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-291093</link>

		<dc:creator><![CDATA[Casey Muratori]]></dc:creator>
		<pubDate>Tue, 08 Jan 2013 01:13:27 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-291093</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-284835&quot;&gt;Raigan&lt;/a&gt;.

That is an excellent question.

I actually don&#039;t know that I&#039;ve ever tested both methods side-by-side and seen which one is better.  They don&#039;t produce the same answer unless the cursor happens to be right on the ray, so it could be that &quot;closest point on ray&quot; feels better, and it would be worth special-casing, but I don&#039;t know.

As to why I choose the plane method, it is actually a matter of compactness.  One thing I didn&#039;t discuss in this post, although I do mention it in passing, is that the transform manipulator also allows planar dragging.  In that case, you need to use the planar intersection code to do the drag, since closest-point-on-ray is not going to help you there.  What&#039;s nice about using the planar intersection code to _also_ handle single-axis dragging is that basically all the transform manipulation code can be shared between the single-axis and planar cases.  It is only the setup code where you choose the plane and allowed motion axes that changes.

- Casey]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-284835">Raigan</a>.</p>
<p>That is an excellent question.</p>
<p>I actually don&#8217;t know that I&#8217;ve ever tested both methods side-by-side and seen which one is better.  They don&#8217;t produce the same answer unless the cursor happens to be right on the ray, so it could be that &#8220;closest point on ray&#8221; feels better, and it would be worth special-casing, but I don&#8217;t know.</p>
<p>As to why I choose the plane method, it is actually a matter of compactness.  One thing I didn&#8217;t discuss in this post, although I do mention it in passing, is that the transform manipulator also allows planar dragging.  In that case, you need to use the planar intersection code to do the drag, since closest-point-on-ray is not going to help you there.  What&#8217;s nice about using the planar intersection code to _also_ handle single-axis dragging is that basically all the transform manipulation code can be shared between the single-axis and planar cases.  It is only the setup code where you choose the plane and allowed motion axes that changes.</p>
<p>&#8211; Casey</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Raigan		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-284835</link>

		<dc:creator><![CDATA[Raigan]]></dc:creator>
		<pubDate>Mon, 07 Jan 2013 03:54:09 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-284835</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-284824&quot;&gt;Raigan&lt;/a&gt;.

(sorry, maybe that&#039;s phrased a bit confusingly; what I meant was, wouldn&#039;t a &quot;closest point between two infinite lines&quot; query have been more what you wanted?)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-284824">Raigan</a>.</p>
<p>(sorry, maybe that&#8217;s phrased a bit confusingly; what I meant was, wouldn&#8217;t a &#8220;closest point between two infinite lines&#8221; query have been more what you wanted?)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Raigan		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-284824</link>

		<dc:creator><![CDATA[Raigan]]></dc:creator>
		<pubDate>Mon, 07 Jan 2013 03:52:20 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-284824</guid>

					<description><![CDATA[My question is: why mess about with constructing a plane and intersecting against it, when instead you could find the closest point on the drag-axis to the ray, and use that directly? ;p]]></description>
			<content:encoded><![CDATA[<p>My question is: why mess about with constructing a plane and intersecting against it, when instead you could find the closest point on the drag-axis to the ray, and use that directly? ;p</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Frank Lantz		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-283884</link>

		<dc:creator><![CDATA[Frank Lantz]]></dc:creator>
		<pubDate>Mon, 07 Jan 2013 01:40:09 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-283884</guid>

					<description><![CDATA[&#062;&#062; I think I would enjoy coming across this rock and remembering this post.

Me too. Casually leaning against the sixth wall, surrounded by the rubble of the fifth, squinting at the seventh, wondering what forces might be required to bring it down.]]></description>
			<content:encoded><![CDATA[<p>&gt;&gt; I think I would enjoy coming across this rock and remembering this post.</p>
<p>Me too. Casually leaning against the sixth wall, surrounded by the rubble of the fifth, squinting at the seventh, wondering what forces might be required to bring it down.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Michael Pianta		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-278053</link>

		<dc:creator><![CDATA[Michael Pianta]]></dc:creator>
		<pubDate>Sun, 06 Jan 2013 02:21:04 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-278053</guid>

					<description><![CDATA[As a hobbyist developer I&#039;ve only ever worked on 2D games and frankly I don&#039;t understand the 3D math well enough to offer a guess, but I do want to say that this is a great post and an interesting problem and surely it&#039;s about time we learn the answer right? ;)]]></description>
			<content:encoded><![CDATA[<p>As a hobbyist developer I&#8217;ve only ever worked on 2D games and frankly I don&#8217;t understand the 3D math well enough to offer a guess, but I do want to say that this is a great post and an interesting problem and surely it&#8217;s about time we learn the answer right? ;)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Fred		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-269119</link>

		<dc:creator><![CDATA[Fred]]></dc:creator>
		<pubDate>Fri, 04 Jan 2013 23:44:34 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-269119</guid>

					<description><![CDATA[I think the issue is:
ray_origin is quite large (the camera is far from the island).
ray_direction and plane_normal are unit vectors.
So, numerator is quite large while denominator is between 0 and 1, closer to zero as the axis is pointing more to the camera.
plane_d is quite small if the axis is pointing more towards the camera as well.
That gives you lots of numerical instability as t is something big divided by something small.
So, as the mouse slowly moves, and ray_direction rotates, you get a t that&#039;s jumping in big discrete steps.

The solution is probably to first express everything around the camera position (as an origin), so that you&#039;re dividing two numbers of similar magnitudes.

I would also advice to using double instead of floats (there&#039;s no reason not to), floats are way too imprecise even in trivial situations.]]></description>
			<content:encoded><![CDATA[<p>I think the issue is:<br />
ray_origin is quite large (the camera is far from the island).<br />
ray_direction and plane_normal are unit vectors.<br />
So, numerator is quite large while denominator is between 0 and 1, closer to zero as the axis is pointing more to the camera.<br />
plane_d is quite small if the axis is pointing more towards the camera as well.<br />
That gives you lots of numerical instability as t is something big divided by something small.<br />
So, as the mouse slowly moves, and ray_direction rotates, you get a t that&#8217;s jumping in big discrete steps.</p>
<p>The solution is probably to first express everything around the camera position (as an origin), so that you&#8217;re dividing two numbers of similar magnitudes.</p>
<p>I would also advice to using double instead of floats (there&#8217;s no reason not to), floats are way too imprecise even in trivial situations.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Seb		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-264694</link>

		<dc:creator><![CDATA[Seb]]></dc:creator>
		<pubDate>Fri, 04 Jan 2013 13:37:06 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-264694</guid>

					<description><![CDATA[I might be wrong, but then again I might be right:

float t = (plane_d - numerator) / denominator

Otherwise you seem to get inconsistent results depending on whether the ray_origin is between the world origin and the plane or the plane is between ray_origin and the world origin. I have no idea why. I just know that you&#039;ll get something on the other side of the origin if the plane is between you and it. Which is weird, because every textbook gives you what you have above, which makes me think I&#039;m wrong.]]></description>
			<content:encoded><![CDATA[<p>I might be wrong, but then again I might be right:</p>
<p>float t = (plane_d &#8211; numerator) / denominator</p>
<p>Otherwise you seem to get inconsistent results depending on whether the ray_origin is between the world origin and the plane or the plane is between ray_origin and the world origin. I have no idea why. I just know that you&#8217;ll get something on the other side of the origin if the plane is between you and it. Which is weird, because every textbook gives you what you have above, which makes me think I&#8217;m wrong.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Butcher		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-247241</link>

		<dc:creator><![CDATA[Butcher]]></dc:creator>
		<pubDate>Thu, 03 Jan 2013 03:21:41 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-247241</guid>

					<description><![CDATA[Um. Am I too late?

You are adding two large numbers together that nearly cancel out; your d value and the dot product. Then you are taking this small floating point noise and multiplying it by a larger value, resulting in an essentially random location on the ray.]]></description>
			<content:encoded><![CDATA[<p>Um. Am I too late?</p>
<p>You are adding two large numbers together that nearly cancel out; your d value and the dot product. Then you are taking this small floating point noise and multiplying it by a larger value, resulting in an essentially random location on the ray.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rug		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-233255</link>

		<dc:creator><![CDATA[Rug]]></dc:creator>
		<pubDate>Wed, 02 Jan 2013 05:14:59 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-233255</guid>

					<description><![CDATA[When ray_origin and ray_direction are the same, for  values of plan_d  smaller than denominator values, you are basically always returning zero. 

Is that rock the origin of something specific used to set up a distance or an axis?]]></description>
			<content:encoded><![CDATA[<p>When ray_origin and ray_direction are the same, for  values of plan_d  smaller than denominator values, you are basically always returning zero. </p>
<p>Is that rock the origin of something specific used to set up a distance or an axis?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan O'Brien		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-207109</link>

		<dc:creator><![CDATA[Jonathan O'Brien]]></dc:creator>
		<pubDate>Mon, 31 Dec 2012 02:46:59 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-207109</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173980&quot;&gt;Jonathan Blow&lt;/a&gt;.

It&#039;s lovely and fitting to your sort of aesthetic, but unfortunately the comments section is often a mess.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173980">Jonathan Blow</a>.</p>
<p>It&#8217;s lovely and fitting to your sort of aesthetic, but unfortunately the comments section is often a mess.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Timothy		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-205427</link>

		<dc:creator><![CDATA[Timothy]]></dc:creator>
		<pubDate>Sun, 30 Dec 2012 18:45:53 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-205427</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-194047&quot;&gt;Casey Muratori&lt;/a&gt;.

Pressing the X button just to tell you that it was great.  Time to go back and play some volleyball in my new swimsuit.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-194047">Casey Muratori</a>.</p>
<p>Pressing the X button just to tell you that it was great.  Time to go back and play some volleyball in my new swimsuit.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Pritchard		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-205421</link>

		<dc:creator><![CDATA[Pritchard]]></dc:creator>
		<pubDate>Sun, 30 Dec 2012 18:42:56 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-205421</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-180875&quot;&gt;Casey Muratori&lt;/a&gt;.

I&#039;d pay for Timothy in a swimsuit.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-180875">Casey Muratori</a>.</p>
<p>I&#8217;d pay for Timothy in a swimsuit.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Fawstoar		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-204996</link>

		<dc:creator><![CDATA[Fawstoar]]></dc:creator>
		<pubDate>Sun, 30 Dec 2012 17:19:16 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-204996</guid>

					<description><![CDATA[I&#039;m mostly programming-illiterate. Is there some sort of discrepancy between the origin and the direction? Reading this post was akin to interpreting Hamlet by bashing the unabridged script over my head. Eagerly awaiting the follow-up.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m mostly programming-illiterate. Is there some sort of discrepancy between the origin and the direction? Reading this post was akin to interpreting Hamlet by bashing the unabridged script over my head. Eagerly awaiting the follow-up.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Casey Muratori		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-194047</link>

		<dc:creator><![CDATA[Casey Muratori]]></dc:creator>
		<pubDate>Sat, 29 Dec 2012 02:14:10 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-194047</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-190215&quot;&gt;Hooman&lt;/a&gt;.

The Witness is an ambitious game, developed by a small team with a limited budget, so the truth is simply that it isn&#039;t really possible to accurately predict when it will be done.  Everyone is working very hard to make it perfect and put it out there so people can experience it, but there&#039;s always a ton of work to do to finish a game, especially if you want it to meet a high quality bar.

So thanks for being patient, and I hope you find that The Witness was worth the wait when it comes out!

- Casey]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-190215">Hooman</a>.</p>
<p>The Witness is an ambitious game, developed by a small team with a limited budget, so the truth is simply that it isn&#8217;t really possible to accurately predict when it will be done.  Everyone is working very hard to make it perfect and put it out there so people can experience it, but there&#8217;s always a ton of work to do to finish a game, especially if you want it to meet a high quality bar.</p>
<p>So thanks for being patient, and I hope you find that The Witness was worth the wait when it comes out!</p>
<p>&#8211; Casey</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Clownboat		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-191398</link>

		<dc:creator><![CDATA[Clownboat]]></dc:creator>
		<pubDate>Fri, 28 Dec 2012 15:52:37 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-191398</guid>

					<description><![CDATA[I&#039;ve never done any 3D programming, so I struggled somewhat to understand how you were representing the plane containing the dragging axis.  Am I correct in thinking plane_normal and plane_d represent a vector whose origin is that of the world (presumably, the center of the island)?

If so, then the problem seems to be one of floating-point precision.  In cases where the origin-to-object distance is much greater than the camera-to-object distance (or vice-versa, though this is unlikely to happen), you&#039;ll lose some rather vital information in the third line of the example function.

Conceptually, I would solve this by using a more local point (perhaps one that&#039;s still on the plane normal?) as the origin for the purpose of the entire dragging operation, though I&#039;m not sure how this would play out in the code.

Anyway, I&#039;ve enjoyed these updates immensely, due to how thoroughly you describe your problem-solving process.  As a novice, I find this quite valuable.  I almost hope you take longer with the game, just so I have more of this to look forward to.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve never done any 3D programming, so I struggled somewhat to understand how you were representing the plane containing the dragging axis.  Am I correct in thinking plane_normal and plane_d represent a vector whose origin is that of the world (presumably, the center of the island)?</p>
<p>If so, then the problem seems to be one of floating-point precision.  In cases where the origin-to-object distance is much greater than the camera-to-object distance (or vice-versa, though this is unlikely to happen), you&#8217;ll lose some rather vital information in the third line of the example function.</p>
<p>Conceptually, I would solve this by using a more local point (perhaps one that&#8217;s still on the plane normal?) as the origin for the purpose of the entire dragging operation, though I&#8217;m not sure how this would play out in the code.</p>
<p>Anyway, I&#8217;ve enjoyed these updates immensely, due to how thoroughly you describe your problem-solving process.  As a novice, I find this quite valuable.  I almost hope you take longer with the game, just so I have more of this to look forward to.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Cristian Cornea		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-191370</link>

		<dc:creator><![CDATA[Cristian Cornea]]></dc:creator>
		<pubDate>Fri, 28 Dec 2012 15:36:55 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-191370</guid>

					<description><![CDATA[Shouldn&#039;t it be float t = ((plane_d - numerator) / denominator); ?]]></description>
			<content:encoded><![CDATA[<p>Shouldn&#8217;t it be float t = ((plane_d &#8211; numerator) / denominator); ?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Hooman		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-190215</link>

		<dc:creator><![CDATA[Hooman]]></dc:creator>
		<pubDate>Fri, 28 Dec 2012 12:31:01 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-190215</guid>

					<description><![CDATA[hi!
i have an important question...
when will you release this game??!!!
im waiting for about a year and checking your blog every week,
you know...im a crazy fan of puzzle games!!ive played the fantastic game &quot;braid&quot; and i love it...it is,seriously without exaggerating!,the best puzzle game ive ever played.and now i want to try &quot;the witness&quot;.so i would be happy if you just say a date of releasing it!!
 thank you.]]></description>
			<content:encoded><![CDATA[<p>hi!<br />
i have an important question&#8230;<br />
when will you release this game??!!!<br />
im waiting for about a year and checking your blog every week,<br />
you know&#8230;im a crazy fan of puzzle games!!ive played the fantastic game &#8220;braid&#8221; and i love it&#8230;it is,seriously without exaggerating!,the best puzzle game ive ever played.and now i want to try &#8220;the witness&#8221;.so i would be happy if you just say a date of releasing it!!<br />
 thank you.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mike		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-186442</link>

		<dc:creator><![CDATA[Mike]]></dc:creator>
		<pubDate>Fri, 28 Dec 2012 00:25:19 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-186442</guid>

					<description><![CDATA[plane_d -?]]></description>
			<content:encoded><![CDATA[<p>plane_d -?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Matthew VanDevander		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-185196</link>

		<dc:creator><![CDATA[Matthew VanDevander]]></dc:creator>
		<pubDate>Thu, 27 Dec 2012 21:20:24 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-185196</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-185153&quot;&gt;Matthew VanDevander&lt;/a&gt;.

Ugh, iPad autocorrect made me sound dumber there.

Obviously were instead of we&#039;re.

And I&#039;m thinking backwards instead of Iover hiking backwards.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-185153">Matthew VanDevander</a>.</p>
<p>Ugh, iPad autocorrect made me sound dumber there.</p>
<p>Obviously were instead of we&#8217;re.</p>
<p>And I&#8217;m thinking backwards instead of Iover hiking backwards.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Matthew VanDevander		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-185153</link>

		<dc:creator><![CDATA[Matthew VanDevander]]></dc:creator>
		<pubDate>Thu, 27 Dec 2012 21:17:43 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-185153</guid>

					<description><![CDATA[I know it&#039;s been posted a few times, and since I have rather little 3d programming experience I assumed that I was jumping to a dumb conclusion. But I feel like it reeks of precision errors with floating point numbers. If the plane constant is a small floating point value, and the vectors which are describing the picked object position and the translation motion are significantly far away from the origin of the world. Then the small plane constant can easily get lost in that division of the massive world coordinate floating points when the hardware simply truncates the division and rounds it off. 

I may be wrong, but it seems to explain why the problem did not show up in your test world, because the objects you were manipulating we&#039;re close to the origin, and therefore not susceptible to the rounding errors when the points were projected onto the world plane. It also explains why it was a problem at some camera angles and not others, because the projected point would be closer or further from the plane origin, and therefore larger or smaller. Also, you may notice odd precision increases or decreases based on proximity to whole number results.

I&#039;m mostly talking out my ass here, as I&#039;m not the best programmer in the world. But I enjoy a good puzzle. So I couldn&#039;t resist embarrassing myself.

As for how to fix the issue. I suppose you could simply define the projection plane with an origin that is closer to the object in question. Or Iover hiking backwards and you could just make the objects translation be in local space instead of world space and then reproject the translation after the math is completed in a smaller domain.]]></description>
			<content:encoded><![CDATA[<p>I know it&#8217;s been posted a few times, and since I have rather little 3d programming experience I assumed that I was jumping to a dumb conclusion. But I feel like it reeks of precision errors with floating point numbers. If the plane constant is a small floating point value, and the vectors which are describing the picked object position and the translation motion are significantly far away from the origin of the world. Then the small plane constant can easily get lost in that division of the massive world coordinate floating points when the hardware simply truncates the division and rounds it off. </p>
<p>I may be wrong, but it seems to explain why the problem did not show up in your test world, because the objects you were manipulating we&#8217;re close to the origin, and therefore not susceptible to the rounding errors when the points were projected onto the world plane. It also explains why it was a problem at some camera angles and not others, because the projected point would be closer or further from the plane origin, and therefore larger or smaller. Also, you may notice odd precision increases or decreases based on proximity to whole number results.</p>
<p>I&#8217;m mostly talking out my ass here, as I&#8217;m not the best programmer in the world. But I enjoy a good puzzle. So I couldn&#8217;t resist embarrassing myself.</p>
<p>As for how to fix the issue. I suppose you could simply define the projection plane with an origin that is closer to the object in question. Or Iover hiking backwards and you could just make the objects translation be in local space instead of world space and then reproject the translation after the math is completed in a smaller domain.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: James Hommowun		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-184560</link>

		<dc:creator><![CDATA[James Hommowun]]></dc:creator>
		<pubDate>Thu, 27 Dec 2012 17:27:38 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-184560</guid>

					<description><![CDATA[Long time reader, first time poster.  I don&#039;t want to take up a lot of your time because I&#039;ll freely admit the math is beyond me practically (if not conceptually...); the writing, however, is excellent!  Thank you, Casey, for taking the time to present such an interesting snippet in such detail and in a way that is engaging and accessible to even to a layperson.  Well done, and I eagerly look forward to reading more of your posts!]]></description>
			<content:encoded><![CDATA[<p>Long time reader, first time poster.  I don&#8217;t want to take up a lot of your time because I&#8217;ll freely admit the math is beyond me practically (if not conceptually&#8230;); the writing, however, is excellent!  Thank you, Casey, for taking the time to present such an interesting snippet in such detail and in a way that is engaging and accessible to even to a layperson.  Well done, and I eagerly look forward to reading more of your posts!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Lestibournes		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-184487</link>

		<dc:creator><![CDATA[Lestibournes]]></dc:creator>
		<pubDate>Thu, 27 Dec 2012 16:45:25 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-184487</guid>

					<description><![CDATA[Is it that the plane is being created at the (0,0,0) of the world instead of the opbject being manipulated, or vice versa?

I also thought maybe it was being re-created over and over again as you move the cursor in a position relative to the camera or cursor, or relative to the object which has since moved from its original position.]]></description>
			<content:encoded><![CDATA[<p>Is it that the plane is being created at the (0,0,0) of the world instead of the opbject being manipulated, or vice versa?</p>
<p>I also thought maybe it was being re-created over and over again as you move the cursor in a position relative to the camera or cursor, or relative to the object which has since moved from its original position.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Marco Mustapic		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-184235</link>

		<dc:creator><![CDATA[Marco Mustapic]]></dc:creator>
		<pubDate>Thu, 27 Dec 2012 15:25:35 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-184235</guid>

					<description><![CDATA[Haven&#039;t thought much about the bug, but I love the clouds in the screenshot.]]></description>
			<content:encoded><![CDATA[<p>Haven&#8217;t thought much about the bug, but I love the clouds in the screenshot.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: sebastian		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-184231</link>

		<dc:creator><![CDATA[sebastian]]></dc:creator>
		<pubDate>Thu, 27 Dec 2012 15:24:43 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-184231</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-180875&quot;&gt;Casey Muratori&lt;/a&gt;.

That actually made me laugh out loud :D]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-180875">Casey Muratori</a>.</p>
<p>That actually made me laugh out loud :D</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Blow		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-181473</link>

		<dc:creator><![CDATA[Jonathan Blow]]></dc:creator>
		<pubDate>Thu, 27 Dec 2012 06:06:27 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-181473</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-178740&quot;&gt;Pritchard&lt;/a&gt;.

If you are talking about 3D space only, then rotors are actually the same things as Quaternions. They just let you generalize to rotating 2D things directly without having to do the shenanigans you normally have to do. (Except actually, they do the same shenanigans, it&#039;s just they do them in  way that is abstracted into the basic way they work).

I am a fan of Geometric Algebra in general, and I use that kind of reasoning pretty often when I do math on paper. One doesn&#039;t tend to do it in code though.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-178740">Pritchard</a>.</p>
<p>If you are talking about 3D space only, then rotors are actually the same things as Quaternions. They just let you generalize to rotating 2D things directly without having to do the shenanigans you normally have to do. (Except actually, they do the same shenanigans, it&#8217;s just they do them in  way that is abstracted into the basic way they work).</p>
<p>I am a fan of Geometric Algebra in general, and I use that kind of reasoning pretty often when I do math on paper. One doesn&#8217;t tend to do it in code though.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: JKaniarz		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-181421</link>

		<dc:creator><![CDATA[JKaniarz]]></dc:creator>
		<pubDate>Thu, 27 Dec 2012 05:44:50 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-181421</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-180971&quot;&gt;Casey Muratori&lt;/a&gt;.

Actually I was just thinking about the part after you&#039;ve selected your object and direction. Wouldn&#039;t the translation be: position&#039;=ray_origin + t*ray_direction where t  is calculated in screen space as
t = dot(ss_mouse_current- ss_mouse_down, ss_ray_direction) /length(ss_ray_direction) 
(In case I have a math error... the formula is supposed to be the screen space distance of mouse travel along the screen space projected translation vector)

Actually as I type this I realized the issue. While it would work at a basic level, the object wouldn&#039;t track the mouse perfectly unless the direction vector was just the right length. Calculating that length would be as much math as just doing it your way. (if not more because of perspective correction)

Thanks for the detailed response!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-180971">Casey Muratori</a>.</p>
<p>Actually I was just thinking about the part after you&#8217;ve selected your object and direction. Wouldn&#8217;t the translation be: position&#8217;=ray_origin + t*ray_direction where t  is calculated in screen space as<br />
t = dot(ss_mouse_current- ss_mouse_down, ss_ray_direction) /length(ss_ray_direction)<br />
(In case I have a math error&#8230; the formula is supposed to be the screen space distance of mouse travel along the screen space projected translation vector)</p>
<p>Actually as I type this I realized the issue. While it would work at a basic level, the object wouldn&#8217;t track the mouse perfectly unless the direction vector was just the right length. Calculating that length would be as much math as just doing it your way. (if not more because of perspective correction)</p>
<p>Thanks for the detailed response!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Casey Muratori		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-180971</link>

		<dc:creator><![CDATA[Casey Muratori]]></dc:creator>
		<pubDate>Thu, 27 Dec 2012 04:29:40 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-180971</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-177506&quot;&gt;JKaniarz&lt;/a&gt;.

I&#039;m not sure if you&#039;re asking the general question, or just specifically for dragging the transform manipulator.  If you&#039;re just asking about dragging:

The dragging behavior has to feel right, as if you have &quot;grabbed&quot; a point on the object or manipulator and are &quot;pulling&quot; it across the screen.  In order to do this, you need a way to relate a position on the screen with a position in world space.  If you only project forward to world space, you won&#039;t have any idea what to set the actual coordinates of the object to in order to make it appear as if it is attached to the cursor as the user drags it around.  Ie., you can project the object&#039;s location into screen space, and then you can know how far in screen space they have moved it, but then _how do you know how far in world space they have moved it_?  You have to back-project into world space at some point, so you will still be faced with the 3D math problem at that point.

If you were asking why we use this in general:

1) It is much less expensive to project a single mouse ray back into world space than it is to project all the objects into world space onto the screen to test them for picking.

2) Projecting things onto the screen is always a little dicey, because things explode when you get close to the viewpoint, so you would have to make sure you actually did things properly with the projection and clipping and so on, which is actually somewhat involved to do right.  Back-projecting the mouse ray, on the other hand, is pretty trivial and only takes a few lines of code.

3) In order to pick things in the properly sorted order (ie., things closest to the camera get picked first), you still have to remember things like the depth of each triangle that you&#039;re testing, and you have to interpolate that depth in a perspectively-correct way, too, to get the depth at the intersection point, etc., etc.  Either that or you&#039;d have to use feedback or render a hit-testing buffer through the GPU with ids that let you identify the objects in question, all of which ends up being a lot more code with a lot more hardware dependence than the simple back-project-the-mouse method.

4) A variety of other reasons I&#039;m not thinking of at the moment.

- Casey]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-177506">JKaniarz</a>.</p>
<p>I&#8217;m not sure if you&#8217;re asking the general question, or just specifically for dragging the transform manipulator.  If you&#8217;re just asking about dragging:</p>
<p>The dragging behavior has to feel right, as if you have &#8220;grabbed&#8221; a point on the object or manipulator and are &#8220;pulling&#8221; it across the screen.  In order to do this, you need a way to relate a position on the screen with a position in world space.  If you only project forward to world space, you won&#8217;t have any idea what to set the actual coordinates of the object to in order to make it appear as if it is attached to the cursor as the user drags it around.  Ie., you can project the object&#8217;s location into screen space, and then you can know how far in screen space they have moved it, but then _how do you know how far in world space they have moved it_?  You have to back-project into world space at some point, so you will still be faced with the 3D math problem at that point.</p>
<p>If you were asking why we use this in general:</p>
<p>1) It is much less expensive to project a single mouse ray back into world space than it is to project all the objects into world space onto the screen to test them for picking.</p>
<p>2) Projecting things onto the screen is always a little dicey, because things explode when you get close to the viewpoint, so you would have to make sure you actually did things properly with the projection and clipping and so on, which is actually somewhat involved to do right.  Back-projecting the mouse ray, on the other hand, is pretty trivial and only takes a few lines of code.</p>
<p>3) In order to pick things in the properly sorted order (ie., things closest to the camera get picked first), you still have to remember things like the depth of each triangle that you&#8217;re testing, and you have to interpolate that depth in a perspectively-correct way, too, to get the depth at the intersection point, etc., etc.  Either that or you&#8217;d have to use feedback or render a hit-testing buffer through the GPU with ids that let you identify the objects in question, all of which ends up being a lot more code with a lot more hardware dependence than the simple back-project-the-mouse method.</p>
<p>4) A variety of other reasons I&#8217;m not thinking of at the moment.</p>
<p>&#8211; Casey</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Casey Muratori		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-180875</link>

		<dc:creator><![CDATA[Casey Muratori]]></dc:creator>
		<pubDate>Thu, 27 Dec 2012 04:08:11 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-180875</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176878&quot;&gt;Stefan Grosser&lt;/a&gt;.

&quot;The Witness: Tactics&quot; will be available exclusively as DLC to anyone who pre-orders &quot;The Witness: Collectors&#039; Edition&quot; through select retailers before April 1st.  This will also be the only way to get the Witness-themed swimsuit DLC for &quot;Braid or Alive: Beach Volleyball&quot;.

- Casey]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176878">Stefan Grosser</a>.</p>
<p>&#8220;The Witness: Tactics&#8221; will be available exclusively as DLC to anyone who pre-orders &#8220;The Witness: Collectors&#8217; Edition&#8221; through select retailers before April 1st.  This will also be the only way to get the Witness-themed swimsuit DLC for &#8220;Braid or Alive: Beach Volleyball&#8221;.</p>
<p>&#8211; Casey</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Casey Muratori		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-180781</link>

		<dc:creator><![CDATA[Casey Muratori]]></dc:creator>
		<pubDate>Thu, 27 Dec 2012 03:53:04 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-180781</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176531&quot;&gt;TaiSekimori&lt;/a&gt;.

There are a lot of things about the island that are still in progress / placeholder / etc., but this bug doesn&#039;t have anything to do with any rendering glitches or unfinished geometry you might see in the screenshots.  The bug only affects the translation manipulator.

- Casey]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176531">TaiSekimori</a>.</p>
<p>There are a lot of things about the island that are still in progress / placeholder / etc., but this bug doesn&#8217;t have anything to do with any rendering glitches or unfinished geometry you might see in the screenshots.  The bug only affects the translation manipulator.</p>
<p>&#8211; Casey</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mar		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-178792</link>

		<dc:creator><![CDATA[Mar]]></dc:creator>
		<pubDate>Wed, 26 Dec 2012 21:55:36 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-178792</guid>

					<description><![CDATA[Well, there&#039;s nothing wrong with the pseudocode :)
Except that if you want a semiinfinite ray, you should make sure that t is &#062; 0.]]></description>
			<content:encoded><![CDATA[<p>Well, there&#8217;s nothing wrong with the pseudocode :)<br />
Except that if you want a semiinfinite ray, you should make sure that t is &gt; 0.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Pritchard		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-178740</link>

		<dc:creator><![CDATA[Pritchard]]></dc:creator>
		<pubDate>Wed, 26 Dec 2012 21:41:11 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-178740</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176877&quot;&gt;Jonathan Blow&lt;/a&gt;.

How about rotors?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176877">Jonathan Blow</a>.</p>
<p>How about rotors?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Michael McHenry		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-178086</link>

		<dc:creator><![CDATA[Michael McHenry]]></dc:creator>
		<pubDate>Wed, 26 Dec 2012 19:21:22 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-178086</guid>

					<description><![CDATA[It&#039;s pretty clear to see that the people who are right here are quite right. As a person who has written several implementations of procedural generation of planet-sized objects, I feel silly for not realizing the true problem sooner.

That must have been an awfully fun puzzle to solve. Thanks for sharing!]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s pretty clear to see that the people who are right here are quite right. As a person who has written several implementations of procedural generation of planet-sized objects, I feel silly for not realizing the true problem sooner.</p>
<p>That must have been an awfully fun puzzle to solve. Thanks for sharing!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: JKaniarz		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-177506</link>

		<dc:creator><![CDATA[JKaniarz]]></dc:creator>
		<pubDate>Wed, 26 Dec 2012 18:34:40 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-177506</guid>

					<description><![CDATA[Pardon my ignorance, I&#039;ve always used a library for this type of stuff, but why do you convert the mouse into world space instead of projecting your object axes into screen space and calculate your offset with 2D math?]]></description>
			<content:encoded><![CDATA[<p>Pardon my ignorance, I&#8217;ve always used a library for this type of stuff, but why do you convert the mouse into world space instead of projecting your object axes into screen space and calculate your offset with 2D math?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Daniel R. Maciel		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-177292</link>

		<dc:creator><![CDATA[Daniel R. Maciel]]></dc:creator>
		<pubDate>Wed, 26 Dec 2012 15:09:36 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-177292</guid>

					<description><![CDATA[(Actually, you might be inside a geometry picking back facing planes... long shot)]]></description>
			<content:encoded><![CDATA[<p>(Actually, you might be inside a geometry picking back facing planes&#8230; long shot)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Daniel R. Maciel		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-177291</link>

		<dc:creator><![CDATA[Daniel R. Maciel]]></dc:creator>
		<pubDate>Wed, 26 Dec 2012 15:08:40 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-177291</guid>

					<description><![CDATA[Is it picking back-facing planes from the geometry behind you? :)]]></description>
			<content:encoded><![CDATA[<p>Is it picking back-facing planes from the geometry behind you? :)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Stefan Grosser		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176878</link>

		<dc:creator><![CDATA[Stefan Grosser]]></dc:creator>
		<pubDate>Wed, 26 Dec 2012 09:04:29 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-176878</guid>

					<description><![CDATA[Can we expect a The Witness Tactics when this come out?]]></description>
			<content:encoded><![CDATA[<p>Can we expect a The Witness Tactics when this come out?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Blow		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176877</link>

		<dc:creator><![CDATA[Jonathan Blow]]></dc:creator>
		<pubDate>Wed, 26 Dec 2012 08:53:43 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-176877</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176875&quot;&gt;Jonathan Blow&lt;/a&gt;.

And let me just follow this up by saying: Quaternions are a very serious thing. Without understanding them, one probably can&#039;t become a good 3D programmer. I recommend learning how they work, as they solve a lot of really basic problems.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176875">Jonathan Blow</a>.</p>
<p>And let me just follow this up by saying: Quaternions are a very serious thing. Without understanding them, one probably can&#8217;t become a good 3D programmer. I recommend learning how they work, as they solve a lot of really basic problems.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Blow		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176875</link>

		<dc:creator><![CDATA[Jonathan Blow]]></dc:creator>
		<pubDate>Wed, 26 Dec 2012 08:44:55 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-176875</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176637&quot;&gt;d&lt;/a&gt;.

Well, Wikipedia is not necessarily supposed to be a good place to learn math. It&#039;s a reference. 

If you are going to let an explanation you don&#039;t like sour you on an entire concept, well, that does not seem very productive toward being one of the Smart People In Game Programming. There are lots of bad explanations out there; the key is just finding the ones that are maximally useful to you at the current time.

For an extremely stripped-down summary (it won&#039;t tell you all that much, but it is easy to understand), see Paul Bourke&#039;s code documentation: http://dkerr.com/Quaternions.htm

For something that will give you more intuition, but is still not bad to follow, see David Eberly&#039;s &quot;Quaternion Algebra and Calculus&quot;: https://dl.dropbox.com/u/2970717/quaternions.pdf

From there, you can try a book like &quot;Visualizing Quaternions&quot; by Hanson... and then maybe &quot;Hypercomplex Numbers&quot; by Kantor and Solodovnikov, if you want to see more about how they fit into the system that goes Real -&gt; Complex -&gt; Quaternion -&gt; Octonion.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176637">d</a>.</p>
<p>Well, Wikipedia is not necessarily supposed to be a good place to learn math. It&#8217;s a reference. </p>
<p>If you are going to let an explanation you don&#8217;t like sour you on an entire concept, well, that does not seem very productive toward being one of the Smart People In Game Programming. There are lots of bad explanations out there; the key is just finding the ones that are maximally useful to you at the current time.</p>
<p>For an extremely stripped-down summary (it won&#8217;t tell you all that much, but it is easy to understand), see Paul Bourke&#8217;s code documentation: <a href="http://dkerr.com/Quaternions.htm" rel="nofollow ugc">http://dkerr.com/Quaternions.htm</a></p>
<p>For something that will give you more intuition, but is still not bad to follow, see David Eberly&#8217;s &#8220;Quaternion Algebra and Calculus&#8221;: <a href="https://dl.dropbox.com/u/2970717/quaternions.pdf" rel="nofollow ugc">https://dl.dropbox.com/u/2970717/quaternions.pdf</a></p>
<p>From there, you can try a book like &#8220;Visualizing Quaternions&#8221; by Hanson&#8230; and then maybe &#8220;Hypercomplex Numbers&#8221; by Kantor and Solodovnikov, if you want to see more about how they fit into the system that goes Real -> Complex -> Quaternion -> Octonion.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Pritchard		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176639</link>

		<dc:creator><![CDATA[Pritchard]]></dc:creator>
		<pubDate>Wed, 26 Dec 2012 05:54:32 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-176639</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-175682&quot;&gt;Jonathan Blow&lt;/a&gt;.

GOOD.  Now I&#039;ll buy it for sure.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-175682">Jonathan Blow</a>.</p>
<p>GOOD.  Now I&#8217;ll buy it for sure.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: d		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176637</link>

		<dc:creator><![CDATA[d]]></dc:creator>
		<pubDate>Wed, 26 Dec 2012 05:44:37 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-176637</guid>

					<description><![CDATA[&lt;a href=&quot;http://en.wikipedia.org/wiki/Quaternion&quot; rel=&quot;nofollow&quot;&gt;This&lt;/a&gt; by the way, is why I can&#039;t be bothered to learn. That page elevates the obtuseness of the Wikipedia math article to self-parody status.

First sentence:

&lt;q&gt;In mathematics, the quaternions are a number system that extends the complex numbers.&lt;/q&gt;

What? This is like saying in the first sentence of an article about tangerines that &quot;Tangerine is a word.&quot; It continues:

&lt;q&gt;They were first described by Irish mathematician William Rowan Hamilton in 1843[1][2] and applied to mechanics in three-dimensional space.&lt;/q&gt;

Thanks for the history lesson, but it still hasen&#039;t explained anything.

&lt;q&gt;A feature of quaternions is that the product of two quaternions is noncommutative.&lt;/q&gt;

Hmm... okay. &quot;A feature of the word tangerine is that it has 9 letters.&quot;

&lt;q&gt;Hamilton defined a quaternion as the quotient of two directed lines in a three-dimensional space[3] or equivalently as the quotient of two vectors.[4] Quaternions can also be represented as the sum of a scalar and a vector.

Quaternions find uses in both theoretical and applied mathematics, in particular for calculations involving three-dimensional rotations such as in three-dimensional computer graphics and computer vision. They can be used alongside other methods, such as Euler angles and rotation matrices, or as an alternative to them depending on the application.&lt;/q&gt;

Finally! Now it&#039;s going to go into detail, right?

&lt;q&gt;In modern mathematical language, quaternions form a four-dimensional associative normed division algebra over the real numbers, and thus also form a domain. In fact, the quaternions were the first noncommutative division algebra to be discovered.[5] The algebra of quaternions is often denoted by H (for Hamilton), or in blackboard bold by  (Unicode U+210D, ℍ). It can also be given by the Clifford algebra classifications Cℓ0,2(R) ≅ Cℓ03,0(R). The algebra H holds a special place in analysis since, according to the Frobenius theorem, it is one of only two finite-dimensional division rings containing the real numbers as a proper subring, the other being the complex numbers.

The unit quaternions can therefore be thought of as a choice of a group structure on the 3-sphere  that gives the group Spin(3), which is isomorphic to SU(2) and also to the universal cover of SO(3).&lt;/q&gt;

Are you kidding me? If you think in terms of concepts like these why are you reading a basic math article? The only thing in that whole wall of text that&#039;s of any use to a layperson is the notation.]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Quaternion" rel="nofollow">This</a> by the way, is why I can&#8217;t be bothered to learn. That page elevates the obtuseness of the Wikipedia math article to self-parody status.</p>
<p>First sentence:</p>
<p><q>In mathematics, the quaternions are a number system that extends the complex numbers.</q></p>
<p>What? This is like saying in the first sentence of an article about tangerines that &#8220;Tangerine is a word.&#8221; It continues:</p>
<p><q>They were first described by Irish mathematician William Rowan Hamilton in 1843[1][2] and applied to mechanics in three-dimensional space.</q></p>
<p>Thanks for the history lesson, but it still hasen&#8217;t explained anything.</p>
<p><q>A feature of quaternions is that the product of two quaternions is noncommutative.</q></p>
<p>Hmm&#8230; okay. &#8220;A feature of the word tangerine is that it has 9 letters.&#8221;</p>
<p><q>Hamilton defined a quaternion as the quotient of two directed lines in a three-dimensional space[3] or equivalently as the quotient of two vectors.[4] Quaternions can also be represented as the sum of a scalar and a vector.</p>
<p>Quaternions find uses in both theoretical and applied mathematics, in particular for calculations involving three-dimensional rotations such as in three-dimensional computer graphics and computer vision. They can be used alongside other methods, such as Euler angles and rotation matrices, or as an alternative to them depending on the application.</q></p>
<p>Finally! Now it&#8217;s going to go into detail, right?</p>
<p><q>In modern mathematical language, quaternions form a four-dimensional associative normed division algebra over the real numbers, and thus also form a domain. In fact, the quaternions were the first noncommutative division algebra to be discovered.[5] The algebra of quaternions is often denoted by H (for Hamilton), or in blackboard bold by  (Unicode U+210D, ℍ). It can also be given by the Clifford algebra classifications Cℓ0,2(R) ≅ Cℓ03,0(R). The algebra H holds a special place in analysis since, according to the Frobenius theorem, it is one of only two finite-dimensional division rings containing the real numbers as a proper subring, the other being the complex numbers.</p>
<p>The unit quaternions can therefore be thought of as a choice of a group structure on the 3-sphere  that gives the group Spin(3), which is isomorphic to SU(2) and also to the universal cover of SO(3).</q></p>
<p>Are you kidding me? If you think in terms of concepts like these why are you reading a basic math article? The only thing in that whole wall of text that&#8217;s of any use to a layperson is the notation.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: d		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176547</link>

		<dc:creator><![CDATA[d]]></dc:creator>
		<pubDate>Wed, 26 Dec 2012 05:06:19 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-176547</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176231&quot;&gt;Tim Romero&lt;/a&gt;.

I don&#039;t understand quaternions and for what I&#039;m doing I don&#039;t care about gimbal lock.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176231">Tim Romero</a>.</p>
<p>I don&#8217;t understand quaternions and for what I&#8217;m doing I don&#8217;t care about gimbal lock.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: TaiSekimori		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176531</link>

		<dc:creator><![CDATA[TaiSekimori]]></dc:creator>
		<pubDate>Wed, 26 Dec 2012 05:01:11 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-176531</guid>

					<description><![CDATA[I don&#039;t know anything about coding, but looking at the picture of the island - has the bug cause the whole island (and the sea) to flatten into a plateau? I feel like the shoreline in the foreground of the image shouldn&#039;t look like that, I can see that some of the trees are submerged, and there&#039;s something weird going with the ship in the background.]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know anything about coding, but looking at the picture of the island &#8211; has the bug cause the whole island (and the sea) to flatten into a plateau? I feel like the shoreline in the foreground of the image shouldn&#8217;t look like that, I can see that some of the trees are submerged, and there&#8217;s something weird going with the ship in the background.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tim Romero		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176285</link>

		<dc:creator><![CDATA[Tim Romero]]></dc:creator>
		<pubDate>Wed, 26 Dec 2012 01:28:16 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-176285</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173978&quot;&gt;Tyler&lt;/a&gt;.

After more reflection I came to the same conclusion as Tyler as to the nature of the problem, although this answer is incomplete: Why does the problem only occur at certain camera angles?

This is because of the nature of the dot product. The dot product goes to zero as two vectors approach 90°. When the camera is facing away from the origin, the ray direction is in the same direction as the ray origin vector, so the dot product is very large. When the camera is turned 90°, it approaches zero, so there is more precision available. At the same time, as the camera rotates 90°, the plane rotates about the axis so it passes closer to the origin, which means the plane_d is also smaller and more precise. This is important because if you add a very small number to a very large number (for instance a small numerator plus a large plane_d), you may just lose all the information in the smaller number to rounding error.

What this means in terms of the ray-plane intersection code is that when the camera is facing toward or away from the origin, the plane_d and numerator are both very large, so the least significant bits may be lost in the dot product. However, when the camera is turned 90°, the plane_d and numerator will be both much closer to zero.

How to fix it? Translating to the origin would certainly solve it, or just using double just in the computation instead of float could be an alternate simpler solution than translating the problem to the origin that also improves precision in other parts of the game. That would have the side effect of making physics computation a bit more expensive, depending on how much this particular function is used in the physics engine and whether the game is running in x64, so I&#039;m betting you didn&#039;t use double to solve the problem.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173978">Tyler</a>.</p>
<p>After more reflection I came to the same conclusion as Tyler as to the nature of the problem, although this answer is incomplete: Why does the problem only occur at certain camera angles?</p>
<p>This is because of the nature of the dot product. The dot product goes to zero as two vectors approach 90°. When the camera is facing away from the origin, the ray direction is in the same direction as the ray origin vector, so the dot product is very large. When the camera is turned 90°, it approaches zero, so there is more precision available. At the same time, as the camera rotates 90°, the plane rotates about the axis so it passes closer to the origin, which means the plane_d is also smaller and more precise. This is important because if you add a very small number to a very large number (for instance a small numerator plus a large plane_d), you may just lose all the information in the smaller number to rounding error.</p>
<p>What this means in terms of the ray-plane intersection code is that when the camera is facing toward or away from the origin, the plane_d and numerator are both very large, so the least significant bits may be lost in the dot product. However, when the camera is turned 90°, the plane_d and numerator will be both much closer to zero.</p>
<p>How to fix it? Translating to the origin would certainly solve it, or just using double just in the computation instead of float could be an alternate simpler solution than translating the problem to the origin that also improves precision in other parts of the game. That would have the side effect of making physics computation a bit more expensive, depending on how much this particular function is used in the physics engine and whether the game is running in x64, so I&#8217;m betting you didn&#8217;t use double to solve the problem.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tim Romero		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176231</link>

		<dc:creator><![CDATA[Tim Romero]]></dc:creator>
		<pubDate>Wed, 26 Dec 2012 00:18:35 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-176231</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-175883&quot;&gt;d&lt;/a&gt;.

Eugh! Euler angles!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-175883">d</a>.</p>
<p>Eugh! Euler angles!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Chrome		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-176065</link>

		<dc:creator><![CDATA[Chrome]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 22:28:49 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-176065</guid>

					<description><![CDATA[You said the origin of the ray is the camera of the user. But isn&#039;t the origin of the coordinate frame usually the camera in 3D games?
Then &quot;ray_origin&quot; in &quot;float numerator = dot_product(plane_normal, ray_origin);&quot; would be the nullvector.]]></description>
			<content:encoded><![CDATA[<p>You said the origin of the ray is the camera of the user. But isn&#8217;t the origin of the coordinate frame usually the camera in 3D games?<br />
Then &#8220;ray_origin&#8221; in &#8220;float numerator = dot_product(plane_normal, ray_origin);&#8221; would be the nullvector.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: d		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-175883</link>

		<dc:creator><![CDATA[d]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 20:08:51 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-175883</guid>

					<description><![CDATA[It once took me two hours to find the bug in this code:

&lt;code&gt;sines.x = sinf(o-&#062;angles.x);
sines.y = sinf(o-&#062;angles.y);
sines.z = sinf(o-&#062;angles.z);
cosines.x = sinf(o-&#062;angles.x);
cosines.y = sinf(o-&#062;angles.y);
cosines.z = sinf(o-&#062;angles.z);&lt;/code&gt;

I don&#039;t think this challenge is for me. Eagerly awaiting the follow-up post and answer.]]></description>
			<content:encoded><![CDATA[<p>It once took me two hours to find the bug in this code:</p>
<p><code>sines.x = sinf(o-&gt;angles.x);<br />
sines.y = sinf(o-&gt;angles.y);<br />
sines.z = sinf(o-&gt;angles.z);<br />
cosines.x = sinf(o-&gt;angles.x);<br />
cosines.y = sinf(o-&gt;angles.y);<br />
cosines.z = sinf(o-&gt;angles.z);</code></p>
<p>I don&#8217;t think this challenge is for me. Eagerly awaiting the follow-up post and answer.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Simon		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-175742</link>

		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 19:25:52 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-175742</guid>

					<description><![CDATA[I&#039;m not an expert but I&#039;ll give it a try.
My though is that numerator is too high and I would fix it by normalizing ray_origin in the dot product.

float numerator = dot_product(plane_normal,  normalize( ray_origin) );

Hope it&#039;s not too stupid.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not an expert but I&#8217;ll give it a try.<br />
My though is that numerator is too high and I would fix it by normalizing ray_origin in the dot product.</p>
<p>float numerator = dot_product(plane_normal,  normalize( ray_origin) );</p>
<p>Hope it&#8217;s not too stupid.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Blow		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-175682</link>

		<dc:creator><![CDATA[Jonathan Blow]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 18:42:20 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-175682</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174674&quot;&gt;Casey Muratori&lt;/a&gt;.

It&#039;ll be in the final game.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174674">Casey Muratori</a>.</p>
<p>It&#8217;ll be in the final game.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Aditya		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-175471</link>

		<dc:creator><![CDATA[Aditya]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 17:12:26 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-175471</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173598&quot;&gt;Aditya&lt;/a&gt;.

Do we have to reverse the normals for some instances depending on if t comes out to be greater than 0 and the values of x,,y, or z have a reverse sign to the normal??
Something like the example given here (http://www.siggraph.org/education/materials/HyperGraph/raytrace/rayplane_intersection.htm)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173598">Aditya</a>.</p>
<p>Do we have to reverse the normals for some instances depending on if t comes out to be greater than 0 and the values of x,,y, or z have a reverse sign to the normal??<br />
Something like the example given here (<a href="http://www.siggraph.org/education/materials/HyperGraph/raytrace/rayplane_intersection.htm" rel="nofollow ugc">http://www.siggraph.org/education/materials/HyperGraph/raytrace/rayplane_intersection.htm</a>)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Casey Muratori		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-175397</link>

		<dc:creator><![CDATA[Casey Muratori]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 16:19:35 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-175397</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174673&quot;&gt;Fabian Giesen&lt;/a&gt;.

Love it :)

- Casey]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174673">Fabian Giesen</a>.</p>
<p>Love it :)</p>
<p>&#8211; Casey</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Casey Muratori		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-175381</link>

		<dc:creator><![CDATA[Casey Muratori]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 16:15:33 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-175381</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174615&quot;&gt;Juan&lt;/a&gt;.

Although that&#039;s certainly a mistake I&#039;ve seen people make, it was not the problem in this case.  As I said earlier in the comments, you _do not_ need to consider code outside the snippet I posted to find the bug.

- Casey]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174615">Juan</a>.</p>
<p>Although that&#8217;s certainly a mistake I&#8217;ve seen people make, it was not the problem in this case.  As I said earlier in the comments, you _do not_ need to consider code outside the snippet I posted to find the bug.</p>
<p>&#8211; Casey</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Casey Muratori		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174674</link>

		<dc:creator><![CDATA[Casey Muratori]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 14:20:31 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174674</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174616&quot;&gt;sebastian&lt;/a&gt;.

Sebastian: I&#039;m afraid I don&#039;t actually know if the rock will be part of the final game or not.  It was not put there for testing purposes, but the island is constantly being reworked and upgraded by Jon and the artists, so the rock may be replaced, refined, or removed as part of that process before the game ships.

- Casey]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174616">sebastian</a>.</p>
<p>Sebastian: I&#8217;m afraid I don&#8217;t actually know if the rock will be part of the final game or not.  It was not put there for testing purposes, but the island is constantly being reworked and upgraded by Jon and the artists, so the rock may be replaced, refined, or removed as part of that process before the game ships.</p>
<p>&#8211; Casey</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Fabian Giesen		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174673</link>

		<dc:creator><![CDATA[Fabian Giesen]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 14:08:40 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174673</guid>

					<description><![CDATA[So here&#039;s my zero-knowledge proof of knowledge! :)

1. To reproduce this bug, you do not need to start a long time ago, but it sure does help if you live in a galaxy far, far away.
2. There&#039;s a very simple fix that gets rid of all the symptoms but not the underlying issue.
3. If it was a meteor rather than a rock floating in the sea, you would&#039;ve noticed this much earlier.
4. In an ideal world, we wouldn&#039;t have this problem.
5. One way to fix this notes that it&#039;s a good thing that lines are linear; and sometimes a little redundancy goes a long way.
6. Another way is based on the realization that while it may be more work, sometimes moving the mountain to the prophet is in fact the right approach.]]></description>
			<content:encoded><![CDATA[<p>So here&#8217;s my zero-knowledge proof of knowledge! :)</p>
<p>1. To reproduce this bug, you do not need to start a long time ago, but it sure does help if you live in a galaxy far, far away.<br />
2. There&#8217;s a very simple fix that gets rid of all the symptoms but not the underlying issue.<br />
3. If it was a meteor rather than a rock floating in the sea, you would&#8217;ve noticed this much earlier.<br />
4. In an ideal world, we wouldn&#8217;t have this problem.<br />
5. One way to fix this notes that it&#8217;s a good thing that lines are linear; and sometimes a little redundancy goes a long way.<br />
6. Another way is based on the realization that while it may be more work, sometimes moving the mountain to the prophet is in fact the right approach.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Aditya		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174621</link>

		<dc:creator><![CDATA[Aditya]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 13:42:58 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174621</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173599&quot;&gt;Casey Muratori&lt;/a&gt;.

Thanx...Ill search it and give back a reply if I get it :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173599">Casey Muratori</a>.</p>
<p>Thanx&#8230;Ill search it and give back a reply if I get it :)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: sebastian		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174616</link>

		<dc:creator><![CDATA[sebastian]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 13:04:01 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174616</guid>

					<description><![CDATA[I&#039;m not sure if this was already made clear, but is this rock going to appear in the final game? I couldn&#039;t quite understand if this was a rock placed for testing purposes or if it&#039;s supposed to be part of the final geography of the island.

I think I would enjoy coming across this rock and remembering this post.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure if this was already made clear, but is this rock going to appear in the final game? I couldn&#8217;t quite understand if this was a rock placed for testing purposes or if it&#8217;s supposed to be part of the final geography of the island.</p>
<p>I think I would enjoy coming across this rock and remembering this post.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juan		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174615</link>

		<dc:creator><![CDATA[Juan]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 12:56:20 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174615</guid>

					<description><![CDATA[may it be a confusion interpreting the parameters of the plane equation? if when you drew the yellow axis displaced at plane_d * plane_normal, and the manipulator and axis where indeed in the plane, that means the plane equation is dot_product(plane_normal, point) == plane_d, but when you solve for t you are solving dot_product(plane_normal, point) + plane_d == 0. if that&#039;s the case, the third line should read  float t = ((plane_d - numerator) / denominator);]]></description>
			<content:encoded><![CDATA[<p>may it be a confusion interpreting the parameters of the plane equation? if when you drew the yellow axis displaced at plane_d * plane_normal, and the manipulator and axis where indeed in the plane, that means the plane equation is dot_product(plane_normal, point) == plane_d, but when you solve for t you are solving dot_product(plane_normal, point) + plane_d == 0. if that&#8217;s the case, the third line should read  float t = ((plane_d &#8211; numerator) / denominator);</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Nachobeard		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174511</link>

		<dc:creator><![CDATA[Nachobeard]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 12:30:24 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174511</guid>

					<description><![CDATA[The ray is intersecting with something behind it (the geometry of the island behind the rock).]]></description>
			<content:encoded><![CDATA[<p>The ray is intersecting with something behind it (the geometry of the island behind the rock).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tim Romero		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174509</link>

		<dc:creator><![CDATA[Tim Romero]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 12:15:11 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174509</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174508&quot;&gt;Tim Romero&lt;/a&gt;.

(Sorry, this was supposed to be a reply to Ted&#039;s comment above but Wordpress got weird when I messed up the captcha.)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174508">Tim Romero</a>.</p>
<p>(Sorry, this was supposed to be a reply to Ted&#8217;s comment above but WordPress got weird when I messed up the captcha.)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tim Romero		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174508</link>

		<dc:creator><![CDATA[Tim Romero]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 12:14:13 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174508</guid>

					<description><![CDATA[I think the reason for the plane normal not being colinear with the Y axis is just because it uses the camera normal in the calculation rather than the direction from the camera to the point.

I think you can ignore problems with the way the ray and plane are calculated. as Casey wrote above: &quot;you do not need to consider things for which I did not post the code, like how I was calculating the plane, or how I generated the cursor ray, and so on. Assume those are all correct.&quot;]]></description>
			<content:encoded><![CDATA[<p>I think the reason for the plane normal not being colinear with the Y axis is just because it uses the camera normal in the calculation rather than the direction from the camera to the point.</p>
<p>I think you can ignore problems with the way the ray and plane are calculated. as Casey wrote above: &#8220;you do not need to consider things for which I did not post the code, like how I was calculating the plane, or how I generated the cursor ray, and so on. Assume those are all correct.&#8221;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tim Romero		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174503</link>

		<dc:creator><![CDATA[Tim Romero]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 12:03:02 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174503</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174040&quot;&gt;Cam&lt;/a&gt;.

Divide by zero will only happen when the ray and plane are parallel because the dot product only returns zero for perpendicular vectors.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174040">Cam</a>.</p>
<p>Divide by zero will only happen when the ray and plane are parallel because the dot product only returns zero for perpendicular vectors.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tim Romero		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174502</link>

		<dc:creator><![CDATA[Tim Romero]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 12:00:20 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174502</guid>

					<description><![CDATA[My first instinct was to check whether the ray direction and plane normal were normalized vectors, but the math works even for non-normalized vectors.]]></description>
			<content:encoded><![CDATA[<p>My first instinct was to check whether the ray direction and plane normal were normalized vectors, but the math works even for non-normalized vectors.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Manuel Araoz		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174251</link>

		<dc:creator><![CDATA[Manuel Araoz]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 09:10:12 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174251</guid>

					<description><![CDATA[Could it be that the rock is far away from the coordinate system&#039;s center so both plane_d and ray_origin are huge resulting in overflow in the dot products?

This would cause the division to be a huge float over a huge float, resulting in erratic floating point operations.]]></description>
			<content:encoded><![CDATA[<p>Could it be that the rock is far away from the coordinate system&#8217;s center so both plane_d and ray_origin are huge resulting in overflow in the dot products?</p>
<p>This would cause the division to be a huge float over a huge float, resulting in erratic floating point operations.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Julien Koenen		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174198</link>

		<dc:creator><![CDATA[Julien Koenen]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 08:48:05 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174198</guid>

					<description><![CDATA[You should test for t &#062; 0 to get an actual &#039;ray&#039; vs plane test instead of a line (extending in both ways)]]></description>
			<content:encoded><![CDATA[<p>You should test for t &gt; 0 to get an actual &#8216;ray&#8217; vs plane test instead of a line (extending in both ways)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ted		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174144</link>

		<dc:creator><![CDATA[Ted]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 07:53:13 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174144</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174031&quot;&gt;Ted&lt;/a&gt;.

So the last guess I would have is that maybe the ray_direction is calculated correctly, but the perspective makes it seem like it&#039;s not pointing in the proper direction. That would at least explain how the intersection point could fail to align with the cursor.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174031">Ted</a>.</p>
<p>So the last guess I would have is that maybe the ray_direction is calculated correctly, but the perspective makes it seem like it&#8217;s not pointing in the proper direction. That would at least explain how the intersection point could fail to align with the cursor.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tyler		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174118</link>

		<dc:creator><![CDATA[Tyler]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 07:37:53 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174118</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173978&quot;&gt;Tyler&lt;/a&gt;.

The solution would be to just translate all of your coordinates so that the origin is near the object you are manipulating.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173978">Tyler</a>.</p>
<p>The solution would be to just translate all of your coordinates so that the origin is near the object you are manipulating.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ted		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174105</link>

		<dc:creator><![CDATA[Ted]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 07:35:32 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174105</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173978&quot;&gt;Tyler&lt;/a&gt;.

The large distance would make t essentially zero out, it&#039;s true, but I got stuck on some problems when I thought about this. First, it seems like since we&#039;re always close by the rock, the dot product involving ray_origin would not change by much, hence this answer would not depend on the camera angle. Second, it does not explain why the intersection point would leave the cursor at any point, as mentioned. That&#039;s what is really grinding at me, it doesn&#039;t seem possible given what&#039;s being returned by the function.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173978">Tyler</a>.</p>
<p>The large distance would make t essentially zero out, it&#8217;s true, but I got stuck on some problems when I thought about this. First, it seems like since we&#8217;re always close by the rock, the dot product involving ray_origin would not change by much, hence this answer would not depend on the camera angle. Second, it does not explain why the intersection point would leave the cursor at any point, as mentioned. That&#8217;s what is really grinding at me, it doesn&#8217;t seem possible given what&#8217;s being returned by the function.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Cam		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174040</link>

		<dc:creator><![CDATA[Cam]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 07:31:49 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174040</guid>

					<description><![CDATA[The &quot;erratic jumping around&quot; part immediately suggested floating point precision error to me - ie the denominator came close to zero. Depending on how your div by zero is set up, I would think occasionally your result is propagating NaNs and sometimes just wildly inaccurate when the ray vector points in certain directions...]]></description>
			<content:encoded><![CDATA[<p>The &#8220;erratic jumping around&#8221; part immediately suggested floating point precision error to me &#8211; ie the denominator came close to zero. Depending on how your div by zero is set up, I would think occasionally your result is propagating NaNs and sometimes just wildly inaccurate when the ray vector points in certain directions&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ted		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174031</link>

		<dc:creator><![CDATA[Ted]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 07:30:18 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174031</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174009&quot;&gt;Ted&lt;/a&gt;.

A problem with what I&#039;ve written is that I find it very implausible that such a simple mistake would be made with ray_direction. Yet something is wrong if it ever leaves the cursor, either with ray_origin or ray_direction.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174009">Ted</a>.</p>
<p>A problem with what I&#8217;ve written is that I find it very implausible that such a simple mistake would be made with ray_direction. Yet something is wrong if it ever leaves the cursor, either with ray_origin or ray_direction.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ted		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-174009</link>

		<dc:creator><![CDATA[Ted]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 07:25:28 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-174009</guid>

					<description><![CDATA[The data returned is always a point on the line passing through the cursor, in the direction of ray_direction. If ray_direction were perpendicular the plane of the user&#039;s camera, the white sphere would always have to be underneath the cursor. Hence we can conclude that since the sphere wasn&#039;t sticking to the cursor, the vector ray_direction has to be something other than described (Alternatively, we can conclude that I&#039;m mistaken and I&#039;ve misunderstood something). 

This provides a possible explanation for Tim&#039;s observation that the normal vector is not quite what it should be to align with the user&#039;s camera, as that calculation would be made using the normal vector to the camera. He believes it should be co-linear with the green vector; I actually think it should appear horizontal with respect to the camera.

If we did something to ray_direction like, say, forget the z-coordinate, we would increase the angle slightly, hence the denominator would increase slightly (this statement is highly dependent on the particular angles involved) which would artificially shrink the distance t, placing the claimed intersection point closer to the camera. This might provide an explanation for why the intersection points were closer than you expected in some cases.

From your &quot;look behind you&quot; hints, I am guessing that the nonworking camera angle is exactly that where the camera lies on the line between the rock and the origin. I&#039;m not yet sure how this might factor in.]]></description>
			<content:encoded><![CDATA[<p>The data returned is always a point on the line passing through the cursor, in the direction of ray_direction. If ray_direction were perpendicular the plane of the user&#8217;s camera, the white sphere would always have to be underneath the cursor. Hence we can conclude that since the sphere wasn&#8217;t sticking to the cursor, the vector ray_direction has to be something other than described (Alternatively, we can conclude that I&#8217;m mistaken and I&#8217;ve misunderstood something). </p>
<p>This provides a possible explanation for Tim&#8217;s observation that the normal vector is not quite what it should be to align with the user&#8217;s camera, as that calculation would be made using the normal vector to the camera. He believes it should be co-linear with the green vector; I actually think it should appear horizontal with respect to the camera.</p>
<p>If we did something to ray_direction like, say, forget the z-coordinate, we would increase the angle slightly, hence the denominator would increase slightly (this statement is highly dependent on the particular angles involved) which would artificially shrink the distance t, placing the claimed intersection point closer to the camera. This might provide an explanation for why the intersection points were closer than you expected in some cases.</p>
<p>From your &#8220;look behind you&#8221; hints, I am guessing that the nonworking camera angle is exactly that where the camera lies on the line between the rock and the origin. I&#8217;m not yet sure how this might factor in.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Blow		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173980</link>

		<dc:creator><![CDATA[Jonathan Blow]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 07:22:36 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-173980</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173898&quot;&gt;Casey Muratori&lt;/a&gt;.

I think there is a max reply depth. At some point we ought to update this theme...]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173898">Casey Muratori</a>.</p>
<p>I think there is a max reply depth. At some point we ought to update this theme&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tyler		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173978</link>

		<dc:creator><![CDATA[Tyler]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 07:22:13 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-173978</guid>

					<description><![CDATA[It&#039;s because of lack of precision in ieee754. The translation manipulator needs three points: two on the axis and the camera. However, on your rock that is far, far away from the main land the coordinates of the three points are very large. But the distance between the object you&#039;re manipulating and the camera is relatively small. When you plug these values into a dot product, you will basically be multiplying two large numbers together, giving you a very large number. In the very large number, it will just truncate the least significant bits of the product. The least significant bits hold important information about the distance between the camera and object, since the most significant bits are busy telling you how far you are from the origin. The floating point numbers can&#039;t keep track of the large distance from the mainland, yet also the small distance of the camera and object. ieee754 can&#039;t hold these values since the fraction of a floating point number (single precision) is just 23 bits. It&#039;s not infinite precision. It will just round away the important information that you want: the location of the cursor. This is why you didn&#039;t have problems in the test world, all of the coordinates are close to the center of the universe and thus small. And your hint of looking behind you makes sense, since it shows you&#039;re far from the island and thus the coordinates are large.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s because of lack of precision in ieee754. The translation manipulator needs three points: two on the axis and the camera. However, on your rock that is far, far away from the main land the coordinates of the three points are very large. But the distance between the object you&#8217;re manipulating and the camera is relatively small. When you plug these values into a dot product, you will basically be multiplying two large numbers together, giving you a very large number. In the very large number, it will just truncate the least significant bits of the product. The least significant bits hold important information about the distance between the camera and object, since the most significant bits are busy telling you how far you are from the origin. The floating point numbers can&#8217;t keep track of the large distance from the mainland, yet also the small distance of the camera and object. ieee754 can&#8217;t hold these values since the fraction of a floating point number (single precision) is just 23 bits. It&#8217;s not infinite precision. It will just round away the important information that you want: the location of the cursor. This is why you didn&#8217;t have problems in the test world, all of the coordinates are close to the center of the universe and thus small. And your hint of looking behind you makes sense, since it shows you&#8217;re far from the island and thus the coordinates are large.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Casey Muratori		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173898</link>

		<dc:creator><![CDATA[Casey Muratori]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 07:00:00 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-173898</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173709&quot;&gt;Steve&lt;/a&gt;.

Regarding Ted&#039;s question above (WordPress is not letting me reply directly for some reason): the plane updates continuously, so when the user rotates the camera, the plane is recalculated.  And I will reiterate that you can find the bug solely with what I posted in the article - you do not need to consider things for which I did not post the code, like how I was calculating the plane, or how I generated the cursor ray, and so on.  Assume those are all correct.

- Casey]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173709">Steve</a>.</p>
<p>Regarding Ted&#8217;s question above (WordPress is not letting me reply directly for some reason): the plane updates continuously, so when the user rotates the camera, the plane is recalculated.  And I will reiterate that you can find the bug solely with what I posted in the article &#8211; you do not need to consider things for which I did not post the code, like how I was calculating the plane, or how I generated the cursor ray, and so on.  Assume those are all correct.</p>
<p>&#8211; Casey</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ted		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173768</link>

		<dc:creator><![CDATA[Ted]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 05:27:50 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-173768</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173763&quot;&gt;Casey Muratori&lt;/a&gt;.

Is the plane only instantiated once, or does it update as you move the camera to continually face it?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173763">Casey Muratori</a>.</p>
<p>Is the plane only instantiated once, or does it update as you move the camera to continually face it?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Casey Muratori		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173763</link>

		<dc:creator><![CDATA[Casey Muratori]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 05:13:30 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-173763</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173727&quot;&gt;Jonathan Blow&lt;/a&gt;.

Roger that - I will only answer clarification questions, then :)

- Casey]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173727">Jonathan Blow</a>.</p>
<p>Roger that &#8211; I will only answer clarification questions, then :)</p>
<p>&#8211; Casey</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Blow		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173727</link>

		<dc:creator><![CDATA[Jonathan Blow]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 05:03:00 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-173727</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173597&quot;&gt;Casey Muratori&lt;/a&gt;.

Hah. We&#039;ll see if anyone gets it...

On the one hand, it is fairly subtle, but on the other hand, no it isn&#039;t, understanding this issue is absolutely required to be a good game programmer. So, uhhh... we&#039;ll see who gets it!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173597">Casey Muratori</a>.</p>
<p>Hah. We&#8217;ll see if anyone gets it&#8230;</p>
<p>On the one hand, it is fairly subtle, but on the other hand, no it isn&#8217;t, understanding this issue is absolutely required to be a good game programmer. So, uhhh&#8230; we&#8217;ll see who gets it!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Steve		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173709</link>

		<dc:creator><![CDATA[Steve]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 04:45:27 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-173709</guid>

					<description><![CDATA[I&#039;m far from being a serious (or even novice, really) 3D programmer, but I&#039;ll take a stab in the dark at it: the bug occurs when the viewing direction is perpindicular to the plane normal, causing the dot product to return zero. So ray_vs_plane() is just returning the ray origin, which would explain why the intersection point is too close to the camera.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m far from being a serious (or even novice, really) 3D programmer, but I&#8217;ll take a stab in the dark at it: the bug occurs when the viewing direction is perpindicular to the plane normal, causing the dot product to return zero. So ray_vs_plane() is just returning the ray origin, which would explain why the intersection point is too close to the camera.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Casey Muratori		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173599</link>

		<dc:creator><![CDATA[Casey Muratori]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 04:18:05 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-173599</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173598&quot;&gt;Aditya&lt;/a&gt;.

Thanks for the semicolon catch, Aditya - it was a typo, there should have been a semicolon there.  I have updated the article to include it.

As for your question: this routine uses the standard &quot;solve for t&quot; method of finding the intersection point between the ray and the plane.  You can actually search for &quot;ray plane intersection&quot; or other such things on Google, and you will get a lot of hits describing this exact math for this exact problem if you would like to read a complete description (or two :)

As to what the function returns, because both the plane normal and the ray direction are unit vectors, the resulting t is the distance along the ray you would have to go from the ray origin to get to the intersection point.  Thus the return value from the function, ray_origin + t*ray_direction, is the intersection point of the ray and the plane.

- Casey]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173598">Aditya</a>.</p>
<p>Thanks for the semicolon catch, Aditya &#8211; it was a typo, there should have been a semicolon there.  I have updated the article to include it.</p>
<p>As for your question: this routine uses the standard &#8220;solve for t&#8221; method of finding the intersection point between the ray and the plane.  You can actually search for &#8220;ray plane intersection&#8221; or other such things on Google, and you will get a lot of hits describing this exact math for this exact problem if you would like to read a complete description (or two :)</p>
<p>As to what the function returns, because both the plane normal and the ray direction are unit vectors, the resulting t is the distance along the ray you would have to go from the ray origin to get to the intersection point.  Thus the return value from the function, ray_origin + t*ray_direction, is the intersection point of the ray and the plane.</p>
<p>&#8211; Casey</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Aditya		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173598</link>

		<dc:creator><![CDATA[Aditya]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 04:00:56 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-173598</guid>

					<description><![CDATA[Can I know what exactly is the variable &#039;t&#039; calculating....Is the semicolon for &quot;return&quot; missing?? I don&#039;t think that in the return ray_origin (the return is giving the new position for the object isn&#039;t it??) needs to be added to t*ray_direction coz already in the &#039;t&#039; the numerator&#039;s value (plane_d + numerator) is calculating that new position...]]></description>
			<content:encoded><![CDATA[<p>Can I know what exactly is the variable &#8216;t&#8217; calculating&#8230;.Is the semicolon for &#8220;return&#8221; missing?? I don&#8217;t think that in the return ray_origin (the return is giving the new position for the object isn&#8217;t it??) needs to be added to t*ray_direction coz already in the &#8216;t&#8217; the numerator&#8217;s value (plane_d + numerator) is calculating that new position&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Casey Muratori		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173597</link>

		<dc:creator><![CDATA[Casey Muratori]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 03:58:53 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-173597</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173535&quot;&gt;Tim Romero&lt;/a&gt;.

Should I do &quot;hot and cold&quot;, or should I just let everyone answer without commenting? ;)

- Casey]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173535">Tim Romero</a>.</p>
<p>Should I do &#8220;hot and cold&#8221;, or should I just let everyone answer without commenting? ;)</p>
<p>&#8211; Casey</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tim Romero		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173536</link>

		<dc:creator><![CDATA[Tim Romero]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 02:51:56 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-173536</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173535&quot;&gt;Tim Romero&lt;/a&gt;.

*The section of the plane visible from the camera would be very small, causing the intersection point to not move far with the _mouse_ movement.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173535">Tim Romero</a>.</p>
<p>*The section of the plane visible from the camera would be very small, causing the intersection point to not move far with the _mouse_ movement.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tim Romero		</title>
		<link>https://the-witness.net/news/2012/12/a-cliffside-cliffhanger/comment-page-1/#comment-173535</link>

		<dc:creator><![CDATA[Tim Romero]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 02:49:47 +0000</pubDate>
		<guid isPermaLink="false">https://the-witness.net/news/?p=1989#comment-173535</guid>

					<description><![CDATA[You say the sphere was much closer to the camera than it should have been, so my guess is that you were picking the wrong points to define your plane and the plane you were using was sometimes passing too close to the camera, or else behind it, because it wasn&#039;t actually positioned on the manipulator center like you thought it was by checking the plane offset from afar.

That ray vs plane intersection code still returns an intersection point in the negative direction when the ray is pointing away from the plane, so if the plane went behind the camera, it would result in a point being picked behind the camera. This could explain some of the disappearing spheres you mentioned, although depending on how the non-intersections are handled it seems like that should cause translation to be backwards which you didn&#039;t mention. If the plane were just coming very close to the camera, it would explain why translation would be very slow. The section of the plane visible from the camera would be very small, causing the intersection point to not move far with the camera movement. If the plane perfectly intersected the camera position, it would be impossible to translate at all.

The screenshot showing the plane normal might not be right. If the plane is always oriented to face toward the camera as much as possible, shouldn&#039;t the yellow plane normal and the Y axis appear co-linear from the camera&#039;s perspective?]]></description>
			<content:encoded><![CDATA[<p>You say the sphere was much closer to the camera than it should have been, so my guess is that you were picking the wrong points to define your plane and the plane you were using was sometimes passing too close to the camera, or else behind it, because it wasn&#8217;t actually positioned on the manipulator center like you thought it was by checking the plane offset from afar.</p>
<p>That ray vs plane intersection code still returns an intersection point in the negative direction when the ray is pointing away from the plane, so if the plane went behind the camera, it would result in a point being picked behind the camera. This could explain some of the disappearing spheres you mentioned, although depending on how the non-intersections are handled it seems like that should cause translation to be backwards which you didn&#8217;t mention. If the plane were just coming very close to the camera, it would explain why translation would be very slow. The section of the plane visible from the camera would be very small, causing the intersection point to not move far with the camera movement. If the plane perfectly intersected the camera position, it would be impossible to translate at all.</p>
<p>The screenshot showing the plane normal might not be right. If the plane is always oriented to face toward the camera as much as possible, shouldn&#8217;t the yellow plane normal and the Y axis appear co-linear from the camera&#8217;s perspective?</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
