3DCategorySubscribe
Roblox – Import a FBX model.
In this tutorial, I will show you how to import a model created with Blender 2.8 software. The Roblox Studio can import FBX file format like meshes. First, let’s see how can be imported into Roblox Studio. To import meshes use the Import button at the bottom of the Game… Continue Reading Roblox – Import a FBX model.
Blender 3D – Render with alpha transparency on 2.8 version.
This simple issue about renders image and video is easy to solve. Go to Properties Editor and select the Render. As you know already, the Properties Editor is used to edit data and properties for the Active Scene and the Active Object. First, check if in the Output tab (from… Continue Reading Blender 3D – Render with alpha transparency on 2.8 version.
Blender 3D – new text effect strip.
This new option is available from Blender 3D version 2.76 and lets you add a text effect strip into your video using Video Editing layout. Select the Video Editing from Screen layout checkbox. Next, you can add the text effect strip from Add – Effect Strip – Text, see the… Continue Reading Blender 3D – new text effect strip.
Blender 3D – sin mesh object with python.
This is a simple example of creating one object from vertices and edges using sin function. First, you need to create the mesh with bpy.data.meshes.new. The number is random, you can use any number for vertices and edges. This number is points for drawing the sin function. The spaces variable… Continue Reading Blender 3D – sin mesh object with python.
Blender 3D – script to show python code under console.
To run this script you need to select the render to Cycles Render. Then go to Compositing from Screen layout ( in the top of the screen) and select Use Nodes from Material. This will make a default material with a Diffuse BSDF. The next step is to select Scripting… Continue Reading Blender 3D – script to show python code under console.
The Virtual Reality – part 001.
Briefly, the acronym is recognized as VR and come with this comes with this definition: Virtual reality is the term used to describe a three-dimensional, computer-generated environment which can be explored and interacted with by a person. That person becomes part of this virtual world or is immersed within this… Continue Reading The Virtual Reality – part 001.
Unity 3D – C# script – save and load file.
This is a simple C# script example for a C# class Player. The class Player come with this content into Player.cs C# script:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | using UnityEngine; using System.Collections; public class Player : MonoBehaviour { public int level = 1; public int energy = 100; public int health = 100; public int attack = 5; public int defense = 2; //make Save and Load public void Save() { SaveLoadManager.SavePlayer(this); } public void Load() { int[] loadStat = SaveLoadManager.LoadPlayer(); level = loadStat[0]; energy = loadStat[1]; health = loadStat[2]; attack = loadStat[3]; defense = loadStat[4]; } // Use this for initialization void Start () { } // Update is called once per frame void Update () { } } |
To make this C# script for saving the Player into one file I used this C# script named SaveLoadManager.cs:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | using UnityEngine; using System; using System.Collections; using System.Runtime.Serialization.Formatters.Binary; using System.IO; public static class SaveLoadManager { public static void SavePlayer(Player player) { //create binary file BinaryFormatter bf = new BinaryFormatter(); FileStream stream = new FileStream(Application.persistentDataPath+"/player.sav",FileMode.Create); //this will use the class PlayerData PlayerData data = new PlayerData(player); //use Serialize - bf.Serialize(stream, data); //close file stream stream.Close(); } //load the file public static int[] LoadPlayer() { //check the file exist if (File.Exists(Application.persistentDataPath + "/player.sav")) { //open binary file BinaryFormatter bf = new BinaryFormatter(); FileStream stream = new FileStream(Application.persistentDataPath + "/player.sav", FileMode.Open); PlayerData data = bf.Deserialize(stream) as PlayerData; //close file stream stream.Close(); //return data from file return data.stats; } else { Debug.LogError("File don't exist!"); return new int[5]; } } } // need to use using System; to use Serializable area. [Serializable] public class PlayerData { // more convenient for us to store data public int[] stats; public PlayerData(Player player) { stats = new int[5]; stats[0] = player.level; stats[1] = player.energy; stats[2] = player.health; stats[3] = player.attack; stats[4] = player.defense; } } |
The script come with two parts… Continue Reading Unity 3D – C# script – save and load file.