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
Posted Dec 3, 2010, 12:11 p.m. EST Results & Visualization Version 4.3b, Version 4.4, Version 5.0, Version 5.1, Version 5.2 16 Replies
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....
Please login with a confirmed email address before reporting spam
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
did you get any solution to your camera problem?
thanks
peter
Please login with a confirmed email address before reporting spam
--
MSc. Acoustics using COMSOL for modelling loudspeakers and room acoustics.
no.linkedin.com/pub/tom-alexander-solg%C3%A5rd/27/600/1b3
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
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.
Please login with a confirmed email address before reporting spam
-------------------------------------------
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
-------------------------------------------
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
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
-------------------------------------------
Please login with a confirmed email address before reporting spam
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
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
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?
Please login with a confirmed email address before reporting spam
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
-------------------------------------------
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.
Suggested Content
- BLOG Zooming in on a Compact Camera Module Design with Simulation
- KNOWLEDGE BASE Reducing the amount of solution data stored in a model
- KNOWLEDGE BASE Resolving Time-Dependent Waves
- KNOWLEDGE BASE Controlling the Time Dependent Solver Timesteps
- FORUM Controling camera position in 3D animation output