Archive for the 'coding' Category

Flex SDK 4 (Gumbo) embed fonts, ‘cff’ param problem

After an migration to a newest Flex SDK 4+, you can lost all your embedded fonts!
To solve such problem, you must add an new  param to your font embedding meta tag: cff=’false’

If you get an error like this:

transcoding parameter ‘cff’ is not supported by ‘flex2.compiler.media.FontTranscoder’

It’s because developers changing it, try another version: embedAsCFF=’false’

Example:

[Embed(source = "Arial.ttf", fontFamily = "Arial", mimeType = "application/x-font", embedAsCFF='false')]

OpenCV 2.0 on SnowLeopard 64bit via MacPorts

OpenCV 2.0 on SnowLeopard 64bit via MacPorts

Posted by Matthias in guides | 17 Comments

Updated 1/17/10: The Portfile now includes a “+disable_openmp” variant. I encountered some OpenMP related segfaults in cvCalcOpticalFlowPyrLK which can be prevented with this variant.

In case you need OpenCV 2.0 on SnowLeopard in 64bit and can live without quicktime support (OpenCV 2.0 it has FFMPEG support so you should be OK in most cases) this tutorial is for you.

In case you want OpenCV 2.0 in 32 bit on 10.5 this probably works too, but I haven’t tested it. Just download the attached “Portfile” and follow the short steps underneath:

1. Before starting execute

sudo port selfupdate

so that the most recent dependencies will be installed later on. Otherwise the build might fail.

2. Make your own port directory somewhere, e.g.

/Users/sam/ports

3. Let macports know about it by editing sources.conf, e.g.

> cd /opt/local/etc/macports

> sudo vim sources.conf

4. Add the local port directory to the sources.conf before the rsync:// at the bottom of the file, e.g.

file:///Users/sam/ports # That is 3 slashes after file ;)

5. Create a graphics/OpenCV subfolder so that we have in our example

/Users/sam/ports/graphics/OpenCV

6. Copy the downloaded Portfile into the above directory, make sure it is called Portfile not Portfile.txt

7. Execute portindex in your local port directory, e.g.

> cd /Users/sam/ports

> portindex

You should see a message telling you that the total number of parsed ports is 1

8. Check if OpenCV 2.0 is found

> port search OpenCV

9. Install OpenCV via

> sudo port install OpenCV

or on SnowLeopard in 64 bit but without quicktime support

> sudo port install OpenCV +sl_64bit

10. Enjoy the time you have saved by not having to implement the algorithms in the new MachineLearning package all by yourself ;)

via random thoughts » Blog Archive » OpenCV 2.0 on SnowLeopard 64bit via MacPorts.

Why you should use OpenGL and not DirectX

http://feeds.wolfire.com

Often, when we meet other game developers and say that we use OpenGL for our game Overgrowth, we’re met with stares of disbelief — why would anyone use OpenGL? DirectX is the future. When we tell graphics card representatives that we use OpenGL, the temperature of the room drops by ten degrees.

This baffles us. It’s common geek wisdom that standards-based websites, for instance, trounce Silverlight, Flash, or ActiveX. Cross-platform development is laudable and smart. No self-respecting geek enjoys dealing with closed-standard Word documents or Exchange servers. What kind of bizarro world is this where engineers are not only going crazy over Microsoft’s latest proprietary API, but actively denouncing its open-standard competitor?

Continue reading ‘Why you should use OpenGL and not DirectX’

Fool around with pepsi penguins

Fooling around with Unity3D


Continue reading ‘Fooling around with Unity3D’

Exporting animation from 3DMax to FLARToolkit

Just select all your animated objects and run this little one ; )

if selection.count > 0 then (

	output_name = getSaveFileName caption:"Animation File" types:"Animation Class (*.as)|*.as"

	if output_name != undefined then (

		output_file = createfile output_name

		for o in selection do (

			format "\rpublic static var %:Array = [" o.name to:output_file
			for t = animationrange.start to animationrange.end do (
				at time t (
					tx = formattedPrint o.pos.x format:"6.6f"
					ty = formattedPrint o.pos.y format:"6.6f"
					tz = formattedPrint o.pos.z format:"6.6f"

					rx = formattedPrint (o.rotation.x * 180 / pi) format:"6.6f"
					ry = formattedPrint (o.rotation.y * 180 / pi) format:"6.6f"
					rz = formattedPrint (o.rotation.z * 180 / pi) format:"6.6f"

					sx = formattedPrint o.scale.x format:"6.3f"
					sy = formattedPrint o.scale.y format:"6.3f"
					sz = formattedPrint o.scale.z format:"6.3f"

					format "\r\t%, %, %,     %, %, %,     %, %, %" tx ty tz rx ry rz sx sy sz to:output_file
					if t != animationrange.end then format "," to:output_file
				)
			)

			format "\r];" to:output_file
		)

		close output_file
		edit output_name

	)

)

Flash Player 10.1 Features and Enhancements

Flash Player 10.1 is the first runtime release of the Open Screen Project that enables uncompromised Web browsing of expressive applications, content and video across devices.

Static Event Dispatcher

///	STATIC DISPATCHER ///

private static var
	_dispatcher:EventDispatcher;

public static function
addEventListener(p_type:String, p_listener:Function, p_useCapture:Boolean=false, p_priority:int=0, p_useWeakReference:Boolean=false):void {

  	if (_dispatcher == null) { _dispatcher = new EventDispatcher(); }
  	_dispatcher.addEventListener(p_type, p_listener, p_useCapture, p_priority, p_useWeakReference);
}

public static function
removeEventListener(p_type:String, p_listener:Function, p_useCapture:Boolean=false):void {

  	if (_dispatcher == null) { return; }
  	_dispatcher.removeEventListener(p_type, p_listener, p_useCapture);
}

public static function
dispatchEvent(p_event:MovieEvent):void {

  	if (_dispatcher == null) { return; }
  	_dispatcher.dispatchEvent(p_event);
}