### User Activity

• Posted a comment on discussion Developers on Art of Illusion

You're correct, it should be passing the index it was actually added at.

• Posted a comment on discussion Developers on Art of Illusion

Possibly there's no exception getting thrown. It depends whether the divide by zero is happening in an integer or floating point calculation. In floating point, dividing by zero gives a well defined result (infinity, -infinity, or nan depending on the numerator) rather than throwing an exception.

• Posted a comment on discussion Open Discussion on Art of Illusion

That's a fairly obscure piece of code that not many other people are likely to be depending on. So I'd think it's fine to just change it.

• Posted a comment on discussion Developers on Art of Illusion

Sounds like a good idea. unit() and getNormalized() both sound like reasonable names. I wouldn't call it direction() because "direction vector" means something different. (When working in homogenous coordinates, a direction vector is one whose fourth component is zero.)

• Posted a comment on discussion Developers on Art of Illusion

My current version creates a template image of the map that is larger or equal to the maximum size of preview images. This happens the first time a preview is needed. Then the scaled preview is always created form that. There's no need to create the scaled version of the image. Just use the version of drawImage() that scales it down.

• Posted a comment on discussion Developers on Art of Illusion

There's a much faster way of doing it: create the preview image from the smallest mip map whose size is greater than or equal to the requested preview size. You're always generating it from maps[0], which can be very large, but you don't need to do that. If you have a 1000x1000 image and you want to create a 100x100 preview, you can generate it from the 128x128 mip map. There are other optimizations that could be used as well. You could require that preview image sizes always be a power of two (or...

• Posted a comment on discussion Developers on Art of Illusion

Can you post your code? I'd like to see how you're doing it. If done properly, scaling images to any size should be super quick.

• Posted a comment on discussion Developers on Art of Illusion

Creatig preview images can take quite a few fractions of quite a few econds if the images are large and there are very many of them. Did you implement the optimization I suggested where it skips images that are currently scrolled out of view? If there are a lot of images in the scene, you won't be able to see most of them. As you resize the window, it only needs to regenerate the previews for ones that are currently visible.

View All

### Personal Data

peastman
Joined:
2000-09-10 17:48:09

### Projects

• Last Updated:
• Last Updated:
• Last Updated:
• Flow Flow is an on-screen keyboard for Android devices. Last Updated:
• Last Updated:

### Skills

• No skills entered.