If you do not want to watch this whole video as well as part 2 after that the general idea is this: The current state of Physiology can lead to poor Emotions, which can lead to toxic thoughts, that are then detramentail to performance. By way of HRV breathing exercise Physiology can change which can then cause everything else up the ladder to also change into a more desirable state that can help improve performance.
I have the current source code for this module and the demos up on my test threejs repository on Github. This is also where I place the source code examples that show up in all my other blog posts on threejs as well.
When I first wrote this blog post and made the first version of this module I was using r146 of threejs and thus follow that style rules I set for that revision. The plan with new posts and editing older posts is to stick with this well into this coming year, but still the days with this kind of style are very much coming to an end. The three.min.js files that I have been using are very much on the chopping block it would seem, so at some point I am going to need to start including JSM versions of my module for people that want to use bleeding edge revisions of threejs.
In any case always be mindful of what revision of threejs that you are using when trying to get code examples such as the ones I am writing about here to work on your end. Code breaking changes are made to threejs all the time so it often is best to stick with the revisions that I am using with these examples. Also I have found that it is a good idea to be aware of what kind of GPU you are using on your system and what the support is for OpenGL and therefor WebGl features. I like working on Raspberry PI OS and thus also have to deal with the limitations of the VideoCore VI GPU of the Raspberry PI 4. In r150 of the library the WebGLRenderer has totally crashed and burned which cased me to start plaing future code style rules with r149. Simply put in general version numbers very much matter with this stuff, and not just with threejs alone.
After using this module for a few video projects thus far I have found that I should remove the groups of objects that are updated using curves. It is not that I do not like what I worked out with that, it is just that I think that the main focus of this module should just be to update alpha values over time. What I then do with these alpha values will change up from one project to the next so having something baked into the module itself adds unnecessary complexity.
So for R1 of breath.js everything that has to do with this curve group that was in R0 has been removed. New options have been added that allow for doing everything in a single update hook if I want, and there are a few alpha values to work with in this hook function. For now there is just a before hook that is called before the current breath part hook, but I called it that rather than update as I may add an after hook in future revisions.
I thus far have just one demo of R1 of the breath module.
There is then covering the state of the breath module itself, and then also getting into a few demos as a way to test drive what I have thus far. With that said there are two general public methods of interest one of which is used to create an instance of THREE.Group, with a whole bunch of useful data attached to the user data object of this group which is very much there for these kinds of projects. The other public method if interest is used to update the state of these values.
This far the module seems to work okay with what I have in mid thus far, and as of now the current panes for future revisions have to do with reducing complexity actually rather than adding features.
The current state of the source code of the module is broken down into three general parts thus far. One part is for defaults and constant values for versions things over the body of the source code. ANother part has to do with private helper functions that are used as tools for the final part which is the pubic API of the module.
I will want to start out with a demo of the module that is a kind of hello world type getting started type demo. Nothing fancy just creating an instance of the group that is returned when calling the breath modules create public method. Also with that said I can make sure that i get an expected result when calling the create method with no options at all that will of course result in a breath module with everything set to the hard coded default settings for thing.
So it looks like this are working just fine with the default settings so now it is time to have a demo with some custom options for update the group of mesh objects.
I also have a hooks feature that is a way to define custom logic for each part of a breath cycle.
So far so good with this project, and I am sure that I will be making at least a few video projects using this module. In time I am sure I will have a better idea of what needs to change with respect to future revisions of this module. Thus far I am thinking that much of that might have to do with removing features rather than adding them actually. AT least that is what I did with R1 of the example at least as there is much that I think should not be baked into the module itself. The main thing here is to just have a module that will update alpha values that I then in turn used for one or more additional things in an over all scene that will change from one project to the next.
As wih R1 I think that I now have an okay system at least for this work of thing, and now any additional changes will have to do with things that might come up if I use this a great deal more.