mcjSphericalCam

══════════════════

Introduction

══════════════════

This script helps you create spherical background panorama images ( aka equirectangular )

When panoramas of this type are applied on gigantic spheres

and your camera is inside that sphere, you get the illusion of being

at the same location this image was taken ( it's like Google Streetview and Quicktime VR )

══════════════════

History

══════════════════

--------------- initial release

28 june 2015 10:53 am - V2 fixed a bug

══════════════════

Installation

══════════════════

The script is in a zip package is found at the bottom of this page

unzip it in your daz content folder, typically

C:\Program Files\DAZ\Studio\content\

or

C:\Program Files (x86)\DAZ\Studio\content\

once installed, it will appear in your content library, under Studio / Scripts / mcasual

or

C:\Users\Public\Documents\My DAZ 3D Library\

once installed, it will appear in your content library, under My DAZ 3D Library / Scripts / mcasual

Pre-requisite 1 : imagemagick

You must install the imagemagick utilities ( just what they call the binaries ) on your PC

http://www.imagemagick.org/script/binary-releases.php

we only need the convert.exe and the montage.exe utilities

Personally i always install them in c:\imagemagick

but C:\Program Files\ImageMagick is also good

Then, at least once, you must run the mcjSphericalCam script

use the "Location of imagemagick" button

then browse to and select c:\imagemagick\convert.exe

pre-requisite 2 : mcjSqueeze

Actually this is optional, but the results are greatly improved if you install/use this

Install the mcjSqueeze.exe in the same folder where imagemagick's convert.exe utility is installed

══════════════════

Use

══════════════════

Create a camera, and select it. Make it your current view camera

While we're learning to use the script, preferable to set the Timeline's current frame to frame 0

Launch the script.

This script can animate the camera so that it scans the entire surface of an imaginary sphere around it

Usually you will set it up so that it covers the sphere in 72 camera poses ( 12 columns by 6 rows ) or 128 camera poses ( 16 columns by 8 rows )

For our example, set the "Horizontal tiles" slider to 12

The number of rows is always half of that: 6. So there will be 72 image tiles

Step 1 - Focus

This system only works if the focal length ( or field of vision ) is properly set up

You can use the "Auto Focal Length" button and the script will adjust your camera's focal length to an ideal focal length.

standard focal lengths are

Horizontal tiles : 16 ( 22.5 degrees )

Focal length at most : 83 mm.

FOV is 23.8121 degrees.

Horizontal tiles : 12 ( 30 degrees )

The focal length at most: 61 mm.

FOV 32.0148 degrees.

Step 2 - Animate the camera

"Click the "Animate Camera" button

The script created 72 poses for your camera ( starting at frame 0 if that's where you were )

Step 3 - Render your tiles

Exit the script

Render the 72 frames, as 72 images ( not as a movie file ), the only restriction is that the images must be square

if you use a rendered image size of 512 x 512 pixels

then the resulting panorama at the end of the process will be 12x6 x 512 x 512 ..... 6144 by 3072 pixels

Step 4 - stretch the tiles - Option A - Using mcjSqueeze ( Recommended )

Select your camera again

launch the script

( remember you were supposed to install mcjSqueeze in the same folder as imagemagic's convert utility )

click the "Create stretcher.bat" button

you will then be asked to select an image from your series of 72 renders

then you will be asked for the name to be given to your batch file

This batch file must be created in the same folder as the images

we suggest the name stretcher.bat

you can launch this batch file "manually" by double-left-clicking on it in Windows Explorer

or you can launch it by clicking the "Run Stretcher.bat" button

if your rendered images were named pic00.jpg, pic01.jpg ... pic71.jpg

then you will see 72 pictures appear in the same folder with the names

out_pic00.jpg, out_pic01.jpg ... out_pic71.jpg

The script with the help of the mcjSqueeze.exe utility, cropped and stretched just the useful areas of the rendered tiles

Step 4 - stretch the tiles - Option B - Using convert.exe ( not recommended )

this method uses an approximation of the tile shapes, the resulting mozaic is quite defective

click the "Create cropStretch.bat" button

you will then be asked to select an image from your series of 72 renders

then you will be asked for the name to be given to your batch file

This file must be created in the same disk folder as the images

we suggest the name cropstretch.bat

you can launch this batch file "manually" by double-left-clicking on it in Windows Explorer

or you can launch it by clicking the "Run CropStretch.bat" button

if your rendered images were named pic00.jpg, pic01.jpg ... pic71.jpg

then you will see 72 pictures appear in the same folder with the names

out_pic00.jpg, out_pic01.jpg ... out_pic71.jpg

The script with the help of the ImageMagick utility, cropped and stretched just the useful areas of the rendered tiles

Step 5 - Assemble the panorama-mosaic

Click the "Create montage.bat" button

you will then be asked to select an image from your series of 72 cropped and stretched images

the image out_pic00.jpg for example

then you will be asked for the name to be given to your batch file

This file must be created in the same disk folder as the images

we suggest the name montage.bat

you can launch montage.bat "manually" by double-left-clicking on it in Windows Explorer

or you can launch it by clicking the "Run montage.bat" button

and there should now be a big panoramic image in the folder !

Notes about mcjSqueeze.exe

( this section is for the not-yet-published version 3 of mcjSphericalCam )

You don't really need to know this, but FYI the command line format for mcjSqueeze is

mcjSqueeze.exe VSlices tileY FOV fileIn fileOut

ex:

set squeeze="c:/imagemagick/mcjSqueeze.exe"
%squeeze% 6 0 32.0148 datone.tga nuone.tga

VSlice: the number of vertical ( elevation) rows of image tiles for this spherical panorama

tileY : the row of the spherical panorama for this image-tile

FOV: the field of vision ( angle ) that was used to render this image tile

fileIn the image file name - only 24-bit uncompressed TGA images are acceptable

fileOut the processed image file name - 24-bit uncompressed TGA format

mcjSqueeze's delicate task is to crop the part of your rendered tile

that belongs to one of the mozaic's tiles and stretch it until it's a square

══════════════════

License

══════════════════

by mCasual/Jacques

You can use this script freely for personal or commercial use.

You may not sell, resell, sub-license or rent this script in any way./

you may credit this script to mCasual/Jacques

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,

INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR

PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE

FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,

ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.