Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Controling camera position in 3D animation output

Tom Alexander Solgård

Please login with a confirmed email address before reporting spam


Is it possible to control the camera angle in an exported animation?

It would be nice to have an animation with the camera circling around the geometry....


16 Replies Last Post Jul 20, 2017, 9:05 a.m. EDT
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Dec 4, 2010, 7:42 a.m. EST
Hi

Indeed, we have such nice features in our CAD but from my knowledge not (yet?) in Comsol, have you asked "support" ?

--
Good luck
Ivar
Hi Indeed, we have such nice features in our CAD but from my knowledge not (yet?) in Comsol, have you asked "support" ? -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 14, 2013, 8:00 a.m. EDT
hi tom,

did you get any solution to your camera problem?

thanks
peter
hi tom, did you get any solution to your camera problem? thanks peter

Tom Alexander Solgård

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 14, 2013, 6:14 p.m. EDT
I am not sure, since it's a while ago, but I don't think I was able to solve this. Maybe there are some new features, or maybe even a possibility of controlling it from Matlab, but I have not been Comsol active for a time, so I dont't, know...

--
MSc. Acoustics using COMSOL for modelling loudspeakers and room acoustics.
no.linkedin.com/pub/tom-alexander-solg%C3%A5rd/27/600/1b3
I am not sure, since it's a while ago, but I don't think I was able to solve this. Maybe there are some new features, or maybe even a possibility of controlling it from Matlab, but I have not been Comsol active for a time, so I dont't, know... -- MSc. Acoustics using COMSOL for modelling loudspeakers and room acoustics. http://no.linkedin.com/pub/tom-alexander-solg%C3%A5rd/27/600/1b3

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 15, 2013, 1:15 a.m. EDT
Hi Tom,

yesterday I found a solution (v4.3b): You can set camera x,y,z position under Views -> View 3D -> Camera. Such new view is saved with your model and you can use it later in plots. If you also set 'lock camera position', it will not change by rotating with mouse.

Best
Peter
Hi Tom, yesterday I found a solution (v4.3b): You can set camera x,y,z position under Views -> View 3D -> Camera. Such new view is saved with your model and you can use it later in plots. If you also set 'lock camera position', it will not change by rotating with mouse. Best Peter

Tom Alexander Solgård

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 15, 2013, 3:19 a.m. EDT
Nice!

Can you change it during the course of an animation? Can they be controlled by the API?

--
MSc. Acoustics using COMSOL for modelling loudspeakers and room acoustics.
no.linkedin.com/pub/tom-alexander-solg%C3%A5rd/27/600/1b3
Nice! Can you change it during the course of an animation? Can they be controlled by the API? -- MSc. Acoustics using COMSOL for modelling loudspeakers and room acoustics. http://no.linkedin.com/pub/tom-alexander-solg%C3%A5rd/27/600/1b3

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 15, 2013, 4:00 a.m. EDT

Can you change it during the course of an animation? Can they be controlled by the API?

Unfortunately, I didn't try that and have not time now.
[QUOTE] Can you change it during the course of an animation? Can they be controlled by the API? [/QUOTE] Unfortunately, I didn't try that and have not time now.

Ruud Borger COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 15, 2013, 5:21 a.m. EDT
It's absolutely possible to rotate or zoom in during an animation, you can use the Deformation feature for this. The document below provides a step-by-step instruction on how to do it as well as a few examples of the result:

-------------------------------------------
cds.comsol.com/mg/c525d0828bfcd3.zip
Estimated size: 93.5 MB
This link expires October 22, 2013. Please make sure to download before that date.

Included files:
- Deformation_animations_no_IP.part1.rar
-------------------------------------------
-------------------------------------------
cds.comsol.com/mg/7525d0781014bc.zip
Estimated size: 83.4 MB
This link expires October 22, 2013. Please make sure to download before that date.

Included files:
- Deformation_animations_no_IP.part2.rar
-------------------------------------------
It's absolutely possible to rotate or zoom in during an animation, you can use the Deformation feature for this. The document below provides a step-by-step instruction on how to do it as well as a few examples of the result: ------------------------------------------- http://cds.comsol.com/mg/c525d0828bfcd3.zip Estimated size: 93.5 MB This link expires October 22, 2013. Please make sure to download before that date. Included files: - Deformation_animations_no_IP.part1.rar ------------------------------------------- ------------------------------------------- http://cds.comsol.com/mg/7525d0781014bc.zip Estimated size: 83.4 MB This link expires October 22, 2013. Please make sure to download before that date. Included files: - Deformation_animations_no_IP.part2.rar -------------------------------------------

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 31, 2014, 9:55 a.m. EST
Hello

Did someone solved the problem of the camera circling around the geometry during an animation?

Best regards
Marcin
Hello Did someone solved the problem of the camera circling around the geometry during an animation? Best regards Marcin

Please login with a confirmed email address before reporting spam

Posted: 9 years ago Jun 11, 2015, 12:50 p.m. EDT
Hi, Could you upload the files again? Thanks!
Hi, Could you upload the files again? Thanks!

Please login with a confirmed email address before reporting spam

Posted: 9 years ago Aug 6, 2015, 10:23 p.m. EDT

It's absolutely possible to rotate or zoom in during an animation, you can use the Deformation feature for this. The document below provides a step-by-step instruction on how to do it as well as a few examples of the result:

-------------------------------------------
cds.comsol.com/mg/c525d0828bfcd3.zip
Estimated size: 93.5 MB
This link expires October 22, 2013. Please make sure to download before that date.

Included files:
- Deformation_animations_no_IP.part1.rar
-------------------------------------------
-------------------------------------------
cds.comsol.com/mg/7525d0781014bc.zip
Estimated size: 83.4 MB
This link expires October 22, 2013. Please make sure to download before that date.

Included files:
- Deformation_animations_no_IP.part2.rar
-------------------------------------------


Agree - could you please upload the files again ? I can't work out this feature with the provided information... Thanks

[QUOTE] It's absolutely possible to rotate or zoom in during an animation, you can use the Deformation feature for this. The document below provides a step-by-step instruction on how to do it as well as a few examples of the result: ------------------------------------------- http://cds.comsol.com/mg/c525d0828bfcd3.zip Estimated size: 93.5 MB This link expires October 22, 2013. Please make sure to download before that date. Included files: - Deformation_animations_no_IP.part1.rar ------------------------------------------- ------------------------------------------- http://cds.comsol.com/mg/7525d0781014bc.zip Estimated size: 83.4 MB This link expires October 22, 2013. Please make sure to download before that date. Included files: - Deformation_animations_no_IP.part2.rar ------------------------------------------- [/QUOTE] Agree - could you please upload the files again ? I can't work out this feature with the provided information... Thanks

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Aug 1, 2016, 6:38 a.m. EDT
Hi Ruud,

I hope you're well.

I remember you made some amazing and beautiful postprocessings and animations (moving camera during an animation). Could you please upload them again in a CDS file? I guess these are the same you uploaded previously in this thread.

Many thanks and best regards,

Sébastien
Hi Ruud, I hope you're well. I remember you made some amazing and beautiful postprocessings and animations (moving camera during an animation). Could you please upload them again in a CDS file? I guess these are the same you uploaded previously in this thread. Many thanks and best regards, Sébastien

Ruud Borger COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Aug 2, 2016, 8:58 a.m. EDT
Hi,

Sorry for the late reply.

I'm doing well Sébastien, thanks, I hope you are good too.

There is a much easier way to create these animations, see "Moving camera in animations_modified_no_IP_etc.pptx". In case the links are gone: if you "lock camera", then you can add a parameter in the camera settings and sweep over these values with a “result parameter”. This means that there is no need for a parametric sweep / transient study, nor any of the complicated expressions below. Note that this only works for exported animations, and not for the internal viewer. Note also that this works in COMSOL Multiphysics V4.x and V5.0-V5.2, but in V5.2a there are some technical complications that we're looking into. For V5.2a, you can use the Deformations-based method.

In case the links are gone: the Deformations-based method is an advanced feature. You can give the impression of a camera rotation/translation by moving geometric entities with the Deformation feature. Use a Rotation Matrix as expression in deformation fields. You have to substract “x” from the x-direction and “y“ from y-direction because the expression pertains to deformation, not transformation. Don’t forget to lock “Scale factor” to “1”. In its simplest form this looks like:
x-deformation = (x-xref)*cos(t)-(y-yref)*sin(t)-(x-xref)
y-deformation = (x-xref)*sin(t)+(y-yref)*cos(t)-(y-yref)
Where "t" is used as "dummy" parameter, the plus/minus signs depend on chirality, and xref & yref refer to the center of rotation.

Furthermore, you can add a speed factor inside the sin/cos; you can ramp up the speed; you can zoom; combine all of these, etc etc.

-------------------------------------------
cds.comsol.com/mg/257a08f23627b7.zip
Estimated size: 57.2 MB
This link expires August 9, 2016. Please make sure to download before that date.

Included files:
- Deformation animations_no_IP_etc2.pptx
- Moving camera in animations_modified_no_IP_etc.pptx
-------------------------------------------

Hi, Sorry for the late reply. I'm doing well Sébastien, thanks, I hope you are good too. There is a much easier way to create these animations, see "Moving camera in animations_modified_no_IP_etc.pptx". In case the links are gone: if you "lock camera", then you can add a parameter in the camera settings and sweep over these values with a “result parameter”. This means that there is no need for a parametric sweep / transient study, nor any of the complicated expressions below. Note that this only works for exported animations, and not for the internal viewer. Note also that this works in COMSOL Multiphysics V4.x and V5.0-V5.2, but in V5.2a there are some technical complications that we're looking into. For V5.2a, you can use the Deformations-based method. In case the links are gone: the Deformations-based method is an advanced feature. You can give the impression of a camera rotation/translation by moving geometric entities with the Deformation feature. Use a Rotation Matrix as expression in deformation fields. You have to substract “x” from the x-direction and “y“ from y-direction because the expression pertains to deformation, not transformation. Don’t forget to lock “Scale factor” to “1”. In its simplest form this looks like: x-deformation = (x-xref)*cos(t)-(y-yref)*sin(t)-(x-xref) y-deformation = (x-xref)*sin(t)+(y-yref)*cos(t)-(y-yref) Where "t" is used as "dummy" parameter, the plus/minus signs depend on chirality, and xref & yref refer to the center of rotation. Furthermore, you can add a speed factor inside the sin/cos; you can ramp up the speed; you can zoom; combine all of these, etc etc. ------------------------------------------- http://cds.comsol.com/mg/257a08f23627b7.zip Estimated size: 57.2 MB This link expires August 9, 2016. Please make sure to download before that date. Included files: - Deformation animations_no_IP_etc2.pptx - Moving camera in animations_modified_no_IP_etc.pptx -------------------------------------------

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Aug 3, 2016, 4:17 a.m. EDT
Hi Ruud,

thanks a lot for these files and tips. I look forward to creating soon astonishing dynamic rendering!

Have a nice day!

Best regards,
Sébastien
Hi Ruud, thanks a lot for these files and tips. I look forward to creating soon astonishing dynamic rendering! Have a nice day! Best regards, Sébastien

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Sep 19, 2016, 2:57 p.m. EDT
Hi Ruud,

Is it possible to make these files available again? I've played with your transformation ins 5.2a and haven't had much success.

Thanks Much!

CJ
Hi Ruud, Is it possible to make these files available again? I've played with your transformation ins 5.2a and haven't had much success. Thanks Much! CJ

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Jul 18, 2017, 10:07 a.m. EDT

Hi,

Sorry for the late reply.

I'm doing well Sébastien, thanks, I hope you are good too.

There is a much easier way to create these animations, see "Moving camera in animations_modified_no_IP_etc.pptx". In case the links are gone: if you "lock camera", then you can add a parameter in the camera settings and sweep over these values with a “result parameter”. This means that there is no need for a parametric sweep / transient study, nor any of the complicated expressions below. Note that this only works for exported animations, and not for the internal viewer. Note also that this works in COMSOL Multiphysics V4.x and V5.0-V5.2, but in V5.2a there are some technical complications that we're looking into. For V5.2a, you can use the Deformations-based method.

In case the links are gone: the Deformations-based method is an advanced feature. You can give the impression of a camera rotation/translation by moving geometric entities with the Deformation feature. Use a Rotation Matrix as expression in deformation fields. You have to substract “x” from the x-direction and “y“ from y-direction because the expression pertains to deformation, not transformation. Don’t forget to lock “Scale factor” to “1”. In its simplest form this looks like:
x-deformation = (x-xref)*cos(t)-(y-yref)*sin(t)-(x-xref)
y-deformation = (x-xref)*sin(t)+(y-yref)*cos(t)-(y-yref)
Where "t" is used as "dummy" parameter, the plus/minus signs depend on chirality, and xref & yref refer to the center of rotation.

Furthermore, you can add a speed factor inside the sin/cos; you can ramp up the speed; you can zoom; combine all of these, etc etc.

-------------------------------------------
cds.comsol.com/mg/257a08f23627b7.zip
Estimated size: 57.2 MB
This link expires August 9, 2016. Please make sure to download before that date.

Included files:
- Deformation animations_no_IP_etc2.pptx
- Moving camera in animations_modified_no_IP_etc.pptx
-------------------------------------------


Could you please make the files available again?

[QUOTE] Hi, Sorry for the late reply. I'm doing well Sébastien, thanks, I hope you are good too. There is a much easier way to create these animations, see "Moving camera in animations_modified_no_IP_etc.pptx". In case the links are gone: if you "lock camera", then you can add a parameter in the camera settings and sweep over these values with a “result parameter”. This means that there is no need for a parametric sweep / transient study, nor any of the complicated expressions below. Note that this only works for exported animations, and not for the internal viewer. Note also that this works in COMSOL Multiphysics V4.x and V5.0-V5.2, but in V5.2a there are some technical complications that we're looking into. For V5.2a, you can use the Deformations-based method. In case the links are gone: the Deformations-based method is an advanced feature. You can give the impression of a camera rotation/translation by moving geometric entities with the Deformation feature. Use a Rotation Matrix as expression in deformation fields. You have to substract “x” from the x-direction and “y“ from y-direction because the expression pertains to deformation, not transformation. Don’t forget to lock “Scale factor” to “1”. In its simplest form this looks like: x-deformation = (x-xref)*cos(t)-(y-yref)*sin(t)-(x-xref) y-deformation = (x-xref)*sin(t)+(y-yref)*cos(t)-(y-yref) Where "t" is used as "dummy" parameter, the plus/minus signs depend on chirality, and xref & yref refer to the center of rotation. Furthermore, you can add a speed factor inside the sin/cos; you can ramp up the speed; you can zoom; combine all of these, etc etc. ------------------------------------------- http://cds.comsol.com/mg/257a08f23627b7.zip Estimated size: 57.2 MB This link expires August 9, 2016. Please make sure to download before that date. Included files: - Deformation animations_no_IP_etc2.pptx - Moving camera in animations_modified_no_IP_etc.pptx ------------------------------------------- [/QUOTE] Could you please make the files available again?

Ruud Borger COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Jul 20, 2017, 9:05 a.m. EDT
Thanks everyone for the response. It's good to know this topic is of interest; we use your feedback to determine what to prioritize in our software development.

To my knowledge, there are currently three methods to create animations with a moving camera.

Option 1:
By parametrizing the camera settings and checking "Lock camera", you can quite easily create such an animation if you export to a file. This works in COMSOL Multiphysics V4.x to V5.2. In V5.2a and V5.3, this technique no longer works due to a new feature that we introduced. We're investigating how to fix this in a reliable way.

Option 2:
Since COMSOL Multiphysics V5.3, we've introduced Model Methods. This is a powerful new feature which allows you to execute a series of COMSOL operations using Java. Details on Model Methods can be found in the manual; an overview is available here: www.comsol.com/blogs/how-to-use-model-methods-to-accelerate-your-comsol-workflow/
In this case, all you need is a for-loop that changes the camera position and exports the image. You can use a third party tool to convert the resulting series of images into an animation. An example would be VirtualDub, which is a free and open-source (GNU General Public License) video capture and processing tool. I'm attaching a model with a method to zoom and rotate the view. You can run the method via the "Developer" tab, and explore or change it via the Application Builder by going to "Methods".

Option 3:
Using the "Deformation" feature in plots, as mentioned earlier in this thread. This doesn't move the camera, but moves the object to create the same visual impression. I would say this is the least user-friendly way to do it. I'm attaching a small version of the Powerpoint file with intructions, in which the example animations are removed. Notice that the content is outdated in many respects: the GUI screenshots, the design, and some techniques that are easier now.

I hope this helps.

-------------------------------------------
cds.comsol.com/mg/a5970a88aee044.zip
Estimated size: 9.7 MB
This link expires July 27, 2017. Please make sure to download before that date.

Included files:
- Deformation animations_small.pptx
- Rotating_busbar_HD.avi
- busbar_camera_movement.mph
-------------------------------------------
Thanks everyone for the response. It's good to know this topic is of interest; we use your feedback to determine what to prioritize in our software development. To my knowledge, there are currently three methods to create animations with a moving camera. Option 1: By parametrizing the camera settings and checking "Lock camera", you can quite easily create such an animation if you export to a file. This works in COMSOL Multiphysics V4.x to V5.2. In V5.2a and V5.3, this technique no longer works due to a new feature that we introduced. We're investigating how to fix this in a reliable way. Option 2: Since COMSOL Multiphysics V5.3, we've introduced Model Methods. This is a powerful new feature which allows you to execute a series of COMSOL operations using Java. Details on Model Methods can be found in the manual; an overview is available here: https://www.comsol.com/blogs/how-to-use-model-methods-to-accelerate-your-comsol-workflow/ In this case, all you need is a for-loop that changes the camera position and exports the image. You can use a third party tool to convert the resulting series of images into an animation. An example would be VirtualDub, which is a free and open-source (GNU General Public License) video capture and processing tool. I'm attaching a model with a method to zoom and rotate the view. You can run the method via the "Developer" tab, and explore or change it via the Application Builder by going to "Methods". Option 3: Using the "Deformation" feature in plots, as mentioned earlier in this thread. This doesn't move the camera, but moves the object to create the same visual impression. I would say this is the least user-friendly way to do it. I'm attaching a small version of the Powerpoint file with intructions, in which the example animations are removed. Notice that the content is outdated in many respects: the GUI screenshots, the design, and some techniques that are easier now. I hope this helps. ------------------------------------------- http://cds.comsol.com/mg/a5970a88aee044.zip Estimated size: 9.7 MB This link expires July 27, 2017. Please make sure to download before that date. Included files: - Deformation animations_small.pptx - Rotating_busbar_HD.avi - busbar_camera_movement.mph -------------------------------------------

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.