<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Luis Miguel</title>
    <description>The latest articles on DEV Community by Luis Miguel (@lmbarr).</description>
    <link>https://dev.to/lmbarr</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F34788%2Ff4833612-e2e6-43b0-bc58-02a92b0910eb.jpeg</url>
      <title>DEV Community: Luis Miguel</title>
      <link>https://dev.to/lmbarr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lmbarr"/>
    <language>en</language>
    <item>
      <title>But first let me take a look to the documentation</title>
      <dc:creator>Luis Miguel</dc:creator>
      <pubDate>Wed, 14 Nov 2018 20:19:23 +0000</pubDate>
      <link>https://dev.to/lmbarr/but-first-let-me-take-a-look-to-the-documentation-541j</link>
      <guid>https://dev.to/lmbarr/but-first-let-me-take-a-look-to-the-documentation-541j</guid>
      <description>&lt;p&gt;This is an horror story about how to (not) waste 2 weeks of work. &lt;/p&gt;

&lt;p&gt;First lemme give you a little bit of context.&lt;/p&gt;

&lt;p&gt;I was working on a project where the client asked to create a report that contains images of a certain process. My tech lead asked me to take charge of generating the images, at that time I chose pyopengl (because python was already being used as a programming language in the project) to implement the generation of images in 2D and 3D, mainly because there were already calculated values ​​for the orthogonal camera in Threejs that I would then use in the pyopengl camera.&lt;/p&gt;

&lt;p&gt;The process of capturing the images was as follows, first a pygame window is created and then it is drawn on that window to then make a screeshot of it.&lt;/p&gt;

&lt;p&gt;So far so good, on my local computer worked well but to try on the server the thing did not work (as I suspected because the server does not have a graphical interface that allows you to create a window to make a capture of that window and save it).&lt;/p&gt;

&lt;p&gt;The nightmare starts from here, we looked for a graphics library that allows headless rendering or offscreen rendering for about 2 weeks. First we tried (me and Daniel, the intern that is collaborating in the project) the open3d python package which was a complete disaster because it does not allow to set the camera normally like any graphics library (or maybe it was my fault and I did not find the way), we needed a camera that allows to set the lookup vector, the position vector and the up vector of the camera.&lt;/p&gt;

&lt;p&gt;Then, I do not know why, I decided to read the pyopengl documentation and said that it allows headless rendering using the osmesa library (it was not quite explicit though), wait what, it was a facepalm moment combined with a blow mind moment.&lt;/p&gt;

&lt;p&gt;After reading that I think it took an hour for Daniel and me to implement and adapt that idea to our code.&lt;/p&gt;

&lt;p&gt;So I'll leave with this: &lt;em&gt;Read the documentation of the technology you are already using.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>pyopengl</category>
      <category>documentation</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
