Picking Added

Well another week and another new feature. Since I’ve really only had one sort of feature request from anyone I decieded to give it top priority and implement it ASAP. This turned out to be more challenging then I had first thought, mainly due to hours trying to find a stupid mistake I made early on :-( I’ve still got to do some optimization, but it’s reasonable performance at the moment.

I’ve also done quite a bit of work all over but mainly focused on updating the camera object.

View the demo here

Video:

Tags: , ,

10 Responses to “Picking Added”

  1. Siroko says:

    Not working on Minefield…..

  2. aa says:

    Works here on Minefield.

  3. gero3 says:

    very good
    works very well in chromium
    only a bit slow becuase of gl.readpixels

  4. gero3 says:

    and in minefield

  5. horace says:

    i have more questions… :)

    how does timing work with webgl? for 3d applications it’s important to know exactly how long the last frame took for rendering. does javascript provide any useful info about this?

    and isn’t the main loop of a webgl application like a endless loop which totally blocks the rest of the browser?

  6. Paul Brunt says:

    webgl doesn’t have anything specific build in for timing but you can just used the setTimeout/Interval. This allows you to set how often you want a frame rendered without blocking the browser. If you need to know the time taken to render a frame you can just get the time using getTime on the date object before and after the frame to work out the time taken.

  7. Steve Elbows says:

    Using a nightly build of webkit on OS X with WebGL enabled, I get errors with this demo such as:

    ERROR: 0:55: ‘>’ : wrong operand types no operation ‘>’ exists that takes a left-hand operand of type ‘float’ and a right operand of type ‘const int’ (or there is no acceptable conversion)

  8. horace says:

    but aren’t milliseconds often too inaccurate? all 3d engines i know use higher precision timers.

  9. Paul Brunt says:

    Thanks Steve looks like i missed some “.0″ in the shader, I think I’ve got them all now.

  10. Paul Brunt says:

    I’m not sure then to be honest; I can’t imagine why you would need a timer with more precision then +/-1ms, except maybe for very accurate physics but I’ve not even looked that far yet.

Leave a Reply