Getting started with expressjs and nodejs

The node.js powered server side framework express.js is a pretty great when it comes to making full stack web applications. It is part of the MEAN stack, and is also a major component of many other projects like sails, and keystone just to name a few.

However the framework can just be used by itself, and just a few additional packages as a way to quickly get up and running with a nodejs project compared to doing everything from the ground up. I do not have to go with angular when it comes to a client side framework, in fact as of the last time I edited this post I enjoy using vuejs over angular actually.

In any case express is worthy of a series of posts on it for starting with the typical getting started post, so lets get this one out of the way so we can get into making some interesting stuff.

Read More

The lodash _.filter, and Array.filter methods

Looking over what I have wrote on lodash so far I am surprised that I forgot to write one on the lodash filter method. The filter method both in lodash and in native javaScript comes in handy often as a way to create a new array from and array with many of the elements that I do not want for one reason of another removed. There are many other methods that are like filter in lodash such as compact, but these are often just convenience methods for what can be done with filter. So then the lodash filter method gives a great deal of flexibility when it comes to filtering out unwanted elements from an array.

Sense the time that I first wrote this post I also got around to writing a post on the native array filter method also. The main thing about the lodash filter method compared to array filter is that the lodash method is a collection method which means it will work with objects in general, not just arrays. However it it is not to hard to do the same with native javaScript by just being aware of additional tools to work with when it comes to using just native javaScript by itself. There are also a number of other native array prototype methods and other various other methods and javaScritplanagauge features that can be used to do what the lodash filter method does. So in this post I will not just be writing about the lodash filter method, but also what there is to work with when it comes to javaScript by itself when it comes to various filtering related tasks in javaScript.

Read More

The Orthographic Camera in three.js

In threejs there are a few cameras to work with, typically in most cases I would use the perspective camera, however there is also the orthographic camera. With this orthographic camera an object size will remain the same regardless of this distance in which the object is from the camera, as compared to the perspective camera which will change the size as the distance from the camera goes up.

I often do use the perspective camera as with most of the projects I work on I want to use a camera that works like that of the human eye, but the main other camera of interest outside of that would be the orthographic camera first and foremost. With that said in this post I will be writing about the orthographic camera, and how it compares to the perspective camera. There might be a few situations in which I might want to use this kind of camera here and there. In any case thought it is also a good idea to work out at least a few examples with a camera option other than the perspective camera just for the sake of getting a little more solid with what there is to work with in threejs.

Read More

Grouping two or more Mesh Objects together in three.js

After writing a lot of demos in threejs I have arrived at a point where it is time to start getting into some more advanced topics in threejs, or at least something new beyond just the very basics of getting started with the library. So with that said, it might be time for me to get into animation with three.js, but doing so the professional way will prove to be a little complicated, and it will also largely involve the use of an application like blender as a way to create models in the form of external files.

So another simple way of making some animations is to have Mesh Objects grouped together, and then have it so they are moving in relation to each by moving the position of a group object rather than each individual mesh object. In addition to this a group object also has all kinds of properties that are inherited from object3d that prove to be useful such as the user data object that I can use to park some of my own data about the group that will be used in some additional code.

Also for one reason or another it is often a good idea to have a way to group two or more objects in general and not just mesh objects. For example I might want to add a light to a camera and then add the camera to a scene object. So this post today will be about the three.js Group constructor, but a whole lot of what a group is about is also a feature of the object3d class in general. So here I will be going over some of the basics when it comes to this sort of thing, but also I will likely touch base on many other related topics what will come up when creating groups of objects that have to do with rotating a geometry just once, and the difference between world space, and space that is relative to a group.

Read More