Text Geometry in threejs

When it comes to adding text to threejs projects there might be a number of ways to do so. There is thinking in terms of adding text in the form of canvas textures that are then used with some geometry as a way to add text. There is also working out something where I just have a plain old fashion 2d canvas drawing context and then draw to it with the dom element property of the WebGl Renderer, and then while I am at it use the 2d drawing context to draw some text on top of that which is what I often like to do these days. However todays post will be on the text geometry class that can be added in with a project by way of an additional add in module alone with the core library of threejs itself.

Using the text geometry constructor is a little involved as it will not just require adding the text geometry module, but also an additional font loader that is needed to load the JSON files that will contain the data that is the font to be used. Speaking of fonts, yes that is yet another file that will need to be obtained by one means or another. The good news though is that all of this can be found in the threejs github repo if you just want to use what there is to work with there.

Read More

Extracting rar files with Linux unar command

The rar file format is a proprietary data compression archive file format. Often I will end up comming accross this kind of archive file and would like to extract it in a Linux system without having to boot to windows, or by one means or another using winrar to do so. The good news here is that there is a popular linux deal that can be used to make quick work of this called unar. On the Debian based distros that I work with thus far it would seem that this is not backed into the OS image, however it can easly be added by way of apt.

Read More

Linux Sudo command

The Linux sudo command is used to run a command as another user while logged in as another. Typically this is used to run a command that would need to be done while logged in as the root user, but done instead from a regular user account that is set up to do this. Such as installing or updating software by way of the apt command. However sudo can also be used to run a command as any user, assuming that permission is set up for the current user to do so.

There are alternatives to the use of the sudo command such as using the su command to switch to the root user, or any user assuming the password is known. Then I can do whatever I want from that user account, and then call su to switch back again.

Read More

Textures in threejs

The texture class in threejs is a way to go about creating the kind of object that is used for the various map options of materials. There are a number of ways to create this kind of object, such using the texture loader, or creating an image with javaScript code by way of canvas of data textures. In any case there are a lot of little details that one will need to be aware of when it comes to what there is to work with when it comes to th texture class alone. Also things can end up branching off into a wide range of other topics while we are at it when it comes to texture in general when it comes to how textures are used with mesh materials, backgrounds, and so forth.

Read More

Buffer Attributes in threejs

In threejs buffer geometry objects are composed of at least one, but typically many instances of the Buffer Attribute class. Each of the buffer attributes are used in the process of creating, and updating the position of vertices in space, an index to reuse such vertices, vertex normals, uv mapping values, and much more actually. With that said having a solid grasp on what there is to work with, and be aware of in the buffer attribute class is necessary in order to create custom geometry, as well as update or extend, or debug problems with existing geometry.

Read More