<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Bullet3 Physics on Jan Kelemen - Personal site</title><link>https://jk.rubberdax.xyz/tags/bullet3-physics/</link><description>Recent content in Bullet3 Physics on Jan Kelemen - Personal site</description><generator>Hugo</generator><language>en</language><copyright>© [Jan Kelemen](https://www.rubberdax.xyz)</copyright><lastBuildDate>Sat, 10 Aug 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://jk.rubberdax.xyz/tags/bullet3-physics/index.xml" rel="self" type="application/rss+xml"/><item><title>Rendering Medvednica From a Heightmap</title><link>https://jk.rubberdax.xyz/post/2024-08-10-rendering-medvednica-from-heightmap/</link><pubDate>Sat, 10 Aug 2024 00:00:00 +0000</pubDate><guid>https://jk.rubberdax.xyz/post/2024-08-10-rendering-medvednica-from-heightmap/</guid><description>&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=AyvbysGaSmI"&gt;Na Sljeme, na Sljeme na Sljeme&amp;hellip;&lt;/a&gt;.
I started this project to explore the usage of Bullet&amp;rsquo;s &lt;a href="https://pybullet.org/Bullet/BulletFull/classbtHeightfieldTerrainShape.html"&gt;btHeightfieldTerrainShape&lt;/a&gt; collision shape, initial idea was to generate a heightmap using &lt;a href="https://en.wikipedia.org/wiki/Perlin_noise"&gt;Perlin noise&lt;/a&gt;.
I ended up using a static heightmap as I didn&amp;rsquo;t like the results I was getting with the terrain generated from using plain noise.&lt;/p&gt;
&lt;p&gt;Results are in the video below, Link to the source code: &lt;a href="https://github.com/jan-kelemen/graphics-demos/tree/master/soil"&gt;jan-kelemen/soil&lt;/a&gt;&lt;/p&gt;
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
 &lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/wr8dgD03Gz0?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
 &lt;/div&gt;

&lt;h1 id="heightmaps"&gt;Heightmaps&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Heightmap"&gt;Heightmaps&lt;/a&gt; are images that are used to represent the height of a terrain.
Values taken from this image are mapped to a rectangular grid, combining these two things gives us a coordinate in 3D space. Brighter values represent a higher point in the space.
Below is the image I&amp;rsquo;ve used for this project, although you can generate a heightmap for any point of Earth with a site like &lt;a href="https://manticorp.github.io/unrealheightmap/#latitude/45.86132487333674/longitude/15.97686767578125/zoom/11/outputzoom/12/width/1025/height/1025"&gt;manticorp.github.io/unrealheightmap&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>It Goes In The Square Hole</title><link>https://jk.rubberdax.xyz/post/2024-07-05-it-goes-in-the-square-hole/</link><pubDate>Fri, 05 Jul 2024 00:00:00 +0000</pubDate><guid>https://jk.rubberdax.xyz/post/2024-07-05-it-goes-in-the-square-hole/</guid><description>&lt;p&gt;I gave a hint that I wanted to study how to do mouse picking in a 3D environment properly.
For that, I&amp;rsquo;ve chosen to go with the route of raycasting from the mouse position into the scene and remake the scene from the popular video &lt;a href="https://www.youtube.com/watch?v=cUbIkNUFs-4"&gt;The Original Square Hole Girl Video + The Redemption&lt;/a&gt;.
Link to the source code: &lt;a href="https://github.com/jan-kelemen/graphics-demos/tree/master/geos"&gt;jan-kelemen/geos&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can see the results in the video below.&lt;/p&gt;
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
 &lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/vkjBM03vehw?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
 &lt;/div&gt;

&lt;h1 id="mouse-picking"&gt;Mouse picking&lt;/h1&gt;
&lt;p&gt;As mentioned, mouse picking is implemented by raycasting. For this, I&amp;rsquo;ve started with a single cube with 2x2x2 dimensions, also known as the default Blender cube.
This was much easier to start since the dimensions it uses are trivial to debug if some part of the calculation isn&amp;rsquo;t correct.&lt;/p&gt;</description></item></channel></rss>