Sunday, November 23, 2014

Open Source and Free Voxel Editors

Voxlap
http://www.advsys.net/ken/voxlap.htm

Ken Silverman's open source voxlap engine. It has a real-time WYSIWYG editor - VOXED for editing the game map.
Source Code: http://www.advsys.net/ken/voxlap/voxlap05.htm
see also Ken Silverman's EVALDRAW: http://www.advsys.net/ken/download.htm#evaldraw 
and Ken Silverman's PND3D demo, an abandoned successor to the famous voxel engine Voxlap: http://advsys.net/ken/voxlap/pnd3d.htm

Strip to Voxel
http://www.moddb.com/games/black-shadow-3d/downloads/strip2vox-v3-beta
A program to convert an image strip, or series of pictures in a long film strip like image, into a raw voxel model for later editing.

Slab6 & POLY2VOX
http://www.advsys.net/ken/download.htm#slab6
An open source 6-degree of freedom viewer and editor for KVX and VOX voxel files.
The utility POLY2VOX is a polygon to voxel model converter.
See also http://forumarchive2.spadille.net/viewtopic.php?f=69&t=205&hilit=poly2vox+unlimited&sid=4c4538d139694d8d3efbc100d48f2f25 (Poly2Vox UNLIMITED, onverts textured .3DS files to voxels over size 256.)
and http://www.cs.princeton.edu/~min/binvox/ (3D mesh voxelizer).

Voxelstein3D
http://voxelstein3d.sourceforge.net/
An open source FPS game inspired by Wolfenstein 3D using Ken Silverman's VOXLAP engine to render voxels. The game package contains a animator tool for editing voxel animations.

VoxRend
http://voxrend.sourceforge.net/
Includes tools for VOX - a file format that describes an object built with voxels.
Source Code: http://voxrend.sourceforge.net/#downloads

MagicaVoxel
https://voxel.codeplex.com/
A free lightweight 8-bit voxel editor and renderer with lots of functionalities.

Voxie
https://github.com/matpow2/voxie
A cross-platform open-source voxel editor and tool chain that supports per-frame animation.
Source Code (MIT): https://github.com/matpow2/voxie

VoxEditor
https://www.youtube.com/watch?v=pTWenv6JrZY
A voxel editor written in C#.
Source Code: https://bitbucket.org/BamYazi/voxeditor/
Note:  This tool seems sophisticated, however, not much information can be found about it. You may need to contact the author for more details.

Sprite Voxel Editor
http://sproxel.blogspot.com/
Sproxel (short for "Sprite Voxel Editor") is a 3d interface designed to let the user quickly create and edit voxel-based 3d models. The creation process and resulting geometry can be thought of as an extension to 2d pixel art.
Source Code(New BSD): http://code.google.com/p/sproxel/


Voxel Builder
http://voxelbuilder.com/
Voxel Builder is an open source tool for http://voxeljs.com/ that lets anyone design and edit 3D voxel (cube) models easily, right in their web browser.
Source Code (BSD): https://github.com/maxogden/voxel-builder
Similar tools http://kyucon.com/qblock/ and http://mrdoob.com/projects/voxels/.

Cube Kingdom
http://cubekingdom.web.fc2.com/
http://www.indiegames.com/2009/06/freeware_app_pick_cube_kingdom.html
Cube Kingdom is an application that can be used to create 3D models out of blocks with the same size and dimension.

VoxelDesc
http://claudeb.itch.io/voxeldesc
VoxelDesc is a voxel editor driven by a command line with 2.5D graphics and powerful scripting.
Source Code (Artistic License version 2): https://github.com/felixplesoianu/voxeldesc

Zoxel
http://zoxel.blogspot.co.uk/p/about-zoxel.html
Zoxel is a voxel editor designed for small models. Like a sprite editor, but in 3D.
Source Code (GNU GPL): https://github.com/grking/zoxel

VoxelShop
http://blackflux.com/node/11
VoxelShop is an extremely intuitive and powerful software for OSX, Windows and Linux to modify and create voxel objects. It was designed from the ground up in close collaboration with artists.

SummerDawn
http://www.giawa.com/voxel-editor/
Simple voxel editor based on .NET framework.

Cube Construct
http://www.cubeconstruct.net/#&slider1=7
http://www.neuroproductions.be/experiments/cube-construct-a-3d-pixel-editor-for-ipad/
3D Pixel Editor for iPad with source code.
Source code: https://github.com/neuroprod/CubeBuilder
See also
http://www.neuroproductions.be/experiments/3d-pixel-fun/
http://www.neuroproductions.be/experiments/zbrush-modelling-in-flash/

VoxelPaint
http://www.voxelpaint.com
https://play.google.com/store/apps/details?id=net.kajos.voxelpaint.android
Painting in 3D with voxels in the cloud using WebGL or the Android app.

Hangover
http://shrinker.beyond-veils.de/projects/Hangover/
An all-3D 3D terrain editor which enables you to simply interactively draw and manipulate terrains in 3D space. Since this is not based on height fields, you can easily create steep hills, overhangs or even tunnels.

Creeperchest
http://shrinker.beyond-veils.de/projects/IterationX/Creeperchest/
A Minecraft level editor.

kv6ToSchematic
http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-tools/1265323-kv6toschematic-import-3d-models-with-textures
Import kv6 format voxel to Minecraft.

Voxel Section Editor
http://www.ppmsite.com/?go=vxlseinfo
Open source voxel creation and editing tool for Command & Conquer Tiberian Sun and Command & Conquer Red Alert 2 voxel files.
See also http://www.tibed.net/voxel


RadED
https://www.youtube.com/watch?v=CZFcWtPa3BY&feature=player_embedded
RadED is an experimental voxel editor for Doom circa 1993.
Source Code: http://leeland.stores.yahoo.net/earlydoomstuff.html
See also
http://web.archive.org/web/20120317221740/http://www.jonof.id.au/forum/index.php?topic=1972.0
Note: this tool is rather old and no binary available - you need to compile for yourself.

Polygon modelling tools support sculpting (For High-Resolution realistic Voxel model creation):

Blender
http://www.blender.org
The free and open source 3D animation suite also has sculpt mode:
http://wiki.blender.org/index.php/Doc:ZH/2.6/Manual/Modeling/Meshes/Editing/Sculpt_Mode

Sculptris
http://pixologic.com/sculptris/#
Lite version of ZBrush, the ideal ground on which to get started with digital sculpting.

SculptyPaint
http://elout.home.xs4all.nl/sculptpaint/
SculptyPaint is a low polygon 3D creation tool original written for creating sculpts.

SharpConstruct
http://sourceforge.net/projects/sharp3d/
SharpConstruct is a 3D modeling program designed to let users paint depth on to polygon models in real-time. Unlike traditional modeling programs, SharpConstruct makes it easy to quickly model organic shapes.
See also http://graphics.ethz.ch/pointshop3d/ and FiberMesh (Designing Freeform Surfaces with 3D Curves) http://www-ui.is.s.u-tokyo.ac.jp/~takeo/research/fibermesh/index.html

Dilay
http://abau.org/dilay/
Open source (GPL) 3D sculpting application that provides an intuitive workflow for Windows and Linux.

PolyBrush
http://polybrush.org/
Small but powerful 3D editor for 3D concept art, fast modeling and sculpting.One great feature is 3D poly brushes, which makes 3D modeling like 2D drawing.

Sculpt+
http://www.123dapp.com/sculptplus
Very easy to use free 3D modeling and animation tool by Autodesk. Starting from stick figures, you can sculpt the details, paint the textures and pose your models. Available for iOS, Android and Windows.

Others: 
Create quickly and easily your 3D head from just two 2D photos:
http://www.looxis.de/looxis-faceworx-tool/
see also http://www.123dapp.com/catch

Sketch-based shape creation & free-form modeling tool:
http://www.shapeshop3d.com
http://www-ui.is.s.u-tokyo.ac.jp/~takeo/java/smoothteddy/index.html
http://en.wikipedia.org/wiki/Sketch-based_modeling

truesculpt (Virtual sculpture for Android) https://code.google.com/p/truesculpt/
 
Mathematical models: http://k3dsurf.sourceforge.net/ 
2D/3D free generative art application: http://www.digitalpoiesis.org/

Artist3D: http://www.artist3d.de/index.htm
MeshMixer: http://www.meshmixer.com/ and http://www.123dapp.com/meshmixer
Voxel Paint in 3D with Oculus VR:
https://forums.oculus.com/viewtopic.php?f=42&t=20712

Links:
http://www.reddit.com/r/Trove/comments/1vxs93/list_of_voxel_editors_and_useful_stuff_updated/
http://trove.wikia.com/wiki/Common_Voxel_Editors
https://bitbucket.org/volumesoffun/polyvox/wiki/Voxel%20editors

Friday, November 21, 2014

Open Source and Free Pixel Editors

Piskel
http://www.piskelapp.com/
A simple online web-based (HTML5) Sprite and Pixel art Editor. Offline version is also available.
Source Code: https://github.com/juliandescottes/piskel


piq
http://piq.codeus.net/
A free online (Flash) app for creating pixel art.
See also
http://pixelartor.com/
http://pixieengine.com/
http://www.pixel.tools/

GIMP
http://www.gimp.org/
The famous open source alternative to Photoshop.
See this note for using GIMP as a pixel art editor.

Paint.NET
http://www.getpaint.net/
A free powerful image and photo editing software.

GrafX2
http://pulkomandy.tk/projects/GrafX2
A bitmap paint program specialized in 256-color drawing.
Source Code (GNU GPL): https://code.google.com/p/grafx2/

mtPaint
http://mtpaint.sourceforge.net/
A painting program to create pixel art and manipulate digital photos.
Source Code (GNU GPL): https://github.com/wjaguar/mtPaint

Pixen
http://pixenapp.com/
A open source (but not 'free') pixel art editor for Mac OS X.
Source Code: https://github.com/Pixen/Pixen

Aseprite
http://www.aseprite.org/
An open source animated sprite editor & pixel art tool.
Source Code (GNU GPL): https://github.com/aseprite/aseprite/
Note: Aseprite is open source but not 'free' since donation is required for downloading the pre-built binaries. However, it is open source so you can compile for the binary by yourself.

Links:
http://pixelartus.com/tagged/pixel-art-tools

Tuesday, November 18, 2014

Get URL and Read URL Parameters in JavaScript, HaXe and AS3

Find the URL of the embedding page of a swf is a very basic way for domain locking flash games. Similar things can be done for JavaScript based online games. To get the URL, in JavaScript you can use

var myURL=document.URL;
In HaXe (targeting JavaScript or HTML5), you can use
var myURL:String=js.Browser.window.document;
In AS3, to find the path url of the swf, you can use
root.loaderInfo.loaderURL;
//or
root.loaderInfo.url;
and for finding the path url of the embedding page, you can use
ExternalInterface.call("window.location.href");
Besides, it's common to see url parameters, for example: "http://mysite.com/index.html?param1=1234&param2=somestr&param2=someotherstr" To read the parameters, in the above example, that is "1234", "somestr" and "someotherstr", in JavaScript, you can use the snippet provided by http://stackoverflow.com/a/979995/1100006 or the function given at http://css-tricks.com/snippets/javascript/get-url-variables
In HaXe, you can use the following HaXe function
//translated from http://css-tricks.com/snippets/javascript/get-url-variables/
function getQueryVariable(variable):String
{
       var query:String = js.Browser.window.location.search.substring(1);
       var vars:Array = query.split("&");
       for ( i in 0...vars.length) {
               var pair:Array = vars[i].split("=");
               if(pair[0] == variable){return pair[1];}
       }
       return("null");
}
In AS3, if the parameters are given in the path of the swf' url, for example, "http://mysite.com/myswf.swf?param1=1234&param2=somestr&param2=someotherstr", or if the parameters are declared in flashvars, then you can simply use "root.loaderInfo.parameters" object to access all the parameters, for example,
var myStr:String = root.loaderInfo.parameters.param1;
However, to read parameters of the embedding page' url, you still need the help of JavaScript, see the following pages for an example:
http://snipplr.com/view/44852/how-to-access-query-string-arguments-with-as3/ http://www.abdulqabiz.com/blog/archives/2006/03/06/how-to-get-url-query-string-variables-within-flex-application/

References:
http://stackoverflow.com/questions/979975/how-to-get-the-value-from-url-parameter http://www.javascriptcookbook.com/article/Get-the-current-URL-via-JavaScript
http://stackoverflow.com/questions/2127962/get-current-browser-url-actionscript-3
http://snipplr.com/view/47055/get-url-of-the-page-where-swf-is-embedded/ http://snipplr.com/view/28103/as3-get-url-of-current-flash-movie-swf/

Saturday, November 15, 2014

Create a SWC for Flash & AS3 Projects from OpenFL

If your code is pure haxe, it's easy to generate an AS3 library swc file for your AS3 projects, as documented at http://old.haxe.org/manual/swc:

haxe -swf mylib.swc MyLibClasses --macro include('mypackage')
For example, to generate the "TextParser.swc" from "TextParser.hx", I used
haxe -swf TextParser.swc TextParser.hx
However, if your project is based on the OpenFL library, more efforts may be needed. Anyway, since you can compile your project to a swf, one ultimated way is to load the external swf at run time and get all public classes and methods inside using the "getDefinition" function from the "ApplicationDomain" class, see for example http://flassari.is/2008/07/swf-class-explorer-for-as3/. However, this way is not the most efficient and need you to write more code. For the most cases, it is possible to generate a swc file from your OpenFL based code. Things you need to do are
1. Rename the package name "openfl" to "flash", e.g., "openfl.display.Sprite" to "flash.display.Sprite".
2. Make your code independent of the openfl only classes and methods. For example, don't use "openfl.Assets.getBitmapData" directly in your code, use a external wrapper object as the assets host such as "myAssetsHost" and redirect all function calls to its public method which wraps "openfl.Assets.getBitmapData". Then in your AS3 project, you can reimplement the wrapper object using AS3 methods for handling assets.
An example is the JiuGongGe.swc, I refactored the original source code to make it independent of "openfl.Assets". It also depends on the library "Actuate", so I copied the library folder "motion" from the installed path "D:\HaxeToolkit\haxe\lib\actuate\1,7,5\motion" to the folder contains the source code of JiuGongGe, then use the command
haxe -swf JiuGongGe.swc JGG.hx  --no-traces --macro include('motion.Actuate')
to get the swc file.

Links:
http://old.haxe.org/manual/swc#creating-swc-with-haxe
http://www.openfl.org/archive/community/general-discussion/how-create-swc-openfl/
https://groups.google.com/forum/#!topic/haxelang/sld9ov4D-tA
http://stackoverflow.com/questions/13020201/how-could-i-convert-an-existing-swf-file-to-an-swc-for-using-as-a-library

Tuesday, November 11, 2014

TextParser - A Simple Class for Parsing Text Files

TextParser is a simple utility HaXe class for parsing text files. You can use this class to read String, Int variables from a text file. For example, the JiuGongGe UI uses a text file to configure the UI layout, so it needs to parse the text configuration file to do the set up.

The source code of the class is released with the JiuGongGe UI:
https://flaswf.googlecode.com/svn/trunk/JiuGongGeUI-v0.2/src/TextParser.hx
TextParser is also available in AS3 as a swc:
https://flaswf.googlecode.com/svn/trunk/JiuGongGeUI-v0.2/swc/TextParser.swc
To use the class, add the following line in your main class first:

haxe.initSwc(this);

The following is a simple AS3 example for using the TextParser class to parse a text file line by line and read some strings and integers needed:
var myUILayout:ByteArray = new myUILayoutClass() as ByteArray;
var myTextParser:TextParser = new TextParser(myUILayout.toString());
while (!myTextParser.EndofFile())
{
var Name:String = myTextParser.ReadString();
trace(Name);
if (Name == "#") //comment line
{
    myTextParser.GotoNextLine();
    continue;
}
var CallBackStr:String = myTextParser.ReadString();
trace(CallBackStr);
var IconStr:String = myTextParser.ReadString();
trace(IconStr);
var Color:uint = myTextParser.ReadInteger();
trace(Color);
var Label:String = myTextParser.ReadString();
trace(Label);
var LevelStr:String = myTextParser.ReadString();
trace(LevelStr);
myTextParser.GotoNextLine();
}
Basically, you need to put the parsing process inside a while loop. Where the function EndofFile() is used to check whether it is the end of the text file. The function GotoNextLine() will move the position of the file pointer to the next line. The functions ReadString() and ReadInteger() are used to read string and integer from the text file and update the file pointer's position.

Full source code for the example:
https://flaswf.googlecode.com/svn/trunk/JiuGongGeUI-v0.2/swc/src/Main_TP.as

For a HaXe code example, please check the JiuGongGe UI's source code. 

Monday, November 10, 2014

JiuGongGe.swc - JiuGongGe UI for Flash AS3 Projects

For using the JiuGongGe UI in your Flash/AS3 projects, here is the pre-compiled swc file:
https://flaswf.googlecode.com/svn/trunk/JiuGongGeUI-v0.2/swc/JiuGongGe.swc
An example FlashDevelop project:
https://flaswf.googlecode.com/svn/trunk/JiuGongGeUI-v0.2/swc

To use "JiuGongGe.swc", first add the swc file to your project's library (path). Since the swc is built directly from original HaXe source code, there're two requirements:
1. Your main class must be a sub-class of "MovieClip" instead of "Sprite".
2. Add the following code before using the "JGG" class:

haxe.initSwc(this);

Check the post http://bruce-lab.blogspot.com/2014/11/jiugongge-ui-simple-open-source-ui.html for how to using the UI library - most of the HaXe code in the post also works in Flash. Note that the function "Assets.getText()" and "Assets.getBitmapData()" are provided by OpenFL, so you may need to embed the assets in your AS3 code like the example Flash project.

Wednesday, November 5, 2014

JiuGongGe UI - A Simple Open Source UI Framework in HaXe

JiuGongGe (means 9-cell) UI is a UI framework written in HaXe with OpenFL for all platforms, including Flash, HTML5, Android/iOS and Windows. This UI framework is designed to be lightweight and mobile friendly.

The framework is actually a set of buttons (clickable cells) in a nested hierarchy, with each level containing at most 9 cells. The UI framework is firstly created for the BNote application.

Basic Usage
The framework contains two main classes, "JGGCell" represents a single cell and "JGG" is the whole set of cells. You can customize the look and feel for the cells by modifying and extending the first class. For the most time, you're working with the second class. Firstly, you need to create an instance of the "JGG" class, which is a subclass of "Sprite", so you can add it to the stage and set the positions:

var myJGG:JGG = new JGG();
addChild(myJGG);
myJGG.x = 300;
myJGG.y = 200;
But nothing happens until you initialize the UI:
  
myJGG.init(this,this,Assets.getText("assets/UILayout.txt"));
Where the first parameter is the UI host,usually the parent of the the UI object. All event handler function of the click event triggered by cells should be declared in the UI host as public functions. For example, if you use the stage as the UI host, the following function in your Main class can be used as on click event handler:
 
public function CallBack(event:Event)
 {   
  trace(event.target.name);
 }

The second parameter is the assets host, which will provide the UI framework with icons. The assets host must implement the function "getIcon(ID:String):DisplayObject" as a public method, which will be called by the JGG class to fetch icon resources. For example:
 
public function getIcon(ID:String)
 {   
  return new Bitmap(Assets.getBitmapData("assets/" + ID));
 }
The return value can be a Bitmap, Sprite, or any other display object.

The third parameter is the String of the config file. The cells' hierarchy is declared in the string. Usually, it's better to write the config file in a text file, then you can use "Assets.getText" to get the string and pass it to the JGG's init function, other than directly embed the string content in your code. For each line of the config file, you declare one cell and specify the cell's property. It's not necessary to give all the 9 cells for a level. Just declare used cells only. You should give the following things (with out the "[" and "]") in order and delimited by space:
 
[name_of_cell] [on_click_callback_function_name] [background_color] [icon] [text_label] [index][newline] 
Note strictly one row for one cell, and no spaces within [...] - use "_" or "-" instead. For example,
StartCell JGG_ChangeLevel 0xffffff null Start 0
You can use "#" at the beginning of the line to comment:
# This is a comment line.

Now about some details of each property declaration.
[name_of_cell]: Will be used as the name of the JGGCell class instance. [on_click_callback_function_name]: Use the same name of the public method in the UI host. When the cell is clicked by user, this function will be called. You can use the shortcut string "JGG_ChangeLevel" for folding (for non-center cell)or unfolding (if it is the center cell) levels, without implementing the function in the UI host.
[background_color]: Background color of the cell, e.g., 0xffffff.
[icon]: An ID string used as a parameter of Assets host's public function "getIcon". Use the shortcut string "null" if you want to simply use a text label instead.
[text_label]: This is usually used for debugging or quick prototyping purpose. It's recommended use an icon instead of a text label. You can use "_" for space, "/" for newline in the label string. The label text will shown only if the icon string is "null".
[index]: To give the level information of the cell. For example "0,1,0" - integer sequence separated by ','. It is an array of indices for different levels. "0,1,0" means the cell's index in the root level is "0", in the first level is "1" and in the second level is "0". For each level, there're at most 9 cells, so the indices are all staring from "0" to "8". The cell's position is determined by the index of its last level. Starting from center as "0", go left as "1" then up as "2", then along a clockwise circle to "8".
How to interpret the index: Take "0,2,4,3,5" as an example. Look at the last (5-th) integer "5", it means the cell is in the 4-th level with index "5", so it's position is the center one on the right panel. Now the second last (4-th) integer "3", it means the cell's parent's index (in the 3-rd level) is 3. And the integer "4" means the cells' parent' parent's index is 4... In short, you can think the indices as an index of a multidimensional array, which specifies the position of the the cell in the hierarchy.

For a complete example of the config file, please check: https://flaswf.googlecode.com/svn/trunk/JiuGongGeUI-v0.2/assets/UILayout.txt

Advanced Usage
To change cells' behavior, customize cell's look and feel etc.: You can use public functions foldLevel() and unfoldLevel(TargetCell:JGGCell) to change the levels manually, and getCell(name:String) to get a specific cell. The JGGCell class is a subclass of Sprite, so you can redraw the cell using its Graphics property. See the example's source code for more details: https://flaswf.googlecode.com/svn/trunk/JiuGongGeUI-v0.2/src/Main.hx

Although the UI framework is very simple, I believe it can satisfy the most needs for a simple application with some customization. For example, check the BNote app. However, if you're looking for a more feature complete UI framework in HaXe, try http://haxeui.org/ or http://ui.stablex.ru.

Links:
Flash demo: http://flaswf.googlecode.com/svn/trunk/JiuGongGeUI-v0.2/bin/flash/bin/JiuGongGe.swf
HTML5 demo: http://flaswf.googlecode.com/svn/trunk/JiuGongGeUI-v0.2/bin/html5/bin/index.html
Real Example (BNote): http://bruce-lab.blogspot.com/2014/10/bnote-free-online-taking-handwriting-notes.html
Source Code v0.2 (MIT): https://flaswf.googlecode.com/svn/trunk/JiuGongGeUI-v0.2
SWC for Flash/AS3: http://bruce-lab.blogspot.com/2014/11/jiugonggeswc-jiugongge-ui-for-flash-as3.html

Sponsors