3D Fish Tank debuts

Posted by admin
May 19 2009

Here it is: my first iPhone application will be a fish tank. I’ve been amazed how Serene’s Screen Savers were doing well, and I’ve decided to be the first or at least one of the first to be on the iPhone Platform with a Fish Tank.

What will make this one different from the other ones?

Well that’s simple : this will be a REAL 3D fish tank, not a couple of 3D fishes moving from left to right with some background flat pictures… You’ll be able to turn around it, and zoom… more info coming soon.

Here comes some pictures and some already working features!

The water view from the top

The water view from the top

Some cheap caustic animation gives the illusion of moving water… You have to see it animated, it looks great!

Fish Tank from the side

Fish Tank from the side

From the side you can see the top animation of the water that works also from above, and the fake shadows on the Sand. Yes because there is no shadows on iPhone, so I need to fake them with a projector.

The caustics animations are projected on all the objects, this gives to the tank a nice underwater effect like in the famous Serene Screen saver.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogosphere News
  • MySpace
  • Twitter

Subscribe without commenting

2 Responses

  1. Fang Jin says:

    I came by your post at unity forum, very impressed, just wonder how this illusion of moving water is implemented, I am working on a project of tumor growth, needs some water illusion.

    thanks
    Fang

    • admin says:

      It is very simple. Just find a little software software named : Caustic Generator. With this software, generate a list of pictures JPG of the caustic animation.
      Then create a plane and give it a material that is Transparent / Vertext Lit
      Drag and drop this script on your plane :


      #pragma strict
      //@script ExecuteInEditMode
      public var material : Material;
      public var caustics : Texture[];
      public var framesPerSecond =0.5;
      private var shader : Shader = null;
      var exindex : int=0;
      function Start()
      {
      shader = Shader.Find("Transparent/VertexLit");
      material.SetTexture("_MainTex", caustics[0]);
      }
      function Update ()
      {
      if (exindex!=GUIstuff.indexcaustics)
      {
      exindex = GUIstuff.indexcaustics;
      material.SetTexture("_MainTex", caustics[exindex]);
      }
      }

      Now with your script in the inspector, you can decide of the number of texture of your animation (set it to the number of textures you generated with Caustic Generator).
      You need to drag and drop each textures in the right order in their respective spots. (I use 16 textures animations and name them caustic01.jpg caustic02.jpg etc…)

      Now run and it should work… you can even set the speed of the animation in Frames per seconds!

You must be logged in to post a comment.

Trackback URL for this entry