How do I create a scrolling background in Simulink 3D Animation?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I'm modelling a vehicle, moving in space, and I want to communicate that it is actually moving. The vehicle is moving at a constant velocity plus a sinusoid superimposed on top.
Currently, I'm moving my viewpoint at the constant velocity of the vehicle, such that in the virtual world viewer I can see the vehicle surging back and forth, but it's not actually making any net progress forward (I'm doing this instead of using a fixed viewpoint, because it allows me to be much more zoomed in).
To communicate this forward motion, I was hoping to have the background be moving relative to the vehicle. I added a background node, and selected a picture with a grid on it. However, when I run my simulation, despite the fact the the viewpoint is translating in space, the background stays fixed, and thus does not communicate any net movement.
Does anyone have any ideas of how to accomplish what I'm trying to do?--I have also tried including a whole bunch of lines (as extrusion nodes), which was wildly cumbersome and they ended up flickering so much that they detracted more than they added.
1 commentaire
Réponses (1)
Jan
le 15 Avr 2014
Hi Nathan,
In order to fix such behaviours, it is important to know the hierarchy of your VRML model.
There is one important rule - VRML objects (nodes) move together with their parent nodes. If you modelled your background as a child node of your car / Transform that contains your viewpoint, there won't be any relative movement between the two. You need to define object and background as 2 independent objects. See also "Assembly hierarchy" here:
On the other hand, if you defined Background as a VRML Background, you also wouldn't notice relative movement between the two - VRML background is placed at the infinity, and movement against a very distant object is negligible.
Comment to your vehicle href = ""</a> viewpoint relation. Here it is desirable that Viewpoint is inside the vehicle hierarchy - you don't have to move it independently, it just "sits" on the car where you define it. Look at the vr_octavia example for placement of various static and dynamic viewpoints.
Best Regards,
Jan
0 commentaires
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!