Sprite Objects, and 2d overlays in threejs

There are Sprite objects in threejs that are a special kind of Object3d class based object that is a simple 2d image that always faces the camera. These kinds of objects will then come into play with certain kinds of tasks in which they might be called for such as making a 2d overlay, or making the lowest resource heavy kind of state of an object when working out Level Of Detail objects. These kinds of objects will not work with the usual mesh materials, as such there is a special kind of material that needs to be used called just simply the sprite material. There are then a lot of little features to be aware of when it comes to using these objects, and with that the material that is used with them. So I thought I would start at least one post on this subject to write about a few things that I have worked out thus far on the topic of sprite objects in threejs.

Read More

The tangent attribute of buffer geometry and normal maps in threejs

The tangents attribute of [buffer geometry objects in threejs] can be added to a geometry by calling the compute tangents method of a geometry object instance. I have been piecing together some things as to what this is for, and thus far it would seem that this is something that will come into play when making use of normal maps as a way to address a problem that will come up for indexed geometry. You see when making use of an index to reuse points in the position attribute this will result in also only having as many vertex normals as there are position attribute points. This issue can then result in an typically undesired outcome with shading with materials that use light sources, or materials like the normal material. So then there are two general ways of addressing this, one of which is to not use an index, then other is to use a normal map. So with that said in order to use this normal map I will likely want to have a tangent attribute.

In this post then I will be going over what it is that I have together thus far in terms of demos that have to do with the subject of these tangent attributes, and with that everything that goes along with it, which thus far would seem to be to make use of the normal map option of various mesh material options.

Read More

The Matcap material in threejs

The Matcap material is a mesh material option that can be used to have a model with baked in lighting. The way that this is done is by making use of the main option of interest with this material which I would say is the matcap option. The value of this mapcap option should be a drawing of a shaded sphere and it is this shaded sphere texture that will be used as a way to define the direction and intensity of the light. The texture of the mapcap option can also contain color data, but there is also a map option with this material that can be used as a way to separate these concerns.

Read More

Matrix4 Objects in threejs

As of late I have wrote a new post on the object loader in threejs, and I noticed that when using the toJSON method of an object3d class based object a matrix key is created. In addition there are no keys for position, rotation, quaternion, or scale in this output. This is because all of this can be stored as a single array value that in turn can be used to create an instance of the Matrix4 class which is the value for the matrix property of an object3d class based object.

Turns out that I have not played around with these matrix4 objects much just yet, so I thought that it would be good form to at least start a blog post on this subject to start with.

Read More

Linux Root Folders

I have been taking a little break from javaScript and threejs related content now and then to start learning more about Linux kernel based operating systems. For the most part this has been with the Debian Linux based Raspberry PI OS as I like working with the Raspberry PI 4 Single Board Computers, but I am sure that much of what I run into with that OS can also be found in many other Linux Distributions as well. Anyway there are a whole lot of ways of getting started learning a thing or two more about Linux, after getting an OS up and running to begin with, such as using a package manager like apt, pr learning more about bash and with that aliases and bash scripts. However another thing that comes to mind is learning more about the various folders at the root name space of the OS.

At the root name space there are folders like bin, sbin, usr, etc, home and so forth. With that said there is taking some time to look into more about what these various folders are used for. It can prove to be very time consuming to really start to know a thing or two about every little typical file in every little location. Also things will differ a little from one Linux system to the next, but still there are some common folders that can be found in just about any Linux System. So I thought I would start doing some research, and write done some notes in the from of a blog post on these various folders and what they are for.

Read More