Playing with canvases

Development 2 Comments

Playing with the HTML <canvas> tag:

Canvas!

This is a test of rendering a sim map inside AjaxLife using JavaScript. The green markers are people – it does the same same above/below/level thing as the client. The whole thing takes a split second to render on my MacBook. I imagine it’d take longer if I included the missing points (that’s being done at a 64×64 resolution).

Not exactly great, is it? Better than nothing though – still working on it. Anyone happen to know how the client puts the sim images together? ;)

On an unrelated note, I’ll be returning from abroad tomorrow.

2 Responses to “Playing with canvases”

  1. John Drinkwater Says:
    October 26th, 2007 at 4:17 pm

    Ooh, very tidy.
    Forgive me for not knowing, what are the missing points, would it improve the stepping on the island edge?

  2. Katharine Berry Says:
    October 26th, 2007 at 5:57 pm

    That’s only sampled the 256x256m area of my sim at a 64×64 resolution – one sample every four metres. If it used the extra points, it should theoretically be much neater. It’d also involve drawing sixteen times as many points and sending sixteen times as much data (unless I just interpolate the missing points client-side).

    I think that due to the nature of the canvas element, drawing sixteen times as many points would take almost exactly sixteen times longer (not counting time to interpolate them if necessary) without any extra memory usage (by the canvas object – if it needs to store sixteen times as many points it could have issues there).

    This image is also rotated 180 degrees – the image I was using to get orientation right turned out to have been rotated. I’ve removed my hack to rotate it 180 degrees and it works properly now.

Leave a Reply

Icons by N.Design Studio. Designed By Ben Swift. Powered by WordPress.
Entries RSS Comments RSS Log in
Second Life, Linden Lab, the Eye-in-Hand logo, the Hexagon logo, the inSL Cube logo, the Linden Lab Hexagon logo, LindeX, the Second Life Eye-in-Hand logo, Second Life Grid, the Second Life Grid logo, SL, SL Grid, SLurl, Teen Second Life, the Teen Second Life Eye-in-Hand logo, TSL, WindLight, "Your World. Your Imagination.", and Asset Server Problems are trademarks of Linden Research, inc. Second Lie is a trademark of Swindlen Labs.