Flickr Demo - Almost done!
Chris Bishop | 30 July, 2008 | 12:19
I have completed the flickr demo and need to polish it up for displaying on the website. The demo has 5 untextured cubes. The user enters a search term and then clicks a button to search flickr for 5 images. Once the images have been found they are downloaded and applied to the 5 cubes. The user has the option to search for the next 5 pictures available if so desired. The cube can be rotated in any given direction by clicking and dragging the cube. Zooming and out from a cube happens by double clicking the cube.
I said I would have the demo done this week but I ran into problems with the Free Camera. I believe at one time the Free Camera Object would rotate around its Look At Point when its position was changed. With this assumption I was setting its Look At Point to a point in 3d space. This resulted in weird behaviour. It turns out the Free Camera has changed and the Look At Point is not a fixed point in space but more of a direction and the camera does not rotate around the Look At Point when its position has changed.
Here is my attempt to illustrate the situation:
You are standing in a room looking at a chair in the middle of that room and you are facing the chair directly.
What I thought would happen:
Taking 2 steps to your left would result in doing a side step to the left and turning your body to the right to remain facing the chair directly.
What is happening:
Taking 2 steps to your left will result in doing a side step without turning your body to the right. You are no longer looking directly at the chair.
So it turned out I didn’t need to set the Look At Point since the Camera did not rotate on its own. Another issue I came across was with Intervals in Javascript. We have an Interval that runs to update the scene and all the objects in the scene. Well I has set the linear velocity of the camera so it would move to the right spot gradually and I needed a way to check if the camera had arrived. I used a timer to check every 250 milliseconds if the camera was close. I started some debugging to see how close the camera was getting and I notice that my interval was only being executed about 3 times. So I decreased my interval to 25 milliseconds and my interval was now executed 4 times. I created a counter and removed as much processing as possible from the function and still it was only called 4 times. I have not looked into it but there may be issues with intervals in Javascript. I’m not sure how we’ll be handling threading in the future. The problem might not have been the intervals since I have not researched it but I plan to.

Awesome, can't wait!
David Humphrey | 30 July, 2008 | 22:59Awesome, can’t wait!
the problem you see is recent ...I don't think the
Cathy Leung | 31 July, 2008 | 12:51the problem you see is recent …I don’t think the 0.3 release has this problem as I used a moving camera trick to simulate the spinning teapot (see front page source on this). I think that andor is working on fixing this.