Category Archives: 3D

Blender 3D – addon to export your model online.

After you make your model under Blender 3D you can share it with one great addon to this website.
This is my model share with this addon:

Split wood 001
by catafest
on Sketchfab

To add this addon go to File – User Preferences – Addons and search with this word: sketchfab. Check this addon and the presss Save User Settings.
Make your model with materials , UV maps, textures and normal textures to have a great model.
When your model is finished then press T key to see the left panel and you will see Upload tab (first is Tool tab and the last is Upload).
You need to have a account to the website. Fill with your email adress and then you need to press OK button to get one mail with the Api Key. Because you cannot put with copy paste from your mail to Blender 3D use this tips and tricks.
Copy your Api Key from your mail and open a text into Blender 3D – TextEditor and then use copy – paste to fill the input named Api Key.
With your 3d model then just press Upload and then after few seconds View Online Model button to open browser with your model under sketchfab website.
See this image for setup your Api Key with your token:
sketchfab_001

Posted in 3D, All, Blender 3D. Tagged with , , , , , , , .

Blender 3D – add modifier: Boolean .

Today I will show you how to use add modifier boolean.
First start with your Blender 3D software – I used the 2.77a version.
I used two cylinders with 16 vertices , radius 1.00 and depth 2.00.
I rename the first cylinder – Hole_Cylinder and this will be the surface of the hole.
The next cylinder is named – Surface_Cylinder and will be the result of this modifier.
Into Object Mode , select first Hole_Cylinder and then with key Shift select Surface_Cylinder.
Go to Add Modifier and select Boolean, and then with Difference over Object – Hole_Cylinder will make the hole.
See the next image to understand how is working.
cylinder_boolean

Posted in 3D, All, Blender 3D. Tagged with , , , , .

WebGL – simple shader example.

This is a simple webgl shader example.
I used a simple HTML5 example with one canvas.
The canvas has named glscreen. The next step is to put one java script with one var named buffer.
The buffer var is used for one array. The Float32Array typed array represents an array of 32-bit floating point numbers.
This var come with this source code into init function.

buffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
gl.bufferData(
gl.ARRAY_BUFFER,
new Float32Array([
-1.0, -1.0,
1.0, -1.0,
-1.0,  1.0,
-1.0,  1.0,
1.0, -1.0,
1.0,  1.0]),
gl.STATIC_DRAW
);
We can see also we have two functions: init and render and this:

var gl;
var canvas;
var buffer;

window.onload = init;
I put also two default shaders for vertex and fragment.
I use some vars for this into init function:

var shaderScript;
var shaderSource;
var vertexShader;
var fragmentShader;

This is the script:

<!DOCTYPE html>
<head>
<title>WebGL – Hello World!</title>
</head>
<body>
<script type=”text/javascript”>
var gl;
var canvas;
var buffer;

window.onload = init;

function init() {
var shaderScript;
var shaderSource;
var vertexShader;
var fragmentShader;

canvas        = document.getElementById(‘glscreen’);
gl            = canvas.getContext(‘experimental-webgl’);
canvas.width  = 640;
canvas.height = 480;

gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
buffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
gl.bufferData(
gl.ARRAY_BUFFER,
new Float32Array([
-1.0, -1.0,
1.0, -1.0,
-1.0,  1.0,
-1.0,  1.0,
1.0, -1.0,
1.0,  1.0]),
gl.STATIC_DRAW
);

render();

}

function render() {

window.requestAnimationFrame(render, canvas);

shaderScript = document.getElementById(“2d-vertex-shader”);
shaderSource = shaderScript.text;
vertexShader = gl.createShader(gl.VERTEX_SHADER);
gl.shaderSource(vertexShader, shaderSource);
gl.compileShader(vertexShader);

shaderScript   = document.getElementById(“2d-fragment-shader”);
shaderSource   = shaderScript.text;
fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
gl.shaderSource(fragmentShader, shaderSource);
gl.compileShader(fragmentShader);

program = gl.createProgram();
gl.attachShader(program, vertexShader);
gl.attachShader(program, fragmentShader);
gl.linkProgram(program);
gl.useProgram(program);
gl.clearColor(0.0, 0.0, 0.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT);

positionLocation = gl.getAttribLocation(program, “local_position”);
gl.enableVertexAttribArray(positionLocation);
gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);
gl.drawArrays(gl.TRIANGLES, 0, 6);
}
</script>
<script id=”2d-vertex-shader” type=”x-shader/x-vertex”>
attribute vec2 local_position;
void main() {
gl_Position = vec4(local_position, 0, 1);
}
</script>
<script id=”2d-fragment-shader” type=”x-shader/x-fragment”>
void main() {
gl_FragColor = vec4(gl_FragCoord.x / 640.0, gl_FragCoord.y / 480.0, 0, 1);
}
</script>
<canvas id=”glscreen”></canvas>
</body>
</html>
The result is this:

shader001

Posted in 3D, All, HTML 5, javascript, Programming, WebGL. Tagged with , , , , .

Blender 3D – hologram effect.

I did not write a tutorial with Blender 3D for a while. Today I used version 2.77 to create a hologram effect tutorial. This tutorial use a simple cube and one plane with subdivision. Just use default scene with cube add a new plane. The next steps are to use TAB key to edit object and W key to select Subdivide. Make this for plane and cube object.
To create the hologram effect you need to select render with Cycles.
Now add one material on Cube and select material to Transparent BSDF.
Open your Node Editor and using Shift+A keys to create this nodes:
hologram effect node blender3d
and the result wil be this:
3D hologram

Posted in 3D, All, Blender 3D. Tagged with , , , , .

Unity 3D with Visual Studio 2015 IDE.

Most of the time I used Mono IDE for Unity 3D.
Today I show you how to use Unity 3D with Visual Studio 2015.
You need to know this solution it’s a little slow but can solve another issues for development.
Some settings we make from start to the end will come with restart of both IDE.
Let’s start with the first step:
First install Visual Studio 2015 from here.
You need to know about the the Visual Studio : it’s on Windows OS only.
Now download Visual Studio Tools for Unity from Unitytools Visual Studio and install this download.
If your instalation will come with Repair just repair it.
This repair option it’s show you when the Visual Studio it’s install with Unity 3D package.
Open your Unity software and make this settings from Unity Preferences ( first menu of Unity 3D software).
Unity_Visual_Studio_tutorial_001
Duble left click to run the Visual Studio Tools for Unity from folder where you put the download.
Unity_Visual_Studio_tutorial_002
Select all and then accept this settings.
Unity_Visual_Studio_tutorial_003
You have one new folder add Assets into your project. You need to make more settings because will not working yet.
Make one new C# script and named it. I used the name : test. Start to develop your script by open this script.
Unity_Visual_Studio_tutorial_004
When you start your development of this script the Visual Studio 2015 start also.
Unity_Visual_Studio_tutorial_005
Now use right click mouse button to add Existing Item… or use the short key.
Unity_Visual_Studio_tutorial_006
Add the DLL files from your Unity 3D project ( Assets -> UnityVS folders).
Unity_Visual_Studio_tutorial_007
Try to build your solution from Visual Studio. Also check the settings of thise two DLL from Unity 3D by left click and check your options. If you got errors then restart both IDE: Visual Studio 2015 and Unity 3D.
This will fix all your imports and settings files.

Posted in 3D, All, Unity 3D, Visual Studio, Windows 10. Tagged with , , , , , .