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.
This is not the first example that I have made that is like this, in fact I have made a few informal models as I have come to call them. The first one that I have made would be my guy one module that I made many years ago now. I have mentioned that this is indeed a weird walk one, but sense I wrote this post for the first time I also made a weird walk three project as well.
I have the source code of this example parked on my test threejs repository on Github.
When I first started writing this post I was using r135 of threejs with the source code examples, and the last time I came around to do some editing I was using r146. I was able to get this example up and ruining fine with that revision of threejs, but I am sure that it will end up breaking at some point in the future. I do take the time to come around and do a little editing of each if these threejs posts, but it might be a while until I come around again.
In this section I will be going over the source code of the first and at time time of this writing, the only revision of this weird walk module. I can not say that I have any interest in making any future revisions of this module as I have many other examples that are of greater interest. So future edits of this post might just have to do with making additional demos of this first revision.
Now that I have the texture module out of the way I can now write about the weird guy two module that makes use of this data texture module to create the textures for the various materials that are used to skin the various parts of the guy. At the top of the module I am using the seeded random method of the math utils object as a way to create just a texture with random variations of black and write for each pixel. This is what I use to just add some kind of texture other than that of just a solid color which strokes me as just a kind of place holder type thing for some kind of better option for a texture, but for some things this might still work well.
After that I once again just have a method to create and return the group that I will add to the scene object when making some code that makes use of this. After that I just have two additional public methods that are used to set the walk cycle, and to also set the state of the arms as well. The only major different here is that I am using the object3d rotation property of the mesh objects to rotate mesh objects, rather than the object3d scale property to just set the scale of the legs as I did in weird walk one.
I am not sure what the future of this example might be if any actually. I have a whole lot of other threejs examples that i would like to work on more when it comes to making updated revision of the module that is used along with additional demos of the modules and videos for them. With that said I can not say that weird walk two is at the top of the list and that the first weird walk example, as well as the third one have higher priority when it comes to revision. Still I did have a basic general idea with this one that is kind of cool, so who knows what the future may hold when it comes to the nest time I come around to edit this post a little.