usnistgov / NetSimulyzer

A flexible 3D visualizer for displaying, debugging, presenting, and understanding ns-3 scenarios.
Other
34 stars 8 forks source link

Another very very interesting option to add #37

Open igs3000 opened 2 years ago

igs3000 commented 2 years ago

Hello Evan,

I already mentioned moving the camera using mouse.

There is a very, very interesting option to consider here:

NetSumulyzer already can show the camera view from the point of the node on a single mouse click on the node list. How about making the camera to continuously travel along with that node.

It may be little bit CPU intensive, but the viewer will have an excellent experience.

On a VENET scenario, we can have the experience of travelling in a simulated car. In FANET scenario, we have the feeling of being inside the cockpit of an airplane. In UWSN scenario, we will be having the experience of a diver who will be swimming along with a fish or riding on a dolphin.

Please think about it. It may be very easy to implement (since you're already having such option to select camera angle from a node - now we only need to update the camera position and angle with respect to the movement of the node).

It will be a wonderful option for a 3D visualization tool.

Sorry if I am posting too much feature requests - all my wish is to have a state-of-the-art 3D visualization tool for ns-3 simulator - that's all.

bpe2 commented 2 years ago

Hey Charles,

Yeah, I agree; I think something like that would be useful. I don't think it would be that CPU intensive either since it'd be about 1-2 arithmetic operations per move.

My only hang-up with this would be how would the user indicate which Node to follow? I could add an element to the UI or just automatically follow the last Node we jumped to. I'm not so sure. Another potential concern would be how closely we should follow the Node. The current offset is a fixed 5 units from the model. I wonder if this should be configurable or not.

Also, don't worry about submitting too many feature requests. I'm just pleased you're invested enough to do so.

igs3000 commented 2 years ago

Hello Evan,

I am having a suggestion for selecting a node on the existing node list itself. image

You may just add a checkbox at the top with the label like "Move Camera Along with the Node".

So, if we check the box and then select the node, then it will move the camera along with the node. (on the other hand, if we select the node without checking the checkbox, then it will behave normally).

I am having a few more suggestions in this regard. It is not about "how closely we should follow the Node" - it is about travelling on or even inside the node itself. For your information, I already experimented with moving inside a hollow model - I think, it will work (even if there will be some changes in disabling/changing the offset, it will be worth the experience that we will have at the end).

The important one is: where we are exactly going to place the camera, (on the node?, below the node? or even inside the node?) - we have to set the orientation of the camera XYZ position with respect to the position and orientation of the node. So that, in a VENET scenario, we can have the experience of viewing the outside world while travelling inside a simulated car (through its window). In FANET scenario, we have the feeling of being inside the cockpit of an aeroplane. In UWSN scenario, we will be having the experience of a diver who will be swimming along with a fish or riding on a dolphin.

(for your information, I am also exploring the code and trying to implement a feature like this - or at least to understand the way in which you are handling things at different levels of abstraction )

Simply fixing the camera position and orientation w.r.t the node will do real wonders.

In future, even we may add the "decoration" objects along with the node list - so that we can fix the camera with respect to the position of the "inactive" "decoration" node. Even we may add some controls on that form itself to manipulate camera position with respect to the node. If we do this, we can have a view from the top of the building or even from the top of a cell phone tower. Possibilities are endless. We may try to incorporate them one by one. Of course, we will face some practical difficulties while implementing this feature. But, theoretically, it seems possible and sounds good.

Charles Pandian

igs3000 commented 2 years ago

So, from the end of the function of SceneWidget::focusNode(uint32_t nodeId) of SceneWidget.cc we have to pass some information to the "node position update loop" (where is it?) and set camera location recursively w.r.t the location of that node in that loop until another node is selected from the UI. is it correct?