Fun and useful JS scripts


#1

Please add any scripts that you create or modify that you think others could benefit by or enhance.

In your post please add:

We encourage you to take some of the example scripts that we have created and try them out. Also they are a great resource if you want a starting point to modify and enhance. (High Fidelity example scripts: https://github.com/highfidelity/hifi/tree/master/examples )

To run a script from Interface go to File>Open Run Script File. and select the script to run.


#2

This topic is now pinned. It will appear at the top of its category until it is either unpinned by a moderator, or the Clear Pin button is pressed.


#3

Residential Building: The Genesis - Part 1 [Introduction/Clear Sandbox]

Lets create a simple residential building which will take you through a step-by-step process to create a simple two-story home.

We begin our design near the origin of the grid as I created a small sandbox area which we can all utilize to test the project. You can quickly go to this area by going to the coordinates by going to the FILE menu and selecting GO TO LOCATION and enter the coordinates 30, 191, 1 and press enter.

Let’s save the following script as “erasebuilding.js” and save it to your desktop.

// The Genesis
// ***********
// Created by Kevin M. Thomas
// kevintown.net
//
// Voxel building eraser utilizing JavaScript.  Compatible with the High Fidelity virtual platform.  Collaborative source code freely available.


// Function that erases the entire area of your building.
function eraseBuilding()
{
	// Erases every voxel down the X axis then when it reaches the limit of your plot on the X axis, increment Z and loop the process until the upper bounds of your plot are reached.		
	var x = 30;
	var y = 191;
	var z = 1;

	do
	{	
		while (x <= 51 && z <= 31)
		{
			do
			{
			    Voxels.eraseVoxel(x, y, z, 1.0);
			    x++;
			}
			while (x <= 50);	

			x = 30;
			z++;
		}
		
		z = 1;
		y = y + 1;
	}
	while (y <= 201);	

	// Stop script.	
	Script.stop();
}

Script.update.connect(eraseBuilding);

#4

Residential Building: The Genesis - Part 2 [Plot Survey]

Now that we have cleared the area to begin building in our new sandbox, lets plot the points of the corners of our new building by making a script that colors the corners.

  • White - Front Left
  • Green - Front Right
  • Blue - Rear Left
  • Red - Rear Right

Let’s save the following script as “makeplotsurvey.js” and save it to your desktop.

// The Genesis
// ***********
// Created by Kevin M. Thomas
// kevintown.net
//
// Voxel plot survey utilizing JavaScript.  Compatible with the High Fidelity virtual platform.  Collaborative source code freely available.
 
 
// Function to make a voxel plot survey on your plot.
function makePlotSurvey()
{
	// Front Left (White).
	Voxels.setVoxel(30, 191, 1, 1.0, 255, 255, 255);
	// Front Right (Green).
	Voxels.setVoxel(30, 191, 30, 1.0, 0, 255, 0);
	// Rear Left (Blue).
	Voxels.setVoxel(50, 191, 1, 1.0, 0, 0, 255);
	// Rear Right (Red).
	Voxels.setVoxel(50, 191, 30, 1.0, 255, 0, 0);
 
	// Stop script.	
	Script.stop();
}
 
Script.update.connect(makePlotSurvey);

#5

Residential Building: The Genesis - Part 3 [1st Floor Architectural Design]

We now have a clear set of points representing our foundation footers to which we can now begin designing the first floor. Let’s graph out a design with graph paper of the first floor. If you don’t have graph paper, you can download some here for free:
DOWNLOAD

Here I have the exterior walls shaded dark and the inner square area to be our 1st floor - floor.

Keep in mind, when building, it is good to make the exterior wall areas the outer perimeter and keep the floor area part of the inner perimeter as it allows you to keep the floor colors from bleeding to the outside structure of your new design.

As you can see I have indicated Y as fixed at 191 and the X axis is indicated on the left beginning at 30 and ending at 50 and the Z axis indicated on the top starting at 1 and going to 30.


#6

Residential Building: The Genesis - Part 4 [1st Floor Build]

Now comes the fun part! Lets create a smile 1st floor structure and use a nice brown color (56, 46, 36) which represents a hard-wood floor, which I have provided in the setVoxel parameter as listed below:

Voxels.setVoxel(x, y, z, 1.0, 56, 46, 36);

Let’s create a floor that starts at coordinate 31 on the X axis and create voxels down the X axis to when it reaches the limit of your plot on the X axis (49), increment Z and loop the process until the upper bounds of your plot are reached on the Z axis (29).

Let’s save the following script as “make1stfloor.js” and save it to your desktop.

 // The Genesis
    // ***********
    // Created by Kevin M. Thomas
    // kevintown.net
    //
    // Voxel 1st floor builder utilizing JavaScript.  Compatible with the High Fidelity virtual platform.  Collaborative source code freely available.
    
    
    // Function that makes the 1st floor on our plot.
    function make1stFloor()
    {
    	// Create a 1st floor, section 1, which creates voxels down the X axis then when it reaches the limit of your plot on the X axis, increment Z and loop the process until the upper bounds of your plot are reached.
    	var x = 31;
    	var y = 191;
    	var z = 2;
    
    	while (x <= 49 && z <= 29)
    	{
    		do
    		{
    			Voxels.setVoxel(x, y, z, 1.0, 56, 46, 36);
    			x++;
    		
    		} 
    		while (x <= 49);	
    	
    		x = 31;
    		z++;
    	}
    
    	// Stop script.	
    	Script.stop();
    }
    
    Script.update.connect(make1stFloor);

#7

Residential Building: The Genesis - Part 5 [1st Floor Exterior Walls Build]

Now that we have a nice floor to walk on, lets add a first floor exterior structure with a light yellow color and add a few windows with blue trim and an exterior doorway with black trim. Let’s add to our original graph and add some lines and indicate a W for a window and D for a door. This will help when modding the script and if you decide to make your own house from the examples.

The script is a little involved however I took time to document each item so you can easily mod.

Let’s save the following script as “make1stexteriorwalls.js” and save it to your desktop.

// The Genesis
// ***********
// Created by Kevin M. Thomas
// kevintown.net
//
// Voxel 1st exterior walls builder utilizing JavaScript.  Compatible with the High Fidelity virtual platform.  Collaborative source code freely available.


// Function to make 1st floor exterior walls on your plot.
function make1stExteriorWalls()
{
	// Create left wall, section 1, down the X axis.
	var x = 30;
	var y = 191;
	var z = 1;

	while (y <= 194)
	{
		do
		{
			Voxels.setVoxel(x, y, z, 1.0, 219, 240, 84);
			x++;
		}
		while (x <= 50);
		
		x = 30;		
		y++;
	}

	// Erase wall voxels, section 1, to create a window.
	Voxels.eraseVoxel(37, 193, 1, 1);
	Voxels.eraseVoxel(38, 193, 1, 1);
	Voxels.eraseVoxel(39, 193, 1, 1);
	Voxels.eraseVoxel(40, 193, 1, 1);
	Voxels.eraseVoxel(41, 193, 1, 1);
	Voxels.eraseVoxel(42, 193, 1, 1);
	Voxels.eraseVoxel(43, 193, 1, 1);

	// Create exterior window frame, section 1, part 1, down the X axis.
	var x = 36.75;
	var y = 194;
	var z = .75;
	
	while (x <= 44)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		x = x + .25;
	}
	
	// Create exterior window frame, section 1, part 2, up the Y axis.
	var x = 44;
	var y = 192.75;
	var z = .75;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create exterior window frame, section 1, part 3, down the X axis.
	var x = 36.75;
	var y = 192.75;
	var z = .75;
	
	while (x <= 44)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		x = x + .25;
	}

	// Create exterior window frame, section 1, part 4, up the Y axis.
	var x = 36.75;
	var y = 192.75;
	var z = .75;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create interior window frame, section 1, part 1, down the X axis.
	var x = 36.75;
	var y = 194;
	var z = 2;
	
	while (x <= 44)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		x = x + .25;
	}
	
	// Create interior window frame, section 1, part 2, up the Y axis.
	var x = 44;
	var y = 192.75;
	var z = 2;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create interior window frame, section 1, part 3, down the X axis.
	var x = 36.75;
	var y = 192.75;
	var z = 2;
	
	while (x <= 44)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		x = x + .25;
	}

	// Create interior window frame, section 1, part 4, up the Y axis.
	var x = 36.75;
	var y = 192.75;
	var z = 2;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create rear wall, section 2, across the Z axis.
	var x = 50;
	var y = 191;
	var z = 1;

	while (y <= 194)
	{
		do
		{
			Voxels.setVoxel(x, y, z, 1.0, 219, 240, 84);
			z++;
		}
		while (z <= 30);
		
		z = 1;		
		y++;
	}

	// Erase wall voxels, section 2, to create a window.
	Voxels.eraseVoxel(50, 193, 7, 1);
	Voxels.eraseVoxel(50, 193, 8, 1);
	Voxels.eraseVoxel(50, 193, 9, 1);
	Voxels.eraseVoxel(50, 193, 10, 1);
	Voxels.eraseVoxel(50, 193, 11, 1);
	Voxels.eraseVoxel(50, 193, 12, 1);
	Voxels.eraseVoxel(50, 193, 13, 1);
	Voxels.eraseVoxel(50, 193, 14, 1);
	Voxels.eraseVoxel(50, 193, 15, 1);
	Voxels.eraseVoxel(50, 193, 16, 1);
	Voxels.eraseVoxel(50, 193, 17, 1);
	Voxels.eraseVoxel(50, 193, 18, 1);
	Voxels.eraseVoxel(50, 193, 19, 1);
	Voxels.eraseVoxel(50, 193, 20, 1);
	Voxels.eraseVoxel(50, 193, 21, 1);
	Voxels.eraseVoxel(50, 193, 22, 1);
	Voxels.eraseVoxel(50, 193, 23, 1);
	Voxels.eraseVoxel(50, 193, 24, 1);

	// Create exterior window frame, section 2, part 1, across the Z axis.
	var x = 51;
	var y = 194;
	var z = 6.75;
	
	while (z <= 25)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		z = z + .25;
	}
	
	// Create exterior window frame, section 2, part 2, up the Y axis.
	var x = 51;
	var y = 192.75;
	var z = 6.75;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create exterior window frame, section 2, part 3, across the Z axis.
	var x = 51;
	var y = 192.75;
	var z = 6.75;
	
	while (z <= 25)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		z = z + .25;
	}

	// Create exterior window frame, section 2, part 4, up the Y axis.
	var x = 51;
	var y = 192.75;
	var z = 25;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create interior window frame, section 2, part 1, across the Z axis.
	var x = 49.75;
	var y = 194;
	var z = 6.75;
	
	while (z <= 25)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		z = z + .25;
	}
	
	// Create interior window frame, section 2, part 2, up the Y axis.
	var x = 49.75;
	var y = 192.75;
	var z = 6.75;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create interior window frame, section 2, part 3, across the Z axis.
	var x = 49.75;
	var y = 192.75;
	var z = 6.75;
	
	while (z <= 25)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		z = z + .25;
	}

	// Create interior window frame, section 2, part 4, up the Y axis.
	var x = 49.75;
	var y = 192.75;
	var z = 25;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create right wall, section 3, down the X axis.
	var x = 30;
	var y = 191;
	var z = 30;

	while (y <= 194)
	{
		do
		{
			Voxels.setVoxel(x, y, z, 1.0, 219, 240, 84);
			x++;
		}
		while (x <= 50);
		
		x = 30;		
		y++;
	}

	// Erase wall voxels, section 3, to create a window.
	Voxels.eraseVoxel(37, 193, 30, 1);
	Voxels.eraseVoxel(38, 193, 30, 1);
	Voxels.eraseVoxel(39, 193, 30, 1);
	Voxels.eraseVoxel(40, 193, 30, 1);
	Voxels.eraseVoxel(41, 193, 30, 1);
	Voxels.eraseVoxel(42, 193, 30, 1);
	Voxels.eraseVoxel(43, 193, 30, 1);

	// Create exterior window frame, section 3, part 1, down the X axis.
	var x = 36.75;
	var y = 194;
	var z = 31;
	
	while (x <= 44)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		x = x + .25;
	}
	
	// Create exterior window frame, section 3, part 2, up the Y axis.
	var x = 44;
	var y = 192.75;
	var z = 31;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create exterior window frame, section 3, part 3, down the X axis.
	var x = 36.75;
	var y = 192.75;
	var z = 31;
	
	while (x <= 44)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		x = x + .25;
	}

	// Create exterior window frame, section 3, part 4, up the Y axis.
	var x = 36.75;
	var y = 192.75;
	var z = 31;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create interior window frame, section 3, part 1, down the X axis.
	var x = 36.75;
	var y = 194;
	var z = 29.75;
	
	while (x <= 44)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		x = x + .25;
	}
	
	// Create interior window frame, section 3, part 2, up the Y axis.
	var x = 44;
	var y = 192.75;
	var z = 29.75;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create interior window frame, section 3, part 3, down the X axis.
	var x = 36.75;
	var y = 192.75;
	var z = 29.75;
	
	while (x <= 44)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		x = x + .25;
	}

	// Create interior window frame, section 3, part 4, up the Y axis.
	var x = 36.75;
	var y = 192.75;
	var z = 29.75;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create front wall, section 4, across the Z axis.
	var x = 30;
	var y = 191;
	var z = 1;

	while (y <= 194)
	{
		do
		{
			Voxels.setVoxel(x, y, z, 1.0, 219, 240, 84);
			z++;
		}
		while (z <= 30);
		
		z = 1;		
		y++;
	}

	// Erase wall voxels, section 4, to create a left window.
	Voxels.eraseVoxel(30, 193, 6, 1);
	Voxels.eraseVoxel(30, 193, 7, 1);
	Voxels.eraseVoxel(30, 193, 8, 1);
	Voxels.eraseVoxel(30, 193, 9, 1);

	// Create exterior left window frame, section 4, part 1, across the Z axis.
	var x = 29.75;
	var y = 194;
	var z = 5.75;
	
	while (z <= 10)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		z = z + .25;
	}
	
	// Create exterior left window frame, section 4, part 2, up the Y axis.
	var x = 29.75;
	var y = 192.75;
	var z = 5.75;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create exterior left window frame, section 4, part 3, across the Z axis.
	var x = 29.75;
	var y = 192.75;
	var z = 5.75;
	
	while (z <= 10)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		z = z + .25;
	}

	// Create exterior left window frame, section 4, part 4, up the Y axis.
	var x = 29.75;
	var y = 192.75;
	var z = 10;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create interior left window frame, section 4, part 1, across the Z axis.
	var x = 31;
	var y = 194;
	var z = 5.75;
	
	while (z <= 10)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		z = z + .25;
	}

	// Create interior left window frame, section 4, part 2, up the Y axis.
	var x = 31;
	var y = 192.75;
	var z = 5.75;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create interior left window frame, section 4, part 3, across the Z axis.
	var x = 31;
	var y = 192.75;
	var z = 5.75;
	
	while (z <= 10)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		z = z + .25;
	}

	// Create interior left window frame, section 4, part 4, up the Y axis.
	var x = 31;
	var y = 192.75;
	var z = 10;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Erase wall voxels, section 4, to create an exterior door opening.
	Voxels.eraseVoxel(30, 192, 14, 1);
	Voxels.eraseVoxel(30, 192, 15, 1);
	Voxels.eraseVoxel(30, 192, 16, 1);
	Voxels.eraseVoxel(30, 193, 14, 1);
	Voxels.eraseVoxel(30, 193, 15, 1);
	Voxels.eraseVoxel(30, 193, 16, 1);

	// Create exterior door frame, section 4, part 1, across the Z axis.
	var x = 29.75;
	var y = 194;
	var z = 13.75;

	while (z <= 17)
	{
		Voxels.setVoxel(x, y, z, .25, 1, 1, 1);
		z = z + .25;
	}

	// Create exterior door frame, section 4, part 2, up the Y axis.
	var x = 29.75;
	var y = 192;
	var z = 17;

	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 1, 1, 1);
		y = y + .25;
	}

	// Create exterior door frame, section 4, part 3, up the Y axis.
	var x = 29.75;
	var y = 192;
	var z = 13.75;

	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 1, 1, 1);
		y = y + .25;
	}

	// Create interior door frame, section 4, part 1, across the Z axis.
	var x = 31;
	var y = 194;
	var z = 13.75;

	while (z <= 17)
	{
		Voxels.setVoxel(x, y, z, .25, 1, 1, 1);
		z = z + .25;
	}

	// Create interior door frame, section 4, part 2, up the Y axis.
	var x = 31;
	var y = 192;
	var z = 17;

	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 1, 1, 1);
		y = y + .25;
	}

	// Create interior door frame, section 4, part 3, up the Y axis.
	var x = 31;
	var y = 192;
	var z = 13.75;

	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 1, 1, 1);
		y = y + .25;
	}

	// Erase wall voxels, section 4, to create a right window.
	Voxels.eraseVoxel(30, 193, 21, 1);
	Voxels.eraseVoxel(30, 193, 22, 1);
	Voxels.eraseVoxel(30, 193, 23, 1);
	Voxels.eraseVoxel(30, 193, 24, 1);

	// Create exterior right window frame, section 4, part 1, across the Z axis.
	var x = 29.75;
	var y = 194;
	var z = 20.75;
	
	while (z <= 25)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		z = z + .25;
	}
	
	// Create exterior right window frame, section 4, part 2, up the Y axis.
	var x = 29.75;
	var y = 192.75;
	var z = 20.75;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create exterior right window frame, section 4, part 3, across the Z axis.
	var x = 29.75;
	var y = 192.75;
	var z = 20.75;
	
	while (z <= 25)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		z = z + .25;
	}

	// Create exterior right window frame, section 4, part 4, up the Y axis.
	var x = 29.75;
	var y = 192.75;
	var z = 25;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create interior right window frame, section 4, part 1, across the Z axis.
	var x = 31;
	var y = 194;
	var z = 20.75;
	
	while (z <= 25)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		z = z + .25;
	}

	// Create interior right window frame, section 4, part 2, up the Y axis.
	var x = 31;
	var y = 192.75;
	var z = 20.75;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}

	// Create interior right window frame, section 4, part 3, across the Z axis.
	var x = 31;
	var y = 192.75;
	var z = 20.75;
	
	while (z <= 25)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		z = z + .25;
	}

	// Create interior right window frame, section 4, part 4, up the Y axis.
	var x = 31;
	var y = 192.75;
	var z = 25;
	
	while (y <= 194)
	{
		Voxels.setVoxel(x, y, z, .25, 22, 42, 102);
		y = y + .25;
	}
	
	// Stop script.	
	Script.stop();
}

Script.update.connect(make1stExteriorWalls);

#8

A little java prog

that converts a image into coloured voxels.

Also worth hunting down is a prog called obj2mc which converts 3d obj files into .schematics.
Id love to get coloured models from blender to HF. If someone can combine 2 two things :smile:


#9

A script that can create a voxel object from a menu. https://gist.github.com/kevinmthomas-carpool/11310507


#10

Erase Plot Area

I wanted to create a plot area eraser so that if you want to clean off your plot or even a small section of your plot and don’t want to spend hours erasing every single voxel, you can use this simple tool.

Please keep in mind that the upper bounds of your removal you want to always subtract 1 as the eraser works in 1 meter segments. For example.

Joe’s Plot
6000X - 6200X
0Y - 400Y
7000Z - 7200Z

If you were to erase Joe’s entire plot, you would replace the upper bounds, for example, 6200X with 6199X and 400Y with 399Y and 7200Z with 7199Z.

If you wanted to erase a section of this area, simply edit the script were there are default 0 values with your specified area.

DOWNLOAD


#11

Set Plot Survey

Here is a simple plot survey tool that will help you put 1 meter boxes on the street level (the strip) so that you can easily begin creating your builds.

Please keep in mind that the script has detailed documentation indicating how you take your specific plot areas and ensure to subtract 1 from 3 of the points as the voxel survey creates 1 meter voxels. This ensures you do not move into an adjacent area by accident.

DOWNLOAD


#12

House Builder

I am in the process of creating, over the next two to three weeks, a basic residential house model called, The Genesis, that is a simple two-story design which you will be able to choose from a few different exterior/interior wall color schemes and place on your plot.

I was running the idea past @Judas earlier today and he is going to let me test the idea on a small piece of his property. Lucky him LOL.

I ran the idea past @thoys and he suggested that I first create a simple house builder script, which is attached here, which allows you to choose from a menu, very basic house building blocks and place them based on your avatar position. It is a very crude tool however it can be very fun if you want to start building with voxels as it includes:
4x4 floor section
4x4 wall X-Axis section
4x4 wall Z-Axis section
4x4 ceiling section
4x4 roof section

Each of these items can be placed and on the adjacent menu is a remove function. Before you begin select the / key as it will show you the X Y Z coordinates of your location so that you can write down where you start building. This will help you keep in perspective when you place new items so they align up.

As a pre-requesite, I suggest the following tools before you get started:
A plot-survey tool to help you plot out your area:
DOWNLOAD
A simple plot/area eraser to help you do custom erasure sections:
DOWNLOAD

Here is the link to the house builder below: 05/01/14 COMMIT WINDOWS OS MENU FIX
DOWNLOAD

Have some fun with this and take a moment to look at the script itself. It is well documented so that you can use portions of it to make your own script or even customize/modify this one to create the build of your dreams.

If you have any questions, please feel free to reply here. HAPPY VOXEL SCRIPT BUILDING lol.


#13

#19601a - JS Script To Create Different Voxel Clusters (Yaw Enhancement) 05/01/14 COMMIT WINDOWS OS MENU FIX

Upgrade including Yaw enhancement.
DOWNLOAD


#14

I made a little video on using Blender to convert a Model into Voxels for conversion to either a.schematic or using svo_convert

That said Here’s a model I made this way it took maybe 40 Min’s to draw in world and still looks pants compared to the poly model.
Can we please be allowed to upload fbx models into the world. These are already supported by the engine for avatar creation and would allow us to start having some fun and making things look like they were created in 2014 rather than 1985( google dire straits money for nothing)


#15

@Judas, awesome work! I can not remember if you were at last weeks meetup but Philip discussed the direction of uploading FBX, and that the functionality is part of the roadmap.


#16

House Of Music Builder

Here is the JS script that created the House Of Music commercial building @music on the Alpha grid.

This script is based on absolute coordinate positioning however does not use menus as I have heard at the moment some of the Windows users don’t have the script menu functionality.

You can start by taking this script and going to @sandbox and simply running it as you can see what it does specifically. You can also go to domain localhost and try it if you like.

Try taking the script in pieces as it is well documented with each assembly in detail. Try putting in your own coordinates and making a grid on graph paper like this.

You can use these basic building blocks to make a residential home just as well. If you have any questions please reach out as I would love to help you guys!

Here is the link to download.
DOWNLOAD


#17

@chris it would be interesting to see the road map you mentioned to give us some idea of when and what is coming up and to help maintain Alpha enthusiasm. I have seen the Architecture overview but this doesn’t give a flavour of the sort of timescale and functionality we’re to expect.


#18

Question about scripts. If I’m in the sandbox and I load a script file in can I break anything that will affect anyone else?
I want to have a mess around with scripts to see what will work and wont.(I’m a total script noob. I remember trying to mark out my land b4 we had the sandbox and Kev was all if you type anything wrong you will destroy everything.
So if I’m in the sandbox and try to load in scripts of any kind whats the worst that can happen. I don’t want to mess anything up for anyone else.
I’m hoping the worst I can do is mess up my own viewer and have to re set it. but I would like to be either warned off or assured that its fine before I start.


#19

The worst thing you could do is clear the whole sandbox out or fill it full with voxels. Nothing to problematic.


#20

05/01/14 COMMIT WINDOWS OS MENU FIX
DOWNLOAD