Articles Tagged: tips

tips and tricks related to interactive digital production and experiments

Flash Summer Camp Berlin – Think In 3D Workshop – Follow-up

July 13th, 2009 | By Cedric Madelaine

037 FlashCampBerlinFollowup Flash Summer Camp Berlin   Think In 3D Workshop    Follow up image

analogd’s workshop at the Flash Summer Camp Berlin 2009

Few weeks ago I gave a workshop about Real Time 3d in Flash in Berlin during the Flash Summer Camp Berlin. To start with, I would like to thank the organisers flex-lab.de, Bettina and Mathias you did a great job the venue was amazing and the organisation worked like a Swiss watch icon wink Flash Summer Camp Berlin   Think In 3D Workshop    Follow up image
I would like to thank also everybody who attended this workshop, especially because it was on Sunday.
Thank you for your positive feedback, I really enjoyed talking with you about Flash 3D. It was also nice to see that they were experimented 3D people in the audience. The audience was varied which brought me to build a workshop not focused very much on code but more on concepts. I know that could have been frustrating for some people and I will try to address this by posts targeted on code in upcoming weeks.

Workshop Think in 3D: follow-up

To start with I would like to tell people, because somebody asked, .ch is for Switzerland (Confoederatio Helvetica), I think I should switch for a .com now icon wink Flash Summer Camp Berlin   Think In 3D Workshop    Follow up image Happy to see that Duanne Nickull knews about it icon wink Flash Summer Camp Berlin   Think In 3D Workshop    Follow up image Cheers from Switzerland.

You will find below the first part of the workshop’s follow-up, it gives you further insight by theme about subjects discussed during my Workshop at the Flash Summer Camp Berlin, checkout also the pdf of the full workshop below, it includes plenty of links which were not presented in Berlin.
Workshop’s PDF here.

Good to know

They are often situations where you need to match 3D to 2D and the reverse, especially if you use 3d as a transition effect or as Wow effect within a 2D interactive design. Please find below a helpful link to achieve this:
Pixel Precision in 3D match 2D and 3D.

During the workshop I told you about using Unwrap and baked textures, here is for reference a simple explanation of it. UVW Unwrap allows you to unfold a 3D object on a flat plane. This technic is often used to add “baked textures” to your 3d objects. Baked textures are textures with lightening and shadows prerendered, leveraging your scene from the computer intensive real time lightening. This technic has been used a lot within the gaming industry and fits perfectly the context of Flash Real Time 3D. For example take a cube, unwrap it. Now you have a flat representation of each face of your cube, then you can export it as an image file and edit it in Photoshop. Once done with your modifications (adding for example shadows and lightening or swapping Flat texture with more realistic ones), you apply your modified image in your 3D software, and now you have your model with prerendered lightening and shadows ready to be exported to Collada and to be used within Papervision3D or Away3d or Alternativa3D or …
The previous example was
only given for the sake of explanation about UVW Unwrap. Most of the time 3D software allow you to directly bake the lightening and shadows as you set it up in your 3D environment to your texture (look at: Render to texture).
Checkout this tutorial by Blitz Lab about Unwrap, Baking a texture and Collada exports.
Checkout Texture Baking is your friend.
Checkout this tutorial about AS3exporter and Unwrap.

Collada

As mentioned during the workshop you should use the DAE.as class instead of the Collada.as class (Collada can be used for quick tests). The former is more advanced, loading is well managed and plenty of features are supported.
Regarding Collada you should look also at loading zipped Collada models using fzip or using the new Papervision3D KMZ Parser. KMZ files are Google Sketchup files, a zip file including an XML Collada and its related textures. Both technics can reveal handy if you have plenty of models to load. Check this blog post about loading zipped collada models within Papervision3D.
I was asked about how to deform a Collada model, here is links to resources: Using Collada Bend Modifier which uses as3dmod (see below for further explanations).

MD2

There is a great Getting Started video tutorial serie about steps to create ID Software MD2 models for Flash Real Time APIS, check this out if you are interested in MD2 animated models: Step by Step Tutorial creating MD2 Models by Michael Lively

An Away3D feature allows you to make smooth transition between MD2 keyed transitions. It is extremely useful to people working on 3d games: smooth transition of MD2 Keyed animation.

3D API tools

AS3geom exporter: a 3ds Maxscript which allows you to export your 3ds Max models as .as class files (for Paperversion3D, Away3D and Sandy3D). Can be useful if you need to embed a model, but should be used with care if you need to embed a lot of various 3D models. Loading of external Collada files should be preferred, (or you could export multiple models then embed them within a swf or numerous swfs and then load it using modules)

Flash 3D Modifier API: Any regular 3D Software has its own Modifiers Library. To be short, it provides you a way to modify various aspects of your 3d object or/and add further edit options. It is usually based on the Decorator Design pattern, hence it is non-destructive. Now Flash 3D APIS has its own: as3dmod.

Spring Camera: a camera with natural movement useful, for example, for FPS or games: Spring Camera by Agit8

Jiglib 3D Real Time Physics Engine ported from c++, is an engine which adds physic qualities to your scene, the same as Havok works for 3ds Max.
There is also WOW Physic engine based on APE, but recently Jiglibs brought a lot of excitement within the Flash 3D community. The question is: has Flash Player power enough to manage Real Time 3D rendering AND Real Time Physic simulation?
Here is a game demo using this engine: 3D Ball Adventure.

If you are interested doing Augmented Reality within Flash checkout the following: FLAR Toolkit and Lee brimelow Getting Started tutorial. I have started a blog post serie about Augmented Reality following a conference I did some time ago, check it out if you are interested in this.

Flash 3D API Editors

There is currently a “trend” starting for Flash 3D APIS to propose users “live editors/builders” to allows them quickly setup their 3d scene. This is a good opportunity also for non 3d people to getting started.

This is a promising initiative by Juxt Interactive to be used with Papervision3D: VizualPV3D by Gary Stasiuk, the task is huge and a 3D software is something very hard to build especially regarding user interface, I wish Gary a lot of success in his work!

John Grden is also working on a PV3D CS4 integration which is not available yet.

Alternativa3D Team is currently working on this kind of tool for their registered clients.

End of part 0

This is it, for the first part of this follow-up to my Flash Summer Camp Berlin workshop. I would like to thank Carlos Ulloa (Papervision3D), Rob Bateman (Away3d) and Alex Karpovich (Alternativa3D) for having so kindly answered to my short “Interview” which was amazingly helpful to build this workshop and tell people about the latest news within Flash Real Time 3D APIs.

Adobe AIR tips serie: browseForSave set default file extension and validate/modify.

November 17th, 2008 | By Cedric Madelaine

postImage 01short Adobe AIR tips serie: browseForSave set default file extension and validate/modify. image
spacer Adobe AIR tips serie: browseForSave set default file extension and validate/modify. image

In this serie I propose some quick tips for Adobe AIR products developers, which came out during my regular practice of this technology. Today topic is:

Conforming extension for a browseForSave.

This short tip allows you to ensure that the file which will be saved following a browseForSave match legal extension you have defined beforehand and if not it will apply a default extension when using the browse for save functionality. Currently File.extension is a read only property and you cannot change it directly, so I decided to manipulate the path in order to allow it. I think a setExtension and allowedExtensions property might be useful in such a situation.

import flash.filesystem.File;
import flash.filesystem.FileStream;
import flash.events.Event;

private var docsDir:File;
private const MY_DEFAULT_EXTENSION:String = "abc";
private const VALID_EXTENSIONS_LIST:Array = ["abc"];

public function mySave():void
{
	docsDir = File.desktopDirectory;
	docsDir.browseForSave("Save As");
	docsDir.addEventListener(Event.SELECT, mySaveHandler);
}
private function mySaveHandler(event:Event):void
{
	docsDir.removeEventListener(Event.SELECT, mySaveHandler);
	//Split the returned File native path to retrieve file name
	var tmpArr:Array = File(event.target).nativePath.split(File.separator);
	var fileName:String = tmpArr.pop();//remove last array item and return its content
	//Check if the extension given by user is valid, if not the default on is put.
	//(for example if user put himself/herself an invalid file extension it is removed in favour of the default one)
	var conformedFileDef:String = conformExtension(fileName);//comment: updated 17.11.2008 removed the typo
	tmpArr.push(conformedFileDef);
	//Create a new file object giving as input our new path with conformed file extension
	var conformedFile:File = new File("file:///" + tmpArr.join(File.separator));
	//Make save
	var stream:FileStream = new FileStream();
	stream.open(conformedFile, FileMode.WRITE);
	stream.writeUTFBytes("demo demo demo demo demo demo demo demo demo");
	stream.close();
}
private function conformExtension(fileDef:String):String
{
	var fileExtension:String = fileDef.split(".")[1];
	for each(var it:String in VALID_EXTENSIONS_LIST){
		if( fileExtension == it)
			return fileDef;

	}
	return fileDef.split(".")[0] + "." + MY_DEFAULT_EXTENSION;
}

Feel free to add any comment!

spacer Adobe AIR tips serie: browseForSave set default file extension and validate/modify. image