Introduction

In this article I share a mix of environmental instrumental rock that I prepared to listen to when I am writing articles or programming.

For this mix I have selected 16 songs from the YouTube library. The mood of the songs at times is calm, other times more moved, without becoming extreme, which allows me to isolate myself from the environment without distracting me.

Instrumental Rock Mix

Without further ado here you can listen to the instrumental rock mix, I hope you like it 😀

Names of the Songs and Artists by order of appearance

00:00 – 03:32 Without A Sound – Letter Box
03:32 – 06:15 Open Highway – Silent Partner
06:15 – 09:53 Lay It Down – Silent Partner
09:53 – 14:20 Don’t Look – Silent Partner
14:20 – 16:59 Silver – Riot
16:59 – 23:22 1973 – Bruno E.
23:22 – 26:05 Double You – The Mini Vandals
26:05 – 30:28 Town of 24 Bars – Unicorn Heads
30:28 – 34:34 Remembering Her Face – Silent Partner
34:34 – 38:04 Promises – Letter Box
38:04 – 41:03 In the Shadows – Ethan Meixsell
41:03 – 46:09 To the Sun and Back – TrackTribe
46:09 – 48:55 The Big Conference – DJ Williams
48:55 – 53:35 Heading West – Audionautix
53:35 – 57:45 We Could Reach – Freedom Trail Studio
57:45 Texas Napkin – Freedom Trail Studio

Introduction

In this article there are decorative 3D models to download and use in your projects at Unity.

For each model there are representative images and a brief description of the model, indicating data such as the topology and the quantity of materials.

The models are in .fbx format and can be imported directly into the Unity engine.

You can use these models to build prototypes quickly. I hope you find them useful.

Frames

This set of paintings is prepared for you to import it into Unity and you can put any image you want, as long as they are square or aspect ratio 16:9 or 9:16.

It also has several textures for the frames.

Vertices: 36 Faces:  27

Table

A simple table for 6 people with PBR textures.

Vertices: 184 Faces: 186

Chair

A simple chair with PBR textures.

Vertices: 132 Faces: 88

Shelf – 4 Shelves

Shelf model with 4 shelves. In the download are included the 3 textures that are observed in the image.

Vertices: 72 Faces: 55

Shelf – 3 Shelves and drawers

Shelf model with 3 shelves and a space for drawers or doors. This space is not functional, i.e. the drawers cannot be opened, it is only decorative. In the download come the two textures that are seen in the image.

Vertices: 68 Faces: 56

Chess Set

Set of chess pieces and table. Each piece is an individual model and can be given movement.

Vertices: 4169 Faces: 4102

Candlestick

Vertices: 256 Faces: 231

Introduction

In this article there are Seamless PBR Textures of floors to download and apply to your 3D models.

A Seamless texture is a texture with horizontal and vertical symmetry in such a way that it can be placed one after the other and the result is a continuous texture.

The term PBR is “physics-based rendering” and means that these textures are prepared to behave appropriately with light sources. These particular textures are adapted to the Unity engine (Metallic Workflow).

For each texture there are representative images and a brief description, indicating data such as the resolution.

The textures have several maps each and are in PNG format.

You can use these textures to apply to your 3D models in Unity and build prototypes quickly. I hope you find them useful.

Brick floor

Resolution: 1024 x 1024 – Maps: 3 – Format: PNG

Introduction

In this article there are 3D models of kitchen elements to download and use in your projects at Unity.

For each model there are representative images rendered in Blender 2.8 and a brief description of the model, indicating topology data and materials.

The models are in .fbx format and can be imported directly into the Unity engine.

You can use these models to build prototypes quickly. I hope you find them useful.

Pot

Vertices: 146 – Faces: 144

Gas Range

Vertices: 663 – Faces:  527

Introduction

In this section you can find 3D models of tools to download and directly import into Unity, ready to use in your projects.

Depending on the model, some have textures or another particular feature.

The models are in .fbx format and can be imported directly into the Unity engine.

You can use these models to build prototypes quickly. I hope you find them useful.

Miscellaneous Tools

This is a set with several small hand tools, has textures and is intended to function as decoration.

Vertices: 379 – Faces:  375 – Textures: Yes

Crowbar

Vertices: 108 – Faces:  107 – Textures: Yes

Axe

Vertices: 112 – Faces: 108 – Textures: Yes

Shovel

Vertices: 224 – Faces: 208 – Textures: No

Hoe

Vertices: 116 – Faces: 106 – Textures: Yes

Introduction

In this section you can find 3D models of weapons to download and directly import into Unity, ready to use in your projects.

Depending on the model, some have textures or another particular feature.

The models are in .fbx format and can be imported directly into the Unity engine.

You can use these models to build prototypes quickly. I hope you find them useful.

Knife

A simple knife to use in a hand or throw. The model has PBR textures.

  Vertices: 147 Faces:  144 Textures: Yes

Katana

Japanese sword with PBR textures.

Vertices: 558 Faces:  574 Textures: Yes

Short Shotgun

This model short shotgun comes in two parts, one the body of the gun and another the recharging system. The model has PBR textures.

  Vertices: 450 Faces: 404 Textures: Yes

RPG-7 – Rocket Launcher

This model of rocket launcher is separated, on one side the body of the weapon and on the other the projectile. It also has PBR textures made by me.

  Vertices: 775 Faces: 694 Textures: Yes

Introduction

In this article there are 3D models of tables to download and use in your projects at Unity.

For each model there are representative images rendered in Blender 2.8 and a brief description of the model, indicating topology data and materials.

The models are in .fbx format and can be imported directly into the Unity engine.

You can use these models to build prototypes quickly. I hope you find them useful.

Rectangular Table

This is a rectangular table for six people, has two materials, one for the legs and body parts and the second material for the top.

Vertices: 204 – Faces: 206 – Materials: 2

Oval Table

Table with oval top for six people, the legs are designed to be metal and the top of glass.

Vertices: 792 – Faces: 724 – Materials: 2


Small table

Small table for living room, designed with a metal structure and two pieces of glass.

Vertices: 168 – Faces: 156 – Materials: 2

Nightstand

Nightstand for bedroom, has a decorative drawer (does not open).

Vertices: 120 – Faces: 122 – Materials: 2

Corner table

Corner with two pieces of glass.

Vertices: 78 – Faces: 53 – Materials: 2

Introduction

In this article we are going to see the RigidBody component in Unity, what it is for and how to use it. Knowing about this component will allow you to create precise physics in your game.

What is a RigidBody in Unity?

First RigidBody in Unity is a “Programming Class” defined at the core of the engine and accessible via Script using the namespace “UnityEngine”. This in simple terms means that it is a programming structure that seeks to model a particular type of behavior. Here you can see an introduction to classes in programming.

RigidBody means Rigid Body, which in the study of physics is a way of thinking about certain objects and being able to make calculations and predictions in different scenarios.

The RigidBody class models the concept of Rigid Body in physics and allows us to treat GameObjects as if they were physical objects that have their own mass, are affected by gravity, can collide with other objects, exert forces on other bodies, have a coefficient of friction depending on the surface they are on, have linear and angular velocity, inertia, angular momentum.

To these bodies we can apply forces or torques and these Rigid Bodies will respond based on the classical equations of Newtonian physics. Beautiful!

What is a GameObject in Unity

Rigidbody Component in Unity

In the Unity hierarchy we have the list of GameObjects that are in the scene. If we choose one of them, we will be able to see its components in the inspector and add the ones we need to model its behavior. Here we can add to the GameObject the RigidBody component that will provide the physical Rigid Body behavior.

Colliders and RigidBody

Colliders are fundamental to being able to use a GameObject as a Rigid Body, as they provide the GameObject with a border to determine when it collides with other objects.

In the following video you can see different types of Colliders and in the final part how it relates to the RigidBody component. English Subtitles available.




Apply forces to a RigidBody in Unity

Because RigidBody is a class, it has a variety of public methods that allow you to access your internal state or perform certain functions. Among them is the possibility to apply a certain force to the GameObject. With the following instruction you can add a force to a Rigidbody:

aRigidbodyComponent.AddForce(forceVector);

Where “aRigidbodyComponent” is a variable which has the reference of a Rigidbody component and “forceVector” is a vector that describes the force to apply, that is to say its magnitude, sense and orientation.

Conclusion

RigidBody is a Programming Class defined in the engine core, accessible by the namespace UnityEngine. This class allows us to give GameObjects the behavior of physical Rigid Bodies with all that entails.

Colliders are essential to delimit the Rigid Body border and to calculate forces and collisions with other GameObjects with RigidBody.

Using the public methods of the RigidBody Class we will be able to apply forces, linear and angular velocities, torque and modify a great variety of properties present in the study of Newtonian physics.

Introduction

In this article we are going to analyze Unity’s FixedUpdate method which allows us to make changes over time in our projects.

A method is a function defined in a script that can be executed and performs the task we define inside it. To learn more about methods in programming you can read this article or watch a video that summarizes the information.

IMPORTANT

Here you have two videos about the FixedUpdate function in Unity. In the video on the left we see a prototype made in Unity to point the differences between the Update and FixedUpdate functions in Unity. You can download the Unity Package in this article. In the video from the right we see how to gradually change variables in Unity, making incremental changes inside the UPDATE or the FIXEDUPDATE method in Unity.

MY UNITY PLAYLIST WITH SEVERAL VIDEOS THAT YOU MAY FIND USEFUL
👇🏽

FixedUpdate Method in Unity – MonoBehaviours

The Update function is defined in the MonoBehaviour class and will run automatically in each frame of the game if the MonoBehaviour is active.

By default, the time between consecutive FixedUpdate runs is 20 milliseconds or 0.02 seconds. This time can be seen and modified in the tab Edit > Project Settings > Time – Fixed Timestep.

When we create a new Script in Unity, by default we’ll get some code already written. In this code is defined a Programming Class that is called equal to the name that we gave to the Script and that extends or inherits its behavior of MonoBehaviour, this in simple terms means that our Script is in itself a MonoBehaviour or a particular case of MonoBehaviour.

MonoBehaviours can be added to the GameObjects that are in the hierarchy, this can be done from the inspector using the “Add Component” button or simply dragging the Script to the GameObject inspector.

Execution of the FixedUpdate Function

While the game is running, Unity automatically takes all the MonoBehaviours on the scene and performs the FixedUpdate methods every time the “Fixed Timestep” time is met. So we don’t have to execute this method manually, the engine takes care of it.

This means that the FixedUpdate function will run periodically while our game is running.

Regardless of the FPS (frames per second) of our game, the FixedUpdate method will run at regular intervals, 50 times per second if the Fixed Timestep is set to 0.02 seconds.

Conclusion – FixedUpdate for evenly spaced changes in time

The FixedUpdate method represents the dynamic part of a game in Unity, when we want to produce changes in time and that these changes are applied at regular intervals, we resort to the FixedUpdate function.

A typical application of this function is to make the movement of objects or some animations that we do in a procedural way.

When moving objects in FixedUpdate, the speed of the object will be the one we indicate. If we move objects in the Update function, when our game runs at more FPS, the object will move faster than when the game runs slower.

It is useful to understand the order of execution of the Start, Update and FixedUpdate methods since it allows us to identify different moments in the execution of the game.

Introduction

In this article we analyze the Update function from the Unity engine, that function is defined inside the MonoBehaviour objects and it’s automatically executed every frame by Unity on every MonoBehaviour that is enabled.

So the update method allows us to make changes over time in our game or application made in Unity. For example we can move objects or gradually change a color inside an Update.

ABOUT THESE VIDEOS

Here you have two videos about the UPDATE FUNCTION in Unity. In the video on the left we see a prototype made in Unity to point the differences between the Update and FixedUpdate functions in Unity.


Update Method in Unity – MonoBehaviours

The Update function is defined in the MonoBehaviour class and will run automatically in each frame of the game if the MonoBehaviour is active.

When we create a new Script in Unity, by default we’ll get some code already written. In this code is defined a Programming Class that is called equal to the name that we gave to the Script and that extends or inherits its behavior of MonoBehaviour, this in simple terms means that our Script is in itself a MonoBehaviour or a particular case of MonoBehaviour.

MonoBehaviours can be added to the GameObjects that are in the hierarchy, this can be done from the inspector using the “Add Component” button or simply dragging the Script to the GameObject inspector.

Execution of the Update function

When running the game, Unity will automatically take all the MonoBehaviours in the scene and perform the Update methods before displaying each frame in the game. So we don’t have to do the execution of this method manually, the engine takes care of it.

This means that the Update function will run periodically while our game is running.

If our game runs at 60 FPS (frames per second) the Update function will run 60 times per second.

Conclusion – Update for changes in time

The Update method represents everything that is dynamic in our game, when we want to produce changes in time Update is one of the functions that we have to consider.

It is useful to understand the order of execution of the Start, Update and FixedUpdate methods since it allows us to identify different moments in the execution of the game.

Introduction

GameObjects are entities that we can place in Unity scenes, each GameObject will occupy a place in the hierarchy.

In the context of programming a GameObject is a Programming Class.



Basic features of a GameObject

Let’s see what are the basic features and components of an Empty GameObject which is the most general that we can add in a Unity scene.

Let’s consider that we have an Empty GameObject in the scene called “Object1”, with this GameObject we are going to exemplify the way to access its components.

Transform Component

GameObjects will have at least one Transform component that will indicate their position, rotation and scale in the scene.

We can access the reference of your Transform component using the dot operator as follows:

object1.transform

If we wanted to access the Vector3 that represents the position of the GameObject in the scene again we use the operator dot in the following way:

object1.transform.position

If we wanted to access the float that represents the component and the position of the object in the scene we can do the following:

object1.transform.position.y

The same applies for the other members of the Transform component.

object1.transform.rotation

object1.transform.scale

Tags

A GameObject has a Tag assigned to it that allows you to distinguish it from other GameObjects in the scene, list it using that Tag, or perform some function if the object has a certain Tag assigned to it.

Layers

Layers are assigned to GameObjects and in the same way that Tags allow us to list them and perform actions if the GameObject belongs to a certain layer.

A more interesting application of Layers is in the rendering of GameObjects. We can configure several cameras in the scene and make each camera capture one or more particular Layers.

SetActive Method

This method allows you to enable or disable the GameObject in the hierarchy through code, the result is equivalent to marking or unchecking the tilde at the top of the inspector when the object is selected.

To activate it we do:

object1.SetActive(true);

To deactivate it:

object1.SetActive(false);

A video on how to activate and deactivate GameObjects through code




GetComponent Method

This method allows to obtain the reference of a component of some specific type that is assigned to the GameObject. To find out what a method is in programming you can click here.

Suppose our GameObject is called “object1” and has an AudioSource type component assigned to it, this AudioSource component will allow the GameObject to emit sounds. Now, if we want to access through code to the AudioSource component attached to our GameObject, for example to gradually lower down the volume, we can do it with the GetComponent function, this way:

object1.GetComponent<AudioSource>();

The previous intruction returns us the AudioSource reference assigned to the “object1” GameObject.

If the GameObject has more than one such component, we can do the following:

object1.GetComponents<AudioSource>();

This returns an Array containing all the components of that type that the object has assigned to it.

Flexibility to build complex GameObjects

We mentioned that Empty GameObject is the simplest type of object we can find in a scene in Unity.

We can customize these objects as much as we need, add pre-existing components in the Unity engine or our own programming scripts. This will make each GameObject have a specialized behavior.

Conclusion

We have seen what a GameObject is in Unity, what are its main components and the possibility of adding as many components as necessary to build the objects we need in our world.

The simplest object in a scene will be assigned a Transform component that will indicate its position, rotation and scale in the scene. It will be assigned a Tag and a Layer that allow grouping objects and performing appropriate functions for each group.

In the field of programming GameObject is a class of programming, which has fields and methods that define it. You can consult the list of all its members in the API of Unity.

Introduction

In this article we are going to study the geometric figure circle, its characteristics and mathematical equation.

Definition of a circle

A circle is a geometric figure in which all its points are at the same distance from a given point called the center, this distance is known as the radius of the circle.

Fig. 1: Graph of a generic circumference of radius R and centre at point (a,b).

Equation of a Circle

Knowing the mathematical expression of a circumference we will be able to draw it in the Cartesian plane and later use it in our projects of programming and development of videogames.

Cartesian coordinates

The expression that defines a circle in Cartesian coordinates is the following:

(1)  

Where R is the radius of the circumference and its center is located at point (a,b) of the Cartesian plane.

In this case to draw the circle we must know the range of values of the variables X and Y. For example, let’s consider the circle unit centered in (0,0):

(2)  

If we draw a circle of radius 1 with center in (0,0) we can see that both the values of X and Y will be in the interval [-1,1]. By choosing a value from that interval and assigning it to one of the variables we will be able to clear the equation and obtain the value of the other variable.

Parametric coordinates

The expression of a circumference in the parametric coordinate system may also be useful, since the range of variation of the parameter is infinite since it is defined with periodic functions. The expression of a circle is given by the following system of equations.

x=a+r.cos(t)

y=b+r.sin(t)

(3)  


By varying the t parameter between 0 and 2π we obtain all the points of the circumference.

As we mentioned before the parameter t can take values from less infinite to more infinite and will always return some point of the circumference, because the sinuses and cosines are periodic functions.

Circle and mathematical functions

It must be borne in mind that there is no mathematical function that defines the circle since, by definition, a function is an expression in which it is fulfilled that, for each value of the independent variable, there is only one value for the dependent variable.

In others for it to be a function we must be able to draw a vertical line anywhere on the graph and this should cut the function into a single point. This does not happen in the circle, since if we take for example the line coincident with the Y axis, we see that it cuts the circle unit centered in (0,0) in two points.

What we can do is clear the variable and in equation 1.

(4)  

The absolute value arises when taking the square root of an expression that is elevated to the square, this gives rise to two possible values for that expression, one positive and the other negative, that define the lower and upper cap of the circumference.

Semicircle – Concave from below

The expression of the function that represents the top semicircle of a generic circle is:

(5)  

Semicircle – Concave from above

The expression of the function that represents the bottom semicircle of a generic circle is:

(6)  

Perimeter of a circle

The perimeter of a circle is the length of its boundary, let’s imagine that we make a mark in a point of the circle, we place that point in the 0 of a line and we make it turn forward, the point where the mark touches the line again is the value of the perimeter of the circumference. Mathematically it can be calculated as:

(7)  

Pi has an approximate value of 3.1415 and r is the radius of the circumference.

Area of a circle

The area of a circle is the result of multiplying the number Pi by the radius of the circle squared. Mathematically:

(8)  

Introduction

In this article we are going to see how to export 3D models, with materials, UV maps and animations, from Blender to the Unity engine, in which format and a some useful tips to prepare models before exporting.

A video about this:


How to export a 3D model?

The process is simple, being in object mode, we select the 3D model or models that we want to export. Then click on File > Export and choose the format to which you want to export it.

In my case I always check the “Selected Only” box to export only the selected 3D models to Unity.

Format to use

The format I use is .fbx (Filmbox), which has not given me any inconvenience and allows me to export the materials contained in the 3D model, the animation skeletons, the actions defined with the Action Editor and the Shape Keys.

Things I take into account before exporting

Before exporting from Blender to Unity I try to improve certain aspects of the 3D model in order to have everything as organized and simple as possible.

About the names of the 3D models

In Blender’s Outliner we can modify the names of objects and since those names are going to be exported directly from Blender to Unity, I like them to be as descriptive as possible.

In the long run, when we have many 3D models in our project, organization is fundamental.

About the origins of 3D models

The origin of an object is the point in the space that represents it. The transformations of translation, rotation and scale of the object will be applied with respect to that point. So, in general, we are interested in its being in a coherent place in the 3D model.

The Blender 3D Cursor is used to change the position of the origin.

We enter the geometry editing mode and select a vertex, edge or face where we want to place the origin. Then press “CTRL + SHIFT + S” and choose the option “Cursor to Selected”, to move the 3D cursor to the selected element.

Go back to Object mode, right click on the 3D model, go to the “Set Origin” option and choose “Origin to 3D Cursor”. This will place the coordinate origin of the 3D model in the position where the cursor is.

Introduction

In this article we are going to see what is a floating point and how decimal values are represented using this system.

Floating point representation is a way of writing a decimal number that resembles scientific notation. This allows us to represent and operate with very large numbers and also with very small numbers (with many decimals).

The floating point computing standard is described in IEEE 754.

Structure of a floating point number

This representation system uses a certain number of binary digits depending on the type of accuracy (commonly 16, 32, 64 and 128 bits).

A bit is destined to the sign, i.e. if that bit is worth 0 it is a positive number, if it is worth 1 it is a negative number.

The remaining bits are distributed in the representation of the decimals (usually called mantissa) and the exponent.

   

In the expression n it is the decimal number to represent.

The letter s is the bit for the sign (if s is 0, the expression (-1) raised to 0 results in 1 positive).

The letter e is the exponent and m is the mantissa.

Move decimal numbers to floating point

1- Take the number to represent, separate the sign and write the absolute value in base 2.

2- The absolute value in base 2 is written in scientific notation in normalized base 2.

3- The exponent is expressed in excess notation (it will depend on the type of precision chosen).

4- The coefficient is written on the mantissa without the whole part, because the normalization in step 2 forces the whole part of the mantissa to be 1, storing it does not provide information.

System Truncation Error Floating Point

A truncation error occurs when you take a certain number of digits from one number and leave out the others.

Think of the number π (3.14159265…), which is an irrational number with infinite digits.

Computers cannot store infinite information in memory because infinitely large memory would be needed, so at some point it must stop.

If we truncate all the decimal part to π and we are left with only 3, we will be making an error of approximately 4.5% relative to the real value of π . If on the other hand we take into account the first two decimals of π, we are left with 3.14. In this case we will be making an error of approximately 0.05% relative to the real value of π.

This error will occur in the floating point system either because we want to represent irrational numbers or because the decimal we want to represent becomes irrational when passed to the binary system (example 0.1 decimal has infinite digits when passed to binary).

Introduction

In this article we will look at what a programming paradigm is for information purposes and give some examples.

The first generations of computers were programmed using machine language, i.e. a sequence of instructions was given that the machine understood. As it was difficult to remember the codes of these instructions, the Assembler language was created, which also consisted of a set of instructions for the machine, but written with words simple to remember.

With advances in technology, programming languages emerged, allowing programmers to increase the level of abstraction and solve more complex problems.

What is a Programming Paradigm?

Programming in high-level languages can take several forms, i.e. we can tackle problem solving from different angles.

There are different ways of designing a language and various ways of working to get the results that programmers need. These ways of thinking or working are called PROGRAMMING LANGUAGE PARADIGM.

A continuación vamos a mencionar algunos de estos paradigmas.

Imperative Paradigm

Programs consist of a succession of instructions or commands, as if the programmer were giving specific commands.

This is the simplest way to attack problems, but it becomes inefficient when problems are complex.

Logical Paradigm

This paradigm, as its name indicates, is based on logical thinking, which is natural for us to understand. Using logic, complex problems can be expressed in a formal way, elaborating premises and then applying hypotheses, axioms and theorems for resolution.

Logical programming is optimal in artificial intelligence applications. The Prolog language uses this paradigm.

Functional Paradigm

This paradigm consists of creating functions that solve a certain type of problems and then calling them when needed. These functions may contain other functions within them.

Some languages that use this paradigm are Haskell and Python.

Object Oriented Paradigm

In this paradigm models of objects are constructed, which are abstract entities that have defined a set of data and functions inside.

Go to the Object Oriented Programming section.

Some languages that use this paradigm are C++, Java and C#.

Exit mobile version
Secured By miniOrange