Fun Stuff

JSON - 3D

Tagged:  

Recently I have been looking at 3D as it pertains to the web and controlled through JavaScript without the aid of plug-ins (this is a topic that interests me as in my early programming I created a lot of 3D applications). While Canvas is currently good for 2D rendering (on most browsers and IE with a little help from Google) we are still a ways off from cross browser Canvas 3D support. While I have found a few 3D engines written with Canvas, they all seem to bomb on IE (even with Google's IE Canvas script).

Even if a good 3D solution was available for the web we still have the issue of being able to load all the models for a scene. This got me thinking a bit about how the loading of scene information could be made to work on the Web.

The concept that I have come up with is fairly simply. You would load a map of the scene (this map may could be stored in JSON and could be made to work as a BSP [Binary Space Partitioning] tree) and on the map you would have various check points. Each checkpoint would load the needed models using JSON.

Below is an example of what the JSON for a cube may look like.

{"obj":[{"vrt":[[-5,-5,5],[5,-5,5],[-5,5,5],[5,5,5],[-5,-5,-5],[5,-5,-5],[-5,5,-5],[5,5,-5]],"fac":[[0,2,3,1],[3,1,0,1],[4,5,7,0],[7,6,4,0],[0,1,5,4],[5,4,0,4],[1,3,7,3],[7,5,1,3],[3,2,6,5],[6,7,3,5],[2,0,4,2],[4,6,2,2]],"nrm":[[0,0,-1],[0,0,-1],[0,-0,1],[-0,0,1],[0,-1,0],[0,-1,0],[1,0,-0],[1,-0,0],[0,1,0],[0,1,0],[-1,0,0],[-1,-0,-0]]}],"mat":[{"r":150,"g":225,"b":219},{"r":150,"g":162,"b":223}]

While this is just a concept and we are still waiting on the technology to make the possible. It is interesting to think of how we may be able to use JSON - 3D in the near future.

You can see a demo of Canvas 3D by nihilogic.dk using JSON for models here (this works on Firefox, but may not work on other browsers).

Ajax Marketing...

Tagged:  

jqPuzzle - jQuerry Sliding Puzzle

jqPuzzle is a nice puzzle script based on jQuery. The script has some very nice effects using the jQuery library.

You can get jqPuzzel as well as see a few demos here.

12 Websites To Help You Learn Flash/ActionScript

Tagged:  

Six Revisions has put together a great list of Flash and ActionScript resources. Since Flash is used throughout the web for animation and with ActionScript you can do some pretty nice programming to go with the animation it is nice to have some good resources.

You can read an excerpt from the post below.

6. ActionScript.org

ActionScript.org - screen shot.

ActionScript.org is a site that provides resources and information pertaining to Flash, Flex, and ActionScript. They have a fairly active Forums section as well as an ActionScript Library that currently has over 700 objects you can download.

Tutorial examples:

7. Flash and Math ActionScript 3 Tutorials

Flash and Math ActionScript 3 Tutorials - screen shot

Flash and Math has a great collection of tutorials on AS3. They cover basic to advanced topics so that Flash developers of any level can find something they can read and learn from. Many of the tutorials include the source files for download.

Tutorial examples:

8. Flash Tutorials on Pixel2Life

Flash Tutorials on Pixel2Life - screen shot.

Pixel2Life, according to the site, is the "largest tutorial index catering to graphic designers, webmasters and programmers". With over 40,000 indexed tutorials, you’ll find many links to tutorials in their Flash Tutorials section.

Indexed tutorial examples:

9. Flash Perfection

Flash Perfection - screen shot.

Flash Perfection is a website with a large collection of Flash tutorials, tips, and tricks from various websites. Flash Perfection has 23 categories to help you find information more quickly.

Indexed tutorial examples:

You can read the full post here.

With the major use of Flash for animation on the web this resource will help many web developers.

goosh.org - The Unofficial Google Shell

Tagged:  

It's interesting that I just finished up a post on keypress navigation, because I've come across a little gem called goosh [goo-sh], an Ajax-based UNIX-like Google search shell that enables you to use the Google search engine with only your keyboard. Sporting a variety of commands listed in its help menu, goosh is just what you need to make your Googling just that much quicker.

Google itself has seen the value in adding keystroke navigation to their search engine as shown in one of the experimental search tools in Google Labs [demo].

Check your mouse at the door and visit goosh.org

TubeSpy Now Available in 23 Languages

With the recent addition of 10 languages to the Google AJAX Language API, we have published an update to TubeSpy that includes support for Bulgarian, Croatian, Czech, Danish, Finnish, Hindi, Norwegian, Polish, Romanian and Swedish.

TubeSpy, a recent addition to Ajaxonomy Labs, is a YouTube Spy allowing you to see what videos others are watching on YouTube right now! TubeSpy was built using jQuery, the YouTube API, and more recently, the Google AJAX Language API to add support for other languages.

Visit TubeSpy

Processing JavaScript

Tagged:  

A while back I wrote a post about Processing (you can read my previous post here). If you haven't seen Processing before, it is a Java based development platform that rivals Flash. Well, John Resig has written a cool port of the Processing API to JavaScript.

Below is an excerpt from John's post.

The Processing Language

The first portion of the project was writing a parser to dynamically convert code written in the Processing language, to JavaScript. This involves a lot of gnarly regular expressions chewing up the code, spitting it out in a format that the browser understands.

It works "fairly well" (in that it's able to handle anything that the processing.org web site throws at it) but I'm sure its total scope is limited (until a proper parser is involved). I felt bad about tackling this using regular expressions until I found out that the original Processing code base did it in the same manner (they now use a real parser, naturally).

The language includes a number of interesting aspects, many of which are covered in the basic demos. Here's a brief selection of language features that are handled:

  • Types and type casting - Type information is generally discarded, but becomes important in variable declaration and in casting (which is generally handled well).
  • Classes - The full class system is supported (can be instantiated, etc. just fine).
  • Method overloading and multiple constructors - Within classes you can have multiple method (or constructor) definitions - with the appropriate methods being called, based upon their signature length.
  • Inheritance - Even classical-style inheritance is supported.

Note: There's one feature of Processing that's pretty much impossible to support: variable name overloading. In Processing you can have variables and functions that have the same name (e.g. float size = 0; float size(){}). In order to support this there would have to be considerable overhead - and it's generally not a good practice to begin with.

You can read the full post here.

If you get some time over the weekend, you might want to play with the new Processing JavaScript API. This looks like another good job by John Resig.

Wolfenstein 3D in JavaScript

Tagged:  

If you are looking for something to get through the rest of the work week then check out this great JavaScript game. The game is Wolfenstein 3D (for you younger readers Wolfenstein 3D was the very first big first person shooter) and is just like the game I used to play on my 386 (except the AI is not finished)!

You can read more about the game here. Or you can get straight to the game here.

Note: that the game works on most browsers, but does not work on Internet Explorer.

It is always interesting to see things like this done in JavaScript. Who knows, perhaps we will be playing games like Doom (the original version) in JavaScript within the next few years.

XSketch - Just in time for Friday!

Tagged:  

Ryan Dewsbury has built a multiplayer GWT based Pictionary game called XSketch. He is the creator of GPokr and KDice. XSketch is pretty fun and straightforward game. One player is shown a word he needs to illustrate. While he's drawing, the other players try to guess that word. The sketcher and correct guesser are awarded points only when the word is guessed correctly. However, only the sketcher loses points when no correct answer is guessed. The role of sketcher moves around the table so each player has the opportunity to draw.

Go Play XSketch!

TubeSpy adds support for 11 languages

TubeSpy, our YouTube application from Ajaxonomy Labs, now supports 11 new languages. By utilizing the Google Language API, TubeSpy is now able to dynamically change the language used in the application.

Languages now supported by TubeSpy include:

  • English
  • Arabic
  • Chinese
  • Dutch
  • French
  • German
  • Italian
  • Japanese
  • Korean
  • Portuguese
  • Russian
  • Spanish

Here's a sample in Russian:

The app is still in beta, so be aware there may be some layout/formatting issues with the additional languages. In any case, please send us your comments, bugs, and feature requests.

Go to TubeSpy

Syndicate content