<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/10051" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2014-08-20T19:37:34+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/10051</id>

		<entry>
		<author><name><![CDATA[DevO]]></name></author>
		<updated>2014-08-20T19:37:34+00:00</updated>

		<published>2014-08-20T19:37:34+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33849#p33849</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33849#p33849"/>
		<title type="html"><![CDATA[Re: Regarding concave collision detection (Chap 10 RTCD)[SOL]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33849#p33849"><![CDATA[
"Real-Time Collision Detection" is one of my favorite books in this field.<br>Do some one know other books like this one ?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=453">DevO</a> — Wed Aug 20, 2014 7:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mobeen]]></name></author>
		<updated>2014-08-12T08:22:04+00:00</updated>

		<published>2014-08-12T08:22:04+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33793#p33793</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33793#p33793"/>
		<title type="html"><![CDATA[Re: Regarding concave collision detection (Chap 10 RTCD)]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33793#p33793"><![CDATA[
OK guys as usual. After posting question on the forum I get an answer. The following code works for me and I get the correct results now.<br><div class="codebox"><p>Code: </p><pre><code>bool ConcaveCollision() {//clear depth and stencil buffersglClearDepth(1.0f);glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);//disable color writesglColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE); //enable depth buffer writes and set depth test to always passglDepthFunc(GL_ALWAYS);glDepthMask(GL_TRUE);//render the first object edgesglDisable(GL_STENCIL_TEST); //draw edges of object BglDisable(GL_CULL_FACE);glPushAttrib(GL_POLYGON_BIT);glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); DrawObjectB(false); glPopAttrib();//set the depth function to less and disable depth buffer writesglDepthFunc(GL_LESS);glDepthMask(GL_FALSE);  glEnable(GL_STENCIL_TEST);glEnable(GL_CULL_FACE);   //set stencil test to increment the value and cull the back faces to render front faces onlyglStencilOp(GL_KEEP, GL_KEEP, GL_INCR); glCullFace(GL_BACK);//draw object ADrawObjectA(false);//set stencil test to decrement the value and cull the front faces to render back faces onlyglStencilOp(GL_KEEP, GL_KEEP, GL_DECR);glCullFace(GL_FRONT);   glDepthFunc(GL_GREATER);//issue a hardware query to see how many samples passedglBeginQuery(GL_SAMPLES_PASSED, query);//draw object ADrawObjectA(false);glEndQuery(GL_SAMPLES_PASSED);  glGetQueryObjectuiv(query,  GL_QUERY_RESULT, &amp;numSamplesRendered);s.str("");s &lt;&lt; "Samples occluding: " &lt;&lt; numSamplesRendered ;if(numSamplesRendered==0 )return false; return true;}</code></pre></div><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=8124">mobeen</a> — Tue Aug 12, 2014 8:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mobeen]]></name></author>
		<updated>2014-08-12T11:33:13+00:00</updated>

		<published>2014-08-12T08:05:08+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33792#p33792</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33792#p33792"/>
		<title type="html"><![CDATA[Regarding concave collision detection (Chap 10 RTCD)[SOLVED]]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33792#p33792"><![CDATA[
Hi all,<br><br>I am reading chapter 10 of book (realtime collision detection by Christer Ericson). The GPU collision chapter first gives Convex collision detection code snippet. I implemented it in OpenGL as given in Table 10.1 and it works as advertised. I then followed suit with the concave collision detection based on the information given on page 422 in Table 10.2. But since the information about hardware occlusion query is not detailed enough, I could not get it to work. So far I have implemented it as follows.<br><div class="codebox"><p>Code: </p><pre><code>...check the reply below</code></pre></div>I colour my objects green on collision to see if it works. for this demo, as soon as the two objects collide, i get flickering since we might have even and odd number of occlusion samples. My question is has anybody implemented this code snippet as given in Table 10.2 before? <br><br>   Please don't suggest me to look out for alternative solutions (I know there are better solutions) rather than trying this. I am really surprised at why the book does not include workable demos. It only contains code snippets which one can easily copy from the book. <br><br>Thanks,<br>Mobeen<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=8124">mobeen</a> — Tue Aug 12, 2014 8:05 am</p><hr />
]]></content>
	</entry>
	</feed>
