David Hurth's blog

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).

jMaps - jQuery Google Maps Plugin

jQuery has quickly become one of the most used JavaScript libraries around. Google Maps is possibly the most popular mapping website on the web. Wouldn't it be nice to connect the two easily using a small library? Well, jMaps is a library that does just that and version r64 has just been released.

Below is a rundown of the main features as posted on the jMaps Google Code page.

jMaps is a jQuery plugin that provides a really easy API to create and manage multiple google maps on any page.

  • Geocode and reverse any valid address in the world via Google's geocoding API
  • Search for directions to and from any location
  • Add and remove Markers
  • Add and remove polygons and polylines
  • Add and remove graphic layers on the map
  • Add and remove Google adsense layers
  • Add and remove Traffic layers
  • Get information back such as map center, map size, map type, etc

You can go to the Google Code page here.

50 Must-read Books on Web Development

Tagged:  

Looking for a good book on web development? Well, over at Nettuts they have put together a good list of 50 good books. So, if you are looking for a good book on web development this list should have quite a few good suggestions.

Below is an excerpt from the list.

Frameworks

8. Agile Web Development with Rails

Ever since Rails took the development world by storm a few years back, there has been plenty written about the Ruby framework. But you can't find a much better resource than one written by Rails creator David Heinemeier Hansson.

  • 9. Python Web Development with Django

    Django is an excellent python framework, and one that is highly respected in the development community. Python Web Development with Django is 400 pages of excellent techniques and tutorials for learning django development.

  • 10. Professional CodeIgniter

    CodeIgnitor is a PHP-based framework that has shown excellent promise amongst other frameworks. Professional CodeIgnitor gives an overview of MVC programming, and outlines how to build excellent web applications with CodeIgnitor.

  • 11. Beginning CakePHP: From Novice to Professional

    Beginning CakePHP: From Novice to Professional is a handy paperback for beginners trying to learn the MVC-based framework, but also, as the name implies, is highly useful for an intermediate or advanced CakePHP programmer. The book claims it's geared for...

    ...an audience of developers already familiar with PHP but who may not be PHP experts. This book is tailored for those new to CakePHP and who want a thorough tutorial.

  • You can read the full post here.

    JS Strict Data Types - Beta 1.1 Released


    JS Strict Data Types Beta version 1.1 has just been released. The new release fixes various bugs that where found in the initial release. The biggest fix was one that caused the string and integer data types to not be kept correctly in certain situations.

    Any code that you may have written using the library should work with no code changes. So, we recommend that anybody using the initial release start using this new release.

    You can go to our Google Code page here.

    You can download the new version here.

    JavaScript Table Sorter

    Tagged:  

    There may be times when you have a table that you want users to be able to sort. In some cases it will make sense to have the table sorted on the server side, however for smaller tables it may be useful to have a script sort it on the client. Well, over at the Leigeber Web Development Blog they have posted a nice small script that accomplishes just that.

    below is an excerpt from the post.

    This JavaScript table sorting script is easy to use, fast and lightweight at only 1.7KB. It includes alternate row formatting, header class toggling, auto data type recognition and selective column sorting. It will currently sort strings, numbers and currency. More features will follow.

    You can read the full story here.

    You can see a demo here.

    You can download the source code here.

    Creating a Virtual Keyboard

    Tagged:  

    With devices like the iPhone and many of the new touch computer monitors we are using traditional keyboards less and less. Add this to the fact that when many people are on the go they use public computers with possible security threats like keyloggers. With these trends in computing you may look at putting a virtual keyboard in your web applications (where it makes sense). Well, over at Design Shack they have put together a nice example of this using jQuery (although you could take the same concept and use a different library).

    Below is an excerpt from the post.

    For those of us who travel often, we often end up accessing our emails and other confidential web accounts on public computers. In such circumstances, we are completely at the mercy of keyloggers and other malicious software that track our keystrokes and record our passwords.

    Yet, very few websites provide their users with the option of using a virtual keyboard to key in (at the bare minimum) their passwords. Yes, a few banks do it, but considering how much personal information we store in various web applications these days, the safety of these accounts are of no less significance to us. This tutorial will explain how we can implement a simple virtual keyboard with some (well, okay, lots of!) help from jQuery.

    You can read the full post here.

    Google Introduces Powerful Visualizations for your server-side data

    Tagged:  

    Google has announced the introduction of some powerful visualizations for your server-side data. They have publicly documented the Google Visualization API's open-wire protocol (you can go to the documentation here). The API has been greatly expanded from when it first launched and can now expose server-side data, such as SQL databases and even Excel spreadsheets, and display this data through visualizations from their growing directory.

    Below is an excerpt from the post.

    To make it even easier for developers to get started, we have documented an open-source Python library that enables any Python developer to quickly start using the API. What we find particularly cool about this library is that it also runs on Google's AppEngine. You don't even need to be an owner of your own servers to expose your data: You can place it on AppEngine and use the Visualization API to expose your data in meaningful, insightful ways in dashboards and reports. Expect to see additional server-side tools for the Visualization API in the near future.

    You can read the full post here.

    JS Strict Data Types - Released

    We at Ajaxonomy are happy to announce the release of the first library in the Ajaxonomy Developer's Toolkit. The library is called JS Strict Data Types and attempts to provide a way to maintain strict data types in JavaScript. Strict data types are proposed in the next version of JavaScript, however it is hard to say when you will actually be able to use it in all browsers. So, JS Strict Data Types is an attempt to allow the use of strict data types now.

    The library is very easy to use. Simply include the small 7K (uncompressed) js file in your web page or application and then you can start defining variable data types strictly through the methods used in the below example.

    MyVar1 = new Int(12); //Creates an Integer variable MyVar2 = new Float(2.54); //Creates a Float variable MyVar3 = new String("Some Text"); //Creates a Sting variable MyVar4 = new Boolean(true); //Creates a Boolean variable

    The library uses various methods to maintain the strict data type (if you choose not to use the methods in the library strict data types may not continue to be maintained). The below shows a few of the mathematical methods that are available in the library.

    MyVar1.add(5); MyVar1.sub(2); MyVar1.mult(10); MyVar1.div(7);

    Since there are quite a few methods that are used to guarantee that strict data types it is recommended that you read the documentation before using the library.

    This beta 1.0 release of the library is released under the GNU Lesser GPL. So, it can be used for personal and commercial use. Because of this go ahead and use the library in other libraries or any JavaScript project.

    You can see a demo page that uses the library and displays the results here.

    You can download the library here.

    You can go to the projects Google Code page here.

    You can read the projects documentation here.

    Learning the Yahoo! User Interface Library - Book

    Tagged:  

    I've been looking at a book from PACKT Publishing about Learning the Yahoo! User Interface Library. The book is one of the few good books available on the YUI. If you are like me you enjoy reading blogs for quicker reads, but for in-depth reads you find a traditional book better.

    The book takes you from installing the YUI and and Code Placement through Ajax calls and Drag and Drop events. Learning the Yahoo! User Interface also takes you through debugging the YUI way and using content containers and tabs (just to name a few more topics).

    Each chapter goes over a small example project about the topic of the chapter. For example Chapter 7 talks about navigation and AutoComplete with code for navigation options and a nice AutoComplete example. The book is well written and has an easy to follow format.

    You can read the full table of contents here.

    One thing that is really nice about books written by PACKT Publishing on an open source project is that they pay a royalty to the open source project. So, you not only get to learn about the open source project, but you also support it with the purchase of the book.

    This book is a must for anybody that is interested in implementing a project with the YUI JavaScript library. I would recommend it for those of you that are new to YUI and even to those who have used it for a while.

    You can purchase the book here (available in traditional and e-book formats).

    If you want to see a fun application written with YUI check out World of Solitaire (watch out, you can spend quite a bit of time playing it!)

    Is Google Spreading Itself Too Thin?

    Tagged:  

    Over at Read Write Web they have written a very interesting post about Google. They ask a great question, Is Google Spreading Itself Too Thin? This is a very interesting question as in recent years Google has expanded way beyond search.

    Below is an excerpt from the post.

    What About Chrome?

    Chrome showed Google's brand power in the market. A pretty geeky story (better performance and sandbox security for plug-ins) got tremendous traction in the media and prompted people who had never even made the jump from Explorer to Firefox to look at Chrome.

    But it is very hard to see any strategic advantage for Google in splintering the browser market even further. Surely their interest lies in making sure Firefox gains against Explorer? Why not simply continue helping Mozilla?

    This looks like an engineering project (yes, a very cool engineering project) that got out to market with a "oh, well, why not, seems a shame to throw it away" rationale.

    Has Boredom Become an Issue Inside the Googleplex?

    It is almost as if Google is bored. The cash just keeps rolling in. How do they exercise those amazing minds? This is not an uncommon problem. My first job was with a small publishing company in London that had one amazing cash cow and lots of "loss leaders". I naively asked one of the owners why he did this, why not just have the cash cow? He thought for a while and said "well, what would I do every day?"

    You can read the full post here.

    So, let me know your thoughts, Is Google Spreading Itself Too Thin?

    Syndicate content