# Warp Mesh Generator 2.2 - for BGE Dome mode (updated to Blender 2.6)

Hello there.
I’m done with a script that helps generating warp mesh files to use with the BGE dome mode.

This system take in account the projector position, the spherical mirror + a dome:
Warp Mesh Generator v2.2 (blend file) [Blender 2.6svn]
Warp Mesh Generator v2.0 (blend file) [Blender 2.5svn]
Warp Mesh Generator v1.2 (blend file)[Blender 2.49svn]

It generates a file that compensates for the mirror distortion and produces a undistorted image.

You can also find in the file:

• a function to convert a point + a vector to a LINE object
• intersection functions between the light rays and the mirror and the dome
• everything well documented, so I hope it can be useful to someone, at least for learning experience

Cheers :eyebrowlift2:

edit: updated to 1.1
edit: updated to 2.0 (Blender 2.5 compatible)
edit: updated to 2.2 (Blender 2.6 compatible)

Examples of what you can do with this kind of warping meshes:

wow! Dude, you know a lot of things that i almost didn’t figure out!

hahaha, you beat it The only thing I really know is that I’m getting crazy with so many math… Too bad I didn’t come out with this script before Che Blender. It would awesome to scare everybody out of the talk room with that

I updated the script to calculate the light decayment.
Warp Mesh Generator v1.1 (blend file)

1.1 - August 17th 2009
* introducing luminosity calculation
* scale of mirror according to its ray
* frustum now is draw with edges instead of faces

def calculate_lumens():
* It regulate the luminosity intensity for the projector rays
* The light intensity decreases by a quadratic function of the distance
* We are taking the biggest light distance and using it in its maximum intensity (1.0)
- intensity = distance² / big_distance²

I’m about to test this system this Friday. I really hope it works fine…

Today I finally put this script in use.
In fact I’ve been cleaning up its code and simplifying it a lot. When I’m done with it I’ll post a new version.

In the mean time I recorded this video today, showing one of the possible uses for it:
http://vimeo.com/6860784 [audio in Portuguese]

I’m calculating the position of the water tank faces (bottom and front) and projecting images (in this case colors) to match their position.

Blender scene, outputting the result of the script

The warp mesh applied to a test image

The final (successful) result

Wow this is a great idea for virtual reality - consider using 2 projectors for stereoscopic 3D environment using polarizing lenses and glasses.

One thing I don’t understand - do you need to recalculate the image for different rooms or only for different projector lenses?

I’ll try to post something on http://www.mtbs3d.com/ (meant to be seen) which is a site devoted to 3D graphics. The idea of a 3D home immersion is likely to prove quite interesting to them.

Sorry for taking that long to reply. I’ve been too busy with the last tuning of the system (and the building process). I believe that the idea is not new, but not so many people do anamorphic projections with spherical mirrors (Paul Bourke has done that a lot already though).

One thing I don’t understand - do you need to recalculate the image for different rooms or only for different projector lenses?

For every projector, mirror, dome… you need a whole different calculation. For a room I don’t know if the rooms are the same and the optical system is in the same relative place … than it should work. That would be the least of my concerns

The idea of a 3D home immersion is likely to prove quite interesting to them.

Keep in mind that I’m originally writing it to use with the immersive dome. In order to use in a home installation you may find yourself having some fun tweaking some of the math formulas I used

Thanks for the interest. I’ll try to keep my mouth shut up until the Blender Conference so I can keep some surprises to the presentation …

Tomorrow is a great day. I’m going to test my system for real in my former university dome.
In the mean time I updated the script to run it in … Blender 2.50

Warp Mesh Generator v2.0 (blend file) [Blender 2.5svn]

In other words: I finally made an interface for it

wow! cool!

i´m trying to write a script that is similar (but a lot simpler) to the one you wrote, could you help me with it?

ps1: again, realy cool project!
ps2: greetings from São Paulo =]

Hi there,

thanks again for your work. I’ve updated your scripts to work with Blender 2.60 that has seen quite a bit of very silent Python API changes. You can get the files from here:

Best,
Christoph

Hi Christoph,
thanks for sharing your updates. I actually always wondered if this was useful for someone else.

So, how (and what for) you are using this script?

One small thing you forgot in your update is the the reports. They no longer take a string as input, instead they need a dictionary: e.g. self.report({‘WARNING’}, msg).

I took this as a chance to slightly update the script and make use of ui update callback functions (something new in Blender 2.5/2.6). Now there is an option to automatically recalculate the point cloud while tweaking the parameters in the interface.

The updated file can be found here:
http://blenderecia.orgfree.com/blender/dome/warp_mesh_2.6.blend

[I updated the README ackowledging your contribution in the release log, in the end of it. I hope you are ok with that]