Weird Walk Three threejs example
I would like to make another one of my weird walk modules where the goal is to just have fun with the library to make some kind of collection of mesh objects that is just some kind of character or object. The over all end look of the model, if it can be called that, looks like it has legs and is just going threw something that can be thought of as a kind of walk cycle.
I am looking to continue expanding my collection of threejs examples as I think I have hit a bit of a wall when it comes to leaning more about the library itself, for the moment at least. So it would very much seem to be just the thing two do to start thinking in terms of what I would like to do with threejs when it comes to making actually projects rather than just demos of various threejs features.
The weird walk three module and what to know first
This is a post on a javaScript module that I am calling weird walk three which as the name suggests is the third project where I am making a kind of informal module that is of some kind of character that is just going threw a walk cycle of sorts. This is not a post for people that are new to threejs or javaScript in general I have wrote those posts a ling time ago and will nit be getting into detail about the basics of these subjects here. However I do often have an opening section such as this to just write about a few things you might want to read up more on before continue to read the rest of the post.
This is a kind of informal model, there are other ways of making something like this.
This javaScript module is one of many examples that I have made that I would call a kind of informal model. What I mean by that is that this is that my weird walk three module creates and returns an instance of THREE.Group that contains children that are additional groups and THREE.Mesh objects. The geometries of the mesh objects are cerated using the various threejs built in geometry constructor functions lie the THREE.BoxGeometry constructor function.
There are other ways of making a model that can be thought of as being a little more in track with how they are made from a professional perspective of course which is what I have come to refer to them as informal models.
There are my other weird walk modules
As the name suggests there should be two other threejs examples that came before this one, and yes because I am bad at naming things they are called weird walk one and weird walk two. This new weird walk module is a bot of a break away from them though as this is not just an example in which I am building on top of what I started with but making a whole new module from the ground up.
I am also using my new object grid wrap examples to make an over all scene with the weird walk module
When making the over all scene that will serve as a demo of the module I also wanted to make use of new new object grid wrap module that I started recently. This is a project where the aim is to create a grid of objects where I have one of several kinds of objects at each grid location. On top of that there are also public methods that allow for me to change the positions of these objects in such a way that they loop around, and when I want to I can also have them loop around in 2 directions.
Version numbers matter
The version of threejs that I was using when I first made this module and wrote this post was r135.
Latest source is on Github
The latest source code for this module as well as many others can be found in my test threejs repository.
First version of weird walk three, and other additional files
In this section I will be going over the source code of the first version of this weird walk three module as well as additional files that I ma using to get the over all demo that I made for it up and running as well.
1.1 - The weird walk module r0
Often when I make a module such as this I will have a create method that will create and return a new instance of the module, and then one or more additional models that will update the state of the module in various ways. However for this idea all I really generally want to do with it is just rotate the main root object along one or maybe two axis as a way to create a walk cycle for it and that is about it. So for the first version of this at least I have just a single create method and that is it, when it comes to the public methods of the module at least.
|
|
1.2 - object grid wrap module r1
When it comes to the over all demo that I made I also wanted to make use of my new object grid wrap module that I also started recently as a way to create a looping scene.
|
|
1.3 - Demo code for r0 of weird walk three
The demo that I made for this weird walk module is then just a simple walking loop in which I am just rotating the weird walk three object. I am just rotating the weird walk model and not doing anything with the position attribute of the root object, so I am then then changing the state of the object grid wrap as a way to produce the illusion of movement.
|
|
Conclusion
That will be it for now when it comes to this weird walk three module, but I am sure that I will be doing at least a little more editing with this example as it still does not look the way that I want it to. I all ready have one additional revision in the works as I write this, and I might want to make one more before moving on to the next thing. Much of what I want to change has to do with the geometry of the foot mesh, for the first version the foot mesh is just a box geometry and I am not doing anything out of the ordinary with my various examples when it comes to making a custom geometry or textures to make it look more like, well a foot.
In my first revision of the module I am trying my luck with the shape constructor and extrude geometry as to get something closer to what I have in mind for this, but I might have to go the distance and actually make a custom foot geometry in order to really get this to loom they way that I want it to possibly.