WebGL

Got a reminder about this very interesting technology today, definitely going to keep an eye on it, ’cause it’s going to be really cool!

WebGLâ„¢ working group for enabling hardware-accelerated 3D graphics in Web pages without the need for browser plug-ins

Interesting links:

BF:H Random tip

Whenever you join a BatlleField: Heroes server a ‘Tip of the day’ is displayed. I was wondering where I could find all the tips and if anybody had already done something with them (i.e. create a service to get a random tip).

I couldn’t find anything after a Google search, so I started looking around. It turns out that all in game copy is stored in a file called ‘strings.csv‘. If you have BF:Heroes installed in the default location, you can find it here: ‘C:\Program Files\EA Games\Battlefield Heroes\mods\bfheroes\Localization‘. This file is a comma separated values file which you can open with Notepad and even Excel.

The bits I needed to have tips displayed are the rows starting with ‘WEST_FE_Loading_tip_ingress_‘ and ‘WEST_FE_Loading_tip_text_‘. What I’ve done for now is copy those fields over into an XML file: http://ansuz.nl/php_lib/bfheroes/tipoftheday.xml. I guess a next step could be a little script (or AIR application) that takes the ‘scripts.csv‘ file and converts it to XML in the format I need.

I then created a small PHP script to load the XML file and display a random quote, see here: http://ansuz.nl/php_lib/bfheroes/tip.php?method=randomTip
The first line is the ‘tip header’, the second the ‘tip body’. Both are wrapped in a ‘span’-tag with a unique class name so you can style it the way you want.

The final bit I did is loading a random tip on a site with my BF:H stats and applying some styling to it: http://ansuz.nl/bla/bfheroes/.

Interesting PV3D finds

It’s been a while since I’ve used PV3D. I ran into a couple of very interesting PV3D related post some time back, completely forgot I had bookmarked them somewhere and now ran into ’em again.

PaperVisionX

PapervisionX is the next version of Papervision3D built from the ground up based on Flash10’s new 3D api.

An article explaining what PVX is and what it isn’t: http://blog.papervision3d.org/2009/03/16/papervisionx-what-it-is-and-what-it-isnt/

3D fur

Using (old) gaming techniques to create a faux fur effect in 3d: http://kode80.com/2009/06/25/papervision-fur-3d-texture/

VisualPV3D

VizualPV3D is a Flash Visualization Application that provides a GUI interface to create and manipulate objects in 3D scenes using Papervision3D.

More info and download here: http://www.juxtinteractive.com/work/vizualpv3d/

Git

I’ve been meaning to look into Git for a while now and I’ve finally found some time to do so.

Git is a free & open source, distributed version control system  designed to handle everything from small to very large projects with speed and efficiency.

I’ve been using SVN for some time and MS Visual SourceSafe before that. SVN was a big improvement over VSS and Git looks promising by claiming it’s faster than other revision control systems.

Working on a Windows machine made it a tiny bit harder to get Git up and running as it is developed for Linux. Luckily there are a lot of open source developers and some of them built MSysGit to have Git running on Windows in an easy way.

Another point is that a lot of developers have an SVN background and are switching to Git. As a result you can plenty of guides telling you how to use Git compared to SVN. The one I liked best is the “Git – SVN Crash Course” by Petr Baudis.

Obviously as Git is becoming more and more popular there are services popping up like Google code. GitHub for instance is one of them offering a variety of deals, from completely free to very large packages for businesses.

Links:

SourceBinder

SourceBinder is a node based visual development environment for Flash 10.

Instead of writing code you assemble a set of building blocks on a canvas and wire those blocks together. This allows you to rapidly create Flash applications.

You can export those applications into regular Flash SWF file.

SourceBinder will be available free of charge for any purposes.

It reminds me a lot of Lego MindStorms 😉

Links:

Protocol Buffers

Quick reminder:

Protocol Buffers is a serialization format with an interface description language developed by Google. The design goals for Protocol Buffers emphasized simplicity and performance. In particular, it was designed to be faster than XML.

In other words: Lightning fast data transfer between various parts of a website.

Five3D multiline wordwrapping text

A couple of days ago I had a look into Five3D just because I had some time on my hands and I wanted to check out Five3D for a while now. One big thing I missed in this vector based 3D engine was word wrapping for text. A Google search led me to an inaccessible blog, so I decide to write the word wrapping myself.

Download the file here: Updated DynamicText3D.as (Compatible with v2.1.2)

Usage:

ActionScript

  1. var text3d: DynamicText3D = new DynamicText3D(HelveticaBold);
  2. text3d.size = 40;
  3. text3d.color = 0xffffff;
  4. // set a maximum width for the text
  5. text3d.maxWidth = 220;
  6. // flick word wrapping on
  7. text3d.wordWrap = true;
  8. text3d.text = "Something long enough to actually wrap...";
  9.  
  10. // Traces out the height of the text
  11. trace("text3d.textHeight")

I know it’s not perfect, but it’s working for me! 😉

Useful Firefox add-ons

FireBug
Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.

WASP
Provides detailed information about the data being collected trough Query String and Cookies by web analytics solutions (called “tags”, “trackers” or “web bug”), ad networks, behavioral targeting and multivariate testing tools. Covers over 125 tools, including Google Analytics, Omniture SiteCatalyst, Coremetrics, WebTrends and several others.

HTML Validator
Validates HTML documents using the CSE HTML Validator engine for Windows. Requires CSE HTML Validator for Windows.

Screengrab
It will capture what you can see in the window, the entire page, just a selection, a particular frame… basically it saves web pages as images – either to a file, or to the clipboard.

MeasureIt
Draw out a ruler to get the pixel width and height of any elements on a webpage.

Links:

Edits:

  • 17/09/2009: Added MeasureIt.

HaXe

I started having a look at using HaXe a couple a days ago since it promises to be quite interesting.

haXe is a powerful modern language with many compelling features. It is aimed at giving developers a tool to create websites & applications in a single unified language.

It’s quite simple to install and if you use FlashDevelop as editor you’re pretty much set. I also took a look at some plugins for Eclipse, but they felt quite unfinished (granted most were still in beta). I tried Eclihx and HXDT.

Some useful info I found:

  • HaXe install dir: C:\Program Files\Motion-Twin\haxe\
  • Setting SWF properties using the HaXe compiler: -swf-header <header> : define SWF header (width:height:fps:color), i.e. “-swf-header 640:480:31:000000”
  • When your Main class is extending Sprite make sure to add it to the display list using: “Lib.current.stage.addChild(this);”
  • A nice tutorial on using SWCs with HaXe

Away3D in HaXe problem

I tried getting Away3D to run using Haxe, but it keeps on throwing an error at run time when I’m calling View3D.render() on every frame:

TypeError: Error #1034: Type Coercion failed: cannot convert flash.utils::Dictionary@157e1c1 to Function.
at MethodInfo-1076()[C:\Projects\HaXe\test03_away3d\src/away3d/haxeutils/HashMap.hx:50]
at away3d.core.utils::CameraVarsStore/reset()[C:\Projects\HaXe\test03_away3d\src/away3d/core/utils/CameraVarsStore.hx:147]
at away3d.containers::Scene3D/update()[C:\Projects\HaXe\test03_away3d\src/away3d/containers/Scene3D.hx:186]
at away3d.containers::Scene3D/onUpdate()[C:\Projects\HaXe\test03_away3d\src/away3d/containers/Scene3D.hx:85]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at away3d.containers::View3D/notifySceneUpdate()[C:\Projects\HaXe\test03_away3d\src/away3d/containers/View3D.hx:334]
at away3d.containers::View3D/render()[C:\Projects\HaXe\test03_away3d\src/away3d/containers/View3D.hx:921]
at com.dare.haxetest.core::Away3DTest/enterFrameHandler()[C:\Projects\HaXe\test03_away3d\src/com/dare/haxetest/core/Away3DTest.hx:222]

From a commit message in SVN it looks like there is a problem with using Dictionaries in HaXe. As the HashMap class still uses a Dictionary this error seems to be happening. I tried converting it to use the Hash class instead of a Dictionary, but that introduced other problems.