threejs cube stack grid example

Last week I made a cube stack threejs example that was based off of an older example that I made for an old post for the orthographic camera. I made a whole lot of improvements to that dusty old example for that post, and now for today’s threejs example I thought it would be cool to start another project example that is a grid of these cube stack objects actually. So then this is another one of my threejs project examples where I am continuing to work off of one more more previous threejs examples to make an event larger over all project.

Read More

threejs cube stack example

A long time ago now I made a cube stack module that I used in my post on the orographic camera. As of late I was doing some editing and while doing so fixed up the source code a little for that post, but now I am thinking that this cube stack model should be the main event for one of my threejs example posts. So I copied over the current state if the cube stack module into a new folder, and started making some changes to it just for the sake of having a little fun, and to lay down a ground work for even more features with this.

Read More

Weird Walk Two threejs example

Last week I started a weird walk guy threejs example, and as such this week I think I will make another threejs example where I just a continue with that example. However of course I will be taking this idea into a new direction with how I create and move legs. With the first weird walk I was thinking that it would be cool to just have to mesh objects for legs, and have just one axis of each leg scale up and down as a kind of crude yet amusing walk cycle. For this example I am thinking more in terms with something that is a walk cycle where the legs are two or more mesh objects that rotate at certain pivot locations. However as with the first weird walk cycle example I do so in a very weird way in which the thighs of the weird walk guy move forward from the rest of the body very far so the look is in no way natural. So in other words when it comes to this weird walk guy example, just like with the first example, I am going in a kind of weird for the sake of weird kind of direction.

This time I made some changes that have to do with how I go about adding textures to a module that I make this way my making another file that helps me with the process of making data textures. This is however the kind of change that I might do with the weird walk one module as well though which it comes to maybe doing more to revise the source code with that example. So for the most part what stands alone here is what is added in terms of additional mesh objects and code that is used to update those mesh objects.

Read More

Compute Vertex Normals for Buffer Geometry in threejs

The process of creating a custom buffer geometry, or mutating a built in geometry in threejs might be a little involved, but still there is only so much to be aware of. The first step might be to work out the positions attribute which is the values for the actual points in space. However after the position array it is a good idea to also work out the state of the normals attribute.

The normals attribute is one of many core attributes of a buffer geometry class that are needed in order to get geometry to look the way that one will typically want it to with mesh objects, rather than point or line objects. With points and lines all the one really needs are position attributes, and then maybe additional attributes that are used to mutate the position attribute. However with mesh objects there is a lot more to be concerned with when it comes to the rendering of the triangles and as such normals are a big part of that.

In some cases I might have to work out the values of the normal attribute manually, however in most cases just calling the compute vertex normals method of the buffer geometry class will work just fine. With that said this post will be on the use of the compute vertex normals attribute method of the buffer geometry class in threejs.

Read More

Weird Walk One threejs example

This post on threejs will be on a threejs project example that is a simple idea for a weird walk animation module. This is just one of several ideas that have come to me that might prove to be a quick fun project for a weird little walking guy model that is composed of a few mesh objects that come together to from a group of objects. This is not the first project idea like this, one of the oldest examples of this kind of model is my guy one threejs example that I made a few years back, and I have many others actually at this point.

The walk cycle that I had in mind is just having two mesh objects for legs, and using the scale property of the object3d class to set the scale of just the height of the mesh objects from its full scale to zero and back again. So it would be a weird walk cycle where the legs just move directly up and down which would not at all look natural of course, but that is the intention to begin with actually.

Read More