Page 1 of 1

Snibgo's Cylinder Script

Posted: 2014-12-17T12:32:56-07:00
by marcospassos
Hi Snibgo!

I've been studying your cylinder script, as well as the Fred's one. I trying to make your script displace for both sides in order to create more realistic images when pitch=0.

Image

Currently, we are able to tilt downward and upward. I would like to reproduce the result of image of the third example:
Image

Do you have any tip or idea?

Best regards,
Marcos

Re: Snibgo's Cylinder Script

Posted: 2014-12-17T14:02:49-07:00
by snibgo
My scripts assume the camera is infinitely far from the cylinder (parallel projection). For genuine 3-dimensional work, where the camera is close to the object with a wide-angle lens, the maths would be much more difficult and the IM scripts would be far more complex.

I would use POV-Ray. See the examples on that page: http://im.snibgo.com/cylinder.htm.

Re: Snibgo's Cylinder Script

Posted: 2014-12-17T15:10:01-07:00
by snibgo
For situations where POV-Ray is not available on the server, and the user does not have full flexibility over camera angle etc (because there are a limited number of photos of mugs), a possible method is:

1. On a laptop or something, write the POV-Ray solution for each mug photograph. This models the mug and camera.

2. Apply these solutions to a 2D gradient image.

3. This gives you absolute displacement maps.

4. Convert these to relative displacement maps.

5. On the server, in live use, software uses IM to apply the relative displacement maps to user-supplied images.

Steps 1-4 could be done on any computer that runs POV-Ray. The server wouldn't need POV-Ray.

This would give you the geometric distortion. You could also use POV-Ray to create lighting and shadow effects, which could be applied on the server to the final output.

Re: Snibgo's Cylinder Script

Posted: 2014-12-17T16:02:30-07:00
by marcospassos
I don't have any knowledge about POV-Ray. This script fits well for almost all need I have, except this one.

Do you think that is possible to create a displacement map to displace in both sides symmetrically without using POV-RAY?

Re: Snibgo's Cylinder Script

Posted: 2014-12-17T16:33:13-07:00
by snibgo
Possible, but "the maths would be much more difficult and the IM scripts would be far more complex."