Announcement

Collapse
No announcement yet.

Panographies-collage workaround

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Panographies-collage workaround

    Hi,

    Do you know some script or easy workaround for doing a panography with renderings (and not with photographs)??

    Something like this (or the attached one) http://www.flickr.com/photos/pedro_angelini/260405805/

    I guess i could do simply by moving/tilting the camera and changing exposures...then stitch in photoshop....

    Another way could be starting with one unique render and cutting, rotating...etc

    Click image for larger version

Name:	collagemiralles2.jpg
Views:	1
Size:	501.1 KB
ID:	873176
    Last edited by peprgb; 26-07-2011, 12:48 PM.

  • #2
    Go to your camera settings and turn you FOV to 360, if I understand you correctly,
    Bobby Parker
    www.bobby-parker.com
    e-mail: info@bobby-parker.com
    phone: 2188206812

    My current hardware setup:
    • Ryzen 9 5900x CPU
    • 128gb Vengeance RGB Pro RAM
    • NVIDIA GeForce RTX 4090
    • ​Windows 11 Pro

    Comment


    • #3
      Mmmm no, this is not what i am looking for, see the attached image...

      Thanks,

      Comment


      • #4
        You can get an effect like that with scripting. Here's a quick attempt...

        Click image for larger version

Name:	Panograph.jpg
Views:	1
Size:	111.8 KB
ID:	844303

        Code:
        /*
        Panography Tool V0.5
        Dan Brew 2011
        */
        global PTool
        
        
        try (destroyDialog PTool) catch ()
        
        
        rollout PTool "Panograph Tool 0.5" width:230 height:360
        ( --Start Rollout
        	local xShots = 5
        	local yShots = 4
        	local oLap = 50
        	local vVar = 50
        	local eVar = 20
        	local rVar = 2
        	local whiteB1 = color 200 200 200
        	local whiteB2 = color 255 255 255
        	local RAm = 30
        	local vpCam
        	local vImg = bitmap 200 120 color:black
        	local GridBmp = bitmap 200 120 color:black
        	
        	on PTool open do
        		(
        			callbacks.addScript #viewportChange "PTool.testView()" id:#PToolcb
        			PTool.testView()
        			PTool.panoGrid()
        		)
        		
        	on PTool close do
        		(
        			callbacks.removeScripts id:#PToolcb
        			PTool = undefined
        			gc light:true
        		)
        		
        	fn testView =
        	(
        		PTool.vpCam = getActiveCamera()
        		if isKindof vpCam VRayPhysicalCamera 
        		then PTool.activateRO ()
        		else PTool.deactivateRO ()
        	)
        	
        	fn activateRO =
        	(
        		PTool.camView.bitmap = gw.getViewportDib()
        		PTool.pickVP.visible = false
        		PTool.spinX.enabled = PTool.spinY.enabled = PTool.spinO.enabled = PTool.spinV.enabled = PTool.spinE.enabled = PTool.spinR.enabled = PTool.WB1.enabled = PTool.WB2.enabled = PTool.cPano.enabled = PTool.cbAR.enabled = PTool.spinRA.enabled= true
        	)
        	
        	fn deactivateRO =
        	(
        		PTool.camView.bitmap = bitmap 200 120 color:black
        		PTool.pickVP.visible = true
        		PTool.spinX.enabled = PTool.spinY.enabled = PTool.spinO.enabled = PTool.spinV.enabled = PTool.spinE.enabled = PTool.spinR.enabled = PTool.WB1.enabled = PTool.WB2.enabled = PTool.cPano.enabled = PTool.cbAR.enabled = PTool.spinRA.enabled= false
        	)
        	
        	
        	fn copyCamera oldCam =
        	(
        		maxOps.cloneNodes oldCam expandHierarchy:false cloneType:#copy newNodes:&newCamA
        		newCamA[1]
        	)
        	
        	fn panoGrid =
        	(
        		tileImg = bricks name:"PanoGrid Tile" Brick_Type:5 Brick_Color:[0,0,0] Mortar_Color:[220,220,220] Horizontal_Count:xShots Vertical_Count:yShots Color_Variance:0 Fade_Variance:0 Horizontal_Gap:0.4
        		PTool.gridView.bitmap = renderMap tileImg size:[200,120] filter:true
        	)
        	
        	fn setFOV cam f = -- borrowed from Vlado's post 09-09-2010
        	(
        		local left=0.001
        		local right=100
        		local middle=(left+right)*0.5
        		cam.focal_length=middle
        		redrawViews()
        		local curFov=getViewFOV()
        		for cycle = 1 to 15 do
        			(
        				if (f>curFov)
        					then right=middle
        					else left=middle
        				middle=(left+right)*0.5
        				cam.focal_length=middle
        				redrawViews()
        				curFov=getViewFOV()
        			)
        	)-- end fn setFOV
        	
        	fn autoRoll xOff yOff =
        	(
        		xOff * yOff * PTool.RAm
        	)
        
        
        	fn makePano =
        	(
        		local panoCam = copyCamera PTool.vpCam
        		local pcShutter = panoCam.shutter_speed
        		local pcVignetting = panoCam.vignetting_amount
        		local tm = 1
        		panoCam.targeted = false
        		panoCam.transform.controller = prs()
        		panoCam.exposure = true
        		panoCam.vignetting = true
        		panoCam.horizontal_offset.controller = bezier_float()
        		panoCam.vertical_offset.controller = bezier_float()
        		panoCam.vignetting_amount.controller = bezier_float()
        		panoCam.shutter_speed.controller = bezier_float()
        		panoCam.whiteBalance.controller = bezier_color()
        		panoCam.rotation.controller = euler_xyz()
        		
        		animate on
        		(
        			addNewKey panoCam.horizontal_offset.controller 0
        			addNewKey panoCam.vertical_offset.controller 0
        			addNewKey panoCam.vignetting_amount.controller 0
        			addNewKey panoCam.shutter_speed.controller 0
        			addNewKey panoCam.whiteBalance.controller 0
        			addNewKey panoCam.rotation.controller 0
        		)
        		
        		local vpFOV = getViewFOV()
        		viewport.setCamera panoCam 
        		local pcFOV = (vpFOV/PTool.xShots) + ((PTool.oLap/50) * (vpFOV/PTool.xShots))
        		setFOV panoCam pcFOV
        		Select panoCam
        		
        		for yShot = 1 to PTool.yShots do
        		(
        			local yOffset = (yShot * 0.5) - ((yShots * 0.25) +0.25)
        			for xShot = 1 to PTool.xShots do
        			(
        				animate on
        				(
        					at time tm
        					(
        						local aRoll
        						local xOffset = (xShot * 0.5) - ((xShots * 0.25) +0.25)
        						panoCam.horizontal_offset = xOffset
        						panoCam.vertical_offset = yOffset
        						panoCam.vignetting_amount = random (pcVignetting - (pcVignetting * (PTool.vVar*0.01))) (pcVignetting + (pcVignetting * (PTool.vVar*0.01)))
        						panoCam.shutter_speed = random (pcShutter - (pcShutter * (PTool.eVar*0.01))) (pcShutter + (pcShutter * (PTool.eVar*0.01)))
        						panoCam.whiteBalance = random PTool.whiteB1 PTool.whiteB2
        						local rRoll = random (0- PTool.rVar) PTool.rVar
        						if PTool.cbAR.checked == true then aRoll = (xOffset * yOffset * PTool.RAm) else aRoll = 0
        						local rRot = eulerangles 0 0 (rRoll + aRoll)
        						in coordsys local rotate panoCam rRot
        					)
        					tm +=1
        					at time tm
        					(
        						local invrRot = eulerangles 0 0 (0 - (rRoll + aRoll))
        						in coordsys local rotate panoCam invrRot
        					)
        				)--end animate
        			)--end xShot loop
        		)--end yShot loop
        	)--end fn makePano
        		
        	groupBox Dimensions "Dimensions:" pos:[5,3] width:220 height:190
        		imgTag camView  pos:[15,20] style:#bmp_stretch bitmap:vImg
        		imgTag gridView  pos:[15,20] style:#bmp_stretch bitmap:gridBmp
        		edittext pickVP text:"Select Camera Viewport!" pos:[40,70] readOnly:true width:130
        		spinner spinX "Columns:" pos:[60,150] width:60 height:16 range:[0,20,xShots] type:#integer
        		spinner spinY "Rows:" pos:[155,150] width:60 height:16 range:[0,20,yShots] type:#integer
        		spinner spinO "Overlap %:" pos:[151,172] width:63 height:16 range:[0,100,oLap] type:#integer
        	groupBox Variance "Variance:" pos:[5,195] width:220 height:135
        		spinner spinV "Vignetting %:" pos:[55,210] width:60 height:16 range:[0,100,vVar] type:#integer
        		spinner spinE "Shutter %:" pos:[155,210] width:60 height:16 range:[0,100,eVar] type:#integer
        		spinner spinR "Camera Roll + or - deg:" pos:[135,232] width:80 height:16 range:[0,90,rVar] type:#float
        		checkbox cbAR "Auto Roll Camera" pos:[15,254]
        		spinner spinRA "deg:" pos:[165,254] width:50 height:16 range:[0,45,RAm] type:#float
        		groupBox WB "White Balance:" pos:[10,275] width:210 height:50
        			colorpicker WB1 "From:" pos:[25,295] color:whiteB1 alpha:false fieldWidth:60 height:20 modal:false
        			colorpicker WB2 "To:" pos:[125,295] color:whiteB2 alpha:false fieldWidth:60 height:20 modal:false
        	button cPano "Create Panograph Camera" pos:[5,335] width:220
        	
        	on spinX changed xval do
        	(
        		xShots = xval
        		panoGrid()
        	)
        	on spinY changed yval do 
        	(
        		yShots = yval
        		panoGrid()
        	)
        	on spinO changed oval do oLap = oval
        	on spinV changed vval do vVar = vval
        	on spinE changed eval do eVar = eval
        	on spinR changed rval do rVar = rval
        	on WB1 changed newWB1 do whiteB1 = newWB1
        	on WB2 changed newWB2 do whiteB2 = newWB2
        	on spinRA changed raVal do RAm = raVal
        	on cPano pressed do makePano()
        )--end rollout
        
        
        createDialog Ptool
        Last edited by DanielBrew; 25-08-2011, 03:21 AM. Reason: updated the script to v0.5
        Dan Brew

        Comment


        • #5
          This is very cool!! could you explain a bit how to use it? I tried without luck, when i run the script the Camera's target is Detached from the camera (marked with green circle) and the view is changed.

          Thanks!!

          Click image for larger version

Name:	pano_script.jpg
Views:	1
Size:	32.2 KB
ID:	844304

          Comment


          • #6
            Sorry I didn't have much time yesterday when I replied but I'll try to go through a few points now. The script I posted isn't a finished tool, it's little more than a proof of concept really. However you should be able to get it to work with a bit of help.

            I have updated the script in my earlier post because it didn't work with targeted cameras (as you found) and it now makes a copy of the camera you select so you don't lose your original camera settings. It works by animating the horizontal and vertical offset and roll of the camera over the next 20 frames. It also randomly varies the white balance, shutter speed and vignetting slightly.

            So the steps the use the script are:
            1. Pick a VRay camera.
            2. Run the script.
            3. Change the camera viewport to the new camera.
            4. Render frames 1 to 20 from the new camera. (400 x 300 px should be ok.)
            5. Open the rendered frames in photoshop (or similar).
            6. In photoshop create a new image (Something like 2000 x 1500 px) and copy and paste the frames as new layers into the new image. The frames are rotated slightly so you need to rotate them back so they line up correctly. The amount you need to rotate them is the camera Y rotation for that frame. If you select the camera and move the time slider you can see this in the transform type-in box in Max.

            Don't be put off by what appears in viewport, there is a bug in VRay that means what you see in the viewport isn't what is rendered when you change the H & V offsets. See here:
            http://www.chaosgroup.com/forums/vbu...izontal+offset
            Last edited by DanielBrew; 29-07-2011, 03:54 AM.
            Dan Brew

            Comment


            • #7
              Well what can i say, thank you very very much for your help!! is working really cool now...this is a quick test without using all the frames. What i like of using this technique is the ability to focus in the subject you consider important (rather than giving a "generic impersonal rectangle frame"), judiciously, like this shot.

              Will play with this tool a lot, thanks again!!

              EDITED: Second one using Photomerge from photoshop, he did not like frames from 16-20 (were ignored from the comp.)

              Click image for larger version

Name:	panog_test.jpg
Views:	1
Size:	325.8 KB
ID:	844309

              Click image for larger version

Name:	panog_test_1.jpg
Views:	1
Size:	403.0 KB
ID:	844311
              Last edited by peprgb; 29-07-2011, 05:40 AM. Reason: added new image

              Comment


              • #8
                Glad you got it working and there's no need to thank me I didn't write it just for you .

                It really needs a GUI, if I have time will add one next week. In the mean time, there are some variables in the script that you could try changing. At the moment it makes 20 images in a 5 x 4 array. This is controlled be the lines:
                Code:
                local [FONT=monospace]xShots = 5
                local yShots = 4[/FONT]
                So if you want more images you just need to change these.
                You could also change the focal length (and therefore the field of view) with
                Code:
                [FONT=monospace]UserCam.focal_length = 80[/FONT]
                Increasing this will make the rendered frames zoom in more.

                You probably worked all that out for yourself anyway....

                Btw, thanks for the tip using photomerge, it took me about 20 minutes to put my image together.
                Dan Brew

                Comment


                • #9
                  A GUI woul be really nice!! thanks for pointing the variables, will play with these....

                  Yep, the Photomerge is a great "discovery"...

                  Will look forward into the thread,

                  Regards,

                  Comment


                  • #10
                    I've added a GUI if anyone is still interested in this.


                    I haven't tested it thoroughly so if you have any problems let me know and I'll try to fix them.
                    Attached Files
                    Dan Brew

                    Comment


                    • #11
                      Thanks Daniel, it's looking really nice!!

                      Comment


                      • #12
                        very cool indeed... I didnt see the gui download or script... I would love to play with that as well.

                        Photomerge!!! Yes... I cant believe I was scanning hand drawn site plans and then PIECING them together without Photomerge...
                        Eric Camper
                        Studio 3D
                        www.dbfinc.com/studio3d

                        Comment


                        • #13
                          Thanks, I'm a bit snowed under at work at the moment so I didn't have time to post any instructions for using the new version. It should be quite straightforward though. The main changes are:
                          1. The preview - but only meant to be a rough guide to the what the final output will be.
                          2. Added Auto Roll Camera - rolls the camera more in the corner images.

                          Anyway give it a try and if you find any bugs let me know.
                          Dan Brew

                          Comment


                          • #14
                            I am having force closes every time i try to use the script , after creating the frames no matter what i do (click "X" icon to exit script...etc) Max is freezed.

                            Could you please post the previous 0.1 and/or 0.2 versions? will test these for a real arch. school project

                            Thanks!!

                            Comment


                            • #15
                              Here's the 0.2 version.

                              What version of Max are you using? I've tested it here on 2010, 2011 and 2012 and can't reproduce the problem.
                              Attached Files
                              Dan Brew

                              Comment

                              Working...
                              X