Is away3d still a thing for openfl?

Hi all!

Just a quick question as to whether away3d is still a thing for openfl? I had a (albeit very quick) play, and couldnt get the samples to run. Im using the version from the openfl org on GH, but nothing seems to work. Are there any (quick and easy) samples available - if its not a thing anymore is there something simple to utilize 3d in openfl?

Cheers,
Ian

Works. Just ‘haxelib install away3d-samples’, navigate to any sample’s directory and run ‘haxelib run openfl test html5’

2 Likes

Perfect, thanks!

Im not 100% sure what i was doing before, but all seems well now. I think the samples i was looking at before were out of date.

Thanks again!

Ian

I recommend setting the Away3d library to the git version, especially if you’re going to use Collade DAE models. I recently (24 days ago) had a troublesome bug in displaying these and prodded @Greg209 to have a look. He discovered a math bug that had been overlooked in the AS3 to Haxe conversion and fixed it on the git repo.
Edit: upon re-reading your post I see that you already did that. Carry on!

2 Likes

Did you manage to play DAE animation?

Didn’t try. I did try the Polar Bear AWD animation and the model went funny.

Should work with OpenFL 8.9.6:

Yeah. But as I know, there is no exporter for 3d max or any other modern 3d ide, that exports awd

Can you use MD5?

Its rather tricky to use md5 and it old format and designers doesnt even know it. And only 1 exporter is available and only for blender. It’s a pity, the FBX standant is not fully supported.

Btw, Heaps has FBX parser. May be port it for Away3D

We’ve been using DAE to export from 3DS Max into AwayBuilder and then output an AWD file for Openfl, it delivers the best accuracy and material compatibility.

The only gotcha is with the naming convention in DAE not directly supporting lots of the characters you may have used for naming meshes in Max, if this isn’t a problem it should work. Otherwise the DAE export from Max changes most non alphanumeric characters, even spaces to ASCII codes.

What we do is decode and rename them back to the correct naming in Openfl with the following function which takes in the DAE mesh name and returns the corrected version…

// Decode ASCII characters from DAE mesh names
	function decodeName(meshName:String):String {
		var additionalAscii:Array<String> = ["é"];
		
		while (meshName.indexOf("FBXASC") != -1 ){
			var index:Int = meshName.indexOf("FBXASC");
			var asciiCode:Int = Std.parseInt(meshName.substr(index + 6, 3));
			var tempString:String = meshName.substr(index, 9);
			var replaceString:String = String.fromCharCode(asciiCode);
			meshName = StringTools.replace(meshName, tempString, replaceString);
		}

		for (i in 0...additionalAscii.length){
			while (meshName.indexOf(additionalAscii[i]) != -1 ){
				var tempString:String = additionalAscii[i];
				var replaceString:String = "";
				switch(additionalAscii[i]){
					case "é":
						replaceString = "é";
				}
				meshName = StringTools.replace(meshName, tempString, replaceString);
			}
		}
		return meshName;
	}
2 Likes