<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://www.spyroforum.com/extern.php?action=feed&amp;tid=12857&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Spyro the Dragon Forums / 3D for testing collision checking]]></title>
		<link>https://www.spyroforum.com/viewtopic.php?id=12857</link>
		<description><![CDATA[The most recent posts in 3D for testing collision checking.]]></description>
		<lastBuildDate>Sat, 15 Sep 2012 15:16:47 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: 3D for testing collision checking]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=379821#p379821</link>
			<description><![CDATA[<div class="quotebox"><blockquote><div><p>Aah, I see you&#039;re programming a game. Yeah, troubleshooting is one of the<br />biggest pains in the butt you can go through. It happens to me when I mod<br />my computer game. Sometimes it&#039;s a single wrong symbol that crashes the<br />game. Best of luck to you, man. The outcome will be worth your effort.</p></div></blockquote></div><p>That&#039;s right I spend tons of time just debugging.<br />As for libraries, I am used to just put #include &lt;headername&gt; and happily use it, but I haven&#039;t yet came across such nasty library like coldet.</p><div class="quotebox"><blockquote><div><p>So you&#039;re coding this game using C++?</p></div></blockquote></div><p>Yes, c++ with some libraries like SDL, opengl and openal. It is fast and easy to use, but I had to learn it on my own, because at school, we learn just Java&#160; &lt;_&lt;</p>]]></description>
			<author><![CDATA[dummy@example.com (Gekoncze)]]></author>
			<pubDate>Sat, 15 Sep 2012 15:16:47 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=379821#p379821</guid>
		</item>
		<item>
			<title><![CDATA[Re: 3D for testing collision checking]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=379803#p379803</link>
			<description><![CDATA[<p><span style="color: blue"><br />Aah, I see you&#039;re programming a game. Yeah, troubleshooting is one of the <br />biggest pains in the butt you can go through. It happens to me when I mod <br />my computer game. Sometimes it&#039;s a single wrong symbol that crashes the <br />game. Best of luck to you, man. The outcome will be worth your effort.</span></p><p><span style="color: blue">So you&#039;re coding this game using C++?<br /></span></p>]]></description>
			<author><![CDATA[dummy@example.com (Swaffy)]]></author>
			<pubDate>Sat, 15 Sep 2012 04:24:21 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=379803#p379803</guid>
		</item>
		<item>
			<title><![CDATA[Re: 3D for testing collision checking]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=379468#p379468</link>
			<description><![CDATA[<div class="quotebox"><blockquote><div><p>I tried to learn C++ recently, but have gave up temporarily because I needed to display graphics on the screen to have any motivation to program anything, but when I tried to download/install either DirectX or openGL, the compiler complained about some files missing, and when I tried to download those, it needed more files and so on. Ugh. So I&#039;m using javascript again for my current project, but with WebGL rather than a javascript and 2d canvas based 3d engine.</p></div></blockquote></div><p>Yeah, installing libraries on Windows is horrible - you have to setup everything yourself. I&#039;m glad I am using linux where you just type sudo apt-get install &lt;libraryname&gt; and everything is done by the package manager <img src="https://www.spyroforum.com/img/smilies/big_smile.png" width="15" height="auto" alt="big_smile" /><br />I am making it multiplatform of course, so Windows, Linux and I hope also Mac users can play it. (I don&#039;t have Mac on any computer, so I cannot try it)</p><p>EDIT: Tried the coldet library and the result is: !@#$%$^%&amp;*<br />1st compile: error need to define which compiler is used O _o I have never seen this in any library...<br />2nd compile: errors undeclarated functions - didn&#039;t need them - commented out those function calls<br />3rd compile: bunch of warnings (I don&#039;t like warnings) and error wile declaring some coldet class - it don&#039;t have param free contructor<br />4th compile: realized I have to use some other... strange class o_ O<br />5th compile: 1st compile error again o_ O how many times do I have to define it? - putting #define GCC to all coldet files<br />6th compile: watching how warnings count raises up, error NULL was not declared X_X<br />result: the worst library I have ever tried to use, I have to take a break and SPAM IT UP, I&#039;ll try to read its docs more deeply and if it fails again, I am going to use your way sheep</p>]]></description>
			<author><![CDATA[dummy@example.com (Gekoncze)]]></author>
			<pubDate>Tue, 11 Sep 2012 12:59:28 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=379468#p379468</guid>
		</item>
		<item>
			<title><![CDATA[Re: 3D for testing collision checking]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=379368#p379368</link>
			<description><![CDATA[<div class="quotebox"><cite>Blako wrote:</cite><blockquote><div><p>That is almost the same way as I did first <img src="https://www.spyroforum.com/img/smilies/smile.png" width="15" height="auto" alt="smile" />, but I want Sparx to be able to do this:</p><div class="quotebox"><blockquote><div><p>changing height, E.g flying upwards or going over bridges</p></div></blockquote></div></div></blockquote></div><p>Great <img src="https://www.spyroforum.com/img/smilies/smile.png" width="15" height="auto" alt="smile" /> I had never thought about that possibility in a Sparx game before I tried to come up with the reason not to use line collision in it. It would certainly make it more interesting. I look forward to seeing how this game evolves!</p><p>You would probably get a faster collision from a library dedicated to the topic, but if you&#039;re interested, here&#039;s my method of collision and reaction with triangles(roughly):</p><div class="quotebox" style="padding: 0px;"><div onclick="var e,d,c=this.parentNode,a=c.getElementsByTagName('div')[1],b=this.getElementsByTagName('span')[0];if(a.style.display!=''){while(c.parentNode&&(!d||!e||d==e)){e=d;d=(window.getComputedStyle?getComputedStyle(c, null):c.currentStyle)['backgroundColor'];if(d=='transparent'||d=='rgba(0, 0, 0, 0)')d=e;c=c.parentNode;}a.style.display='';a.style.backgroundColor=d;b.innerHTML='&#9650;';}else{a.style.display='none';b.innerHTML='&#9660;';}" style="font-weight: bold; cursor: pointer; font-size: 0.9em;"><span style="padding: 0 5px;">&#9660;</span>Hidden text</div><div style="padding: 6px; margin: 0; display: none;"><p>Test for collision between a sphere with a radius that is considerably larger than the moving object(sphere) and the terrain. Make a list of the triangles that did collide. These are the ones the moving object could potentially collide with.</p><p>repeat x number of times, or until there is no collision:<br />Find the triangles the object(sphere, this time with actual radius) would hit at (x+xspeed,y+yspeed,z+zspeed), and add to the speed vector the vector going from the triangles nearest point to the center of the sphere multiplied by (radius - distance) / radius.</p><br /><p>The sphere x triangle test is:<br />IF the center of the sphere is within the &quot;beam&quot; of the triangle{<br />project the sphere position to the triangle&#039;s plane. If the distance between this position and the sphere&#039;s position is smaller than the sphere&#039;s radius, there is a collision<br />} else {<br />Find the nearest point on the triangles edges. If the distance between this point and the sphere is smaller than the radius, there is a collision<br />}</p></div></div><div class="quotebox"><blockquote><div><p>I am making it on my own in C++ using SDL, opengl and openal. I use QtCreator but I don&#039;t use any qt libraries for this project... QtCreator&#039;s text editor is just sooo comfortable and easy to use.</p></div></blockquote></div><p>I honor your choice of building it yourself, rather than using Unity or other game engines <img src="https://www.spyroforum.com/img/smilies/tongue.png" width="15" height="auto" alt="tongue" /><br />I tried to learn C++ recently, but have gave up temporarily because I needed to display graphics on the screen to have any motivation to program anything, but when I tried to download/install either DirectX or openGL, the compiler complained about some files missing, and when I tried to download those, it needed more files and so on. Ugh. So I&#039;m using javascript again for my current project, but with WebGL rather than a javascript and 2d canvas based 3d engine.</p>]]></description>
			<author><![CDATA[dummy@example.com (Sheep)]]></author>
			<pubDate>Mon, 10 Sep 2012 19:55:54 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=379368#p379368</guid>
		</item>
		<item>
			<title><![CDATA[Re: 3D for testing collision checking]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=379350#p379350</link>
			<description><![CDATA[<p>Thanks for the room Sheep ^^</p><div class="quotebox"><blockquote><div><p>You could just calculate the silhouette of the world at a certain height value above the floor, make a list of lines from it, and do circle x line collision instead, which would be much faster.</p></div></blockquote></div><p>That is almost the same way as I did first <img src="https://www.spyroforum.com/img/smilies/smile.png" width="15" height="auto" alt="smile" />, but I want Sparx to be able to do this:</p><div class="quotebox"><blockquote><div><p>changing height, E.g flying upwards or going over bridges</p></div></blockquote></div><div class="quotebox"><blockquote><div><p>What are you making this game with?</p></div></blockquote></div><p>I am making it on my own in C++ using SDL, opengl and openal. I use QtCreator but I don&#039;t use any qt libraries for this project... QtCreator&#039;s text editor is just sooo comfortable and easy to use.</p><div class="quotebox"><blockquote><div><p>I don&#039;t know much of any collision libraries for any language or game engine, but I made a 3d platformer prototype about a year ago with javascript and HTML5 Canvas, which, among other things, required me to write sphere x polygon collision checking and reaction to that collision.<br />Link It only runs at an acceptable fps in Chrome.</p></div></blockquote></div><p>I&#039;ll take a look at it.</p><div class="quotebox"><blockquote><div><p>Anyway, if speed becomes a problem, I would suggest that the collision data is split up into a 2d grid when the level loads, so that you would only have to check against the triangles or lines in the nearest grid cell(s).</p></div></blockquote></div><p>Yeah I was thinking about something similar. Maybe I will use it.</p>]]></description>
			<author><![CDATA[dummy@example.com (Gekoncze)]]></author>
			<pubDate>Mon, 10 Sep 2012 17:51:37 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=379350#p379350</guid>
		</item>
		<item>
			<title><![CDATA[Re: 3D for testing collision checking]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=379338#p379338</link>
			<description><![CDATA[<p>I made room:<br /><a href="http://host-a.net/u/Greenblizzard/sparxlevel.obj" rel="nofollow">http://host-a.net/u/Greenblizzard/sparxlevel.obj</a></p><p>And about collision, if you&#039;re trying to make something like the Sparx levels in Spyro 3, I can&#039;t see why you would need 3d sphere x triangle collision, even though they used it in their game. <br />You could just calculate the silhouette of the world at a certain height value above the floor, make a list of lines from it, and do circle x line collision instead, which would be much faster.<br />But if the game involves Sparx somehow changing height, E.g flying upwards or going over bridges, this wouldn&#039;t work.</p><p>What are you making this game with? </p><p>I don&#039;t know much of any collision libraries for any language or game engine, but I made a 3d platformer prototype about a year ago with javascript and HTML5 Canvas, which, among other things, required me to write sphere x polygon collision checking and reaction to that collision.<br /><a href="http://greenblizzard.cwahi.net/3d_game_project/test9.html" rel="nofollow">Link</a> It only runs at an acceptable fps in Chrome.</p><p>Anyway, if speed becomes a problem, I would suggest that the collision data is split up into a 2d grid when the level loads, so that you would only have to check against the triangles or lines in the nearest grid cell(s).</p>]]></description>
			<author><![CDATA[dummy@example.com (Sheep)]]></author>
			<pubDate>Mon, 10 Sep 2012 15:54:10 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=379338#p379338</guid>
		</item>
		<item>
			<title><![CDATA[3D for testing collision checking]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=379101#p379101</link>
			<description><![CDATA[<p>I am going to experiment with collision checking in my 3D Sparx game, but I don&#039;t have any Sparx world like 3D terrain (in fact I have no 3D models yet (just n-gons representing objects), bc I am noob at 3D modeling). So I wonder if anybody here is good at modeling 3D. I just need plain *.obj file (or some that can be converted in blender into obj) with small Sparx world like room. It have to be <strong>low-poly</strong> like on the picture below, but it don&#039;t have to have textures or colors. (but of course it can <img src="https://www.spyroforum.com/img/smilies/wink.png" width="15" height="auto" alt="wink" /> )</p><p>On this image you can see how is the room made in Spyro YotD. You can propably see the the wall is made of squares. This shows how low-poly it is (no ultra smooth edges).<br /><a href="http://files.spyropictures.webnode.cz/200003532-d0fe0d1f79/sparx_detail.png" rel="nofollow">http://files.spyropictures.webnode.cz/2 … detail.png</a></p><p>It is not critical, I can somehow rig it up together, but I just thought I could try it here first.</p><p>Thanks for any advice. <img src="https://www.spyroforum.com/img/smilies/smile.png" width="15" height="auto" alt="smile" /></p><p>btw it look like I am going to use some library for the collisions (maybe coldet) so if anybody knows some good library that can do fast sphere x triangle collision checking (or some other way how to do it) let me know.</p>]]></description>
			<author><![CDATA[dummy@example.com (Gekoncze)]]></author>
			<pubDate>Sat, 08 Sep 2012 09:58:35 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=379101#p379101</guid>
		</item>
	</channel>
</rss>
