-
Calculating Triangle Normals
Posted on 23 Jul 2022 - 13:10
Unity’s Mesh class nicely exposes the mesh’s topology and allows us to manipulate it with ease. The access to vertex positions, triangles and normals is immediate thanks to the availability of properties like Mesh.vertices, Mesh.triangles and Mesh.normals. Nonetheless, all developers who do any wizardry on meshes unavoidably come across a blind spot: triangle normals. Many think that Mesh.normals will give enough intormation to know what way the triangle is facing but they soon discover that the vectors that come with Mesh.
-
Compute width and height from diagonal and aspect ratio
Posted on 8 Nov 2021 - 11:42
Problem When the information about a screen, a window or a generic rectangle is limited to its diagonal and an the aspect ratio (the width divided by the height) and we need to know width and height, we have a little problem. It must be easy right? Well.. not as obvious as most people expect (how many of your friends know the right answer?) but still the solution isn’t difficult and it’s a nice example of use of some known quadratic formulas.
-
Show system temperature on a mini i2c (9E6018A0) screen via Arduino Nano
Posted on 23 Apr 2021 - 15:45
Introduction This is a project showing How to wire the I2C display to an Arduino How to retrieve the CPU temperature (or other values) from Linux’s sysfs How to use the RS232 library by wjwwood How to connect to the Arduino Nano and send data How to receive data in Arduino How to display data through the nice graphics library by Adafruit —— (also how to scribble with that library) We will build a minimal C++ console application that retrieves a temperature value from Linux’s sysfs and sends it to a serial port.
-
Save and load mesh data in Unity
Posted on 1 Oct 2020 - 19:06
I do have a hell of a fun with generative graphics; if you do too and you want to save some of your creations to a file at runtime and load them later on, here’s your today’s chocolate cake. i use this method especially where it takes time to generate a topology and loading it is a lot quicker than regenerating it.