IMAX-like 3d rendering

 Hi there,

 I'm trying to write a script that would automate the creation of separate images for each eye.

 I know I could write a script that would do this:

  • make a copy of the current camera
  • move it left
  • call render()
  • move it right
  • call render()
  • discard the copy of the camera and proceed to the next frame

 But it would be very nice to make it as a "rendering effect", which seems imposible to me due to the fact that I want to change geometry or call a second render() inside some kinf od pipeline thus messing it up.

 Is there a nice way to do this?

 If it would be a macro-like script the odds (well, my lack of knowledge) would be:

  • no Idea how to store settings (plugin-like scripts have the "parameters" which are saved) - someone would like to animate the distance of the eyes or other params
  • the rendering dialog has so many parameters like output formats etc. - I would have to give these parameters to the render() function thus I had to make a similar dialog (sounds stupid enough!)

 In the end the output should be (per frame): Two images (all the stuff (effects etc.) in the rendering dialog token in account) - one for each eye - placed side by side in one frame (so the width would be double) ...no trouble with output formats - no other support needed (special file-format etc.).

 Could someone give me guidance?

 I'm a student trying to make something useful Innocent
so thanx a lot for anything!

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jefftj86's picture

Interesting. I was actually

Interesting. I was actually looking for something similar to this as well a few months ago for testing but I never continued to persue it. I will try this out.

mike.edel's picture

you might want to have a

you might want to have a look at Harald A. Blab's XidMary plugin

it implements a stereo camera (i guess that's what you're after)

you'll get a single camera object that allows you to set the eye seperation (important factor to the final 3d effect) and animate just one object while having the animation applied to both stereo cameras

http://www.habware.at/max6/XidMary6.zip

in case you need it for something different than max6:

http://www.habware.at/ente.htm

it's in german, but after you choose the appropriate version you'll end up on an english page.

 

cheers,

mike

BayerMeister's picture

 That is really inspiring,

 That is really inspiring, but uses another approach.

 My goal is to make a scripted plugin/macro that would not require the use of a special camera object. It should be usable on a ready-to-render scene. It would move the camera left (by a defined amount just like in the Harald A. Blab's plugin) and take a snap, then right and take another snap, then compose these images into an interlaced (or top/bottom or left/right) image and store to the output frame. All that in a per-frame manner so no changes would have to be made to other parts of 3dsMAX or the scene. The only params would be the distance of the "eyes" and maybe some convergency. If it could be a plugin allowing to animate and save it's parameters into the .max file, that would be great!

 Now the thing that would help me would be a nice person telling me about the possibility to do this as a rendering effect - I listed the problems I saw comming in the main contribution. Well, general advice would helpful as well.

 The last thing I want to do is (as I wrote) to make my own rendering dialog doing just the same as the standard rendering dialog (all the configuration possibilities!) but allowing to split the selected camera in twain. I'm affraid I'd make it different (worse) leaving out important stuff. Well, somehow hooking into the default rendering dialog would be useful too, but I can't imagine how using MAXScript :)

 Ok thanks to any reply, thanks mike, that gave a clue :)

 Richard (BayerMeister) 

mike.edel's picture

creation/destruction of a


creation/destruction of a custom camera followed by a single frame render would probably be extremely inefficient - there is a lot of preprocessing/collecting data/etc involved in starting a render

at least you should create the temporary cameras once, then render the animation and delete them afterwards

besides: you still could position the xidmary camera at the position of your original camera and link it (using maxscript, even) in order to use exisiting scenes 

BayerMeister's picture

Quite a time passed since

Quite a time passed since since I've written for the last time. Meanwhile I've finished the project and met the given specifications.

To mike.edel: Thanks a lot for your post. Someone asked me, if the rendering speed had something to do with my part of the work, or if it is just as fast as the renderer it uses underneath. I replied there were no big computations on my part. But I believe you are right! The first frame takes longer to render than the next one - no question about it - there must be much initialization stuff. But how could I change geometry while not stopping the renderer?

This is how it's done (just briefly) :

------
create an output file called "F" (AVI)
for each frame
{
make 2 copies of the camera
move them - one left, one right
call render on both cameras
store the output bitmaps into "F"
delete the cameras
}
close the output file
------------

Well, I can not imagine how to ... well. I could...
Did you mean to create the cameras at the beginning, calculate their position for each frame and then call render for the whole range?

A good idea! Mine or yours ;)

I'm curious about the difference in speed!

Thanks a lot so far. And I'll be grateful for more such background stuff.

...well, but I made a composition of both frames into one so far. I will have to do that after the whole rendering, right? Both cameras will have an AVI output and the composition will be done after the whole thing...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.