Amerio.Stephane Posted October 9, 2019 Share Posted October 9, 2019 Hello, For a flight replay/analysis, we need to draw the flight path of an entity, like this: The entity would most likely be sent via CIGI, but DIS is also a possibility. The behavior of the trace is to leave a trail behind the entity for a certain amount of time and draw vertical lines every n'th second. At this point, I don't know if the better way would be to create a dynamic mesh, or to instantiate a multitude of small nodes, or something different entirely. Worse, I'm not sure how I should go for attaching this "drawing" behavior to an entity? Any thought? Thanks! Link to comment
morbid Posted October 9, 2019 Share Posted October 9, 2019 Hello Stephane, The best way to do this is drawing Dynamic Mesh. It's a low-level approach but it will give you better results. Spawning nodes looks like a bad idea — you'll need a lot of them on a big distances, this will drop performance down. With Dynamic mesh you can draw a path and build a perpendicular line that falls down to the terrain. One thing should be considered — mesh size. Object Mesh Dynamic uses float vertex coordinates (vec3) that means you're limited in the object size. I suggest checking bound box, if you approaching to 10km — it's time to create another mesh. As for the timer logic it can be done in AppWorldLogic.cpp, something like that: update() { if (Game::get()->getTime() - time > 1.0f) { IG::getEntity() time = Game::get()->getTime(); } } Thanks. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Amerio.Stephane Posted October 9, 2019 Author Share Posted October 9, 2019 I see how to do the dynamic mesh, but if I want the lines to have a constant width on screen, independent from their distance, I might need to have them scaled in the shader. I see there is a Geometry Inflation state in the default mesh material, but it doesn't scale with the distance. Would you have a sample to help me do this? Also, I thought about using the Visualizer but it doesn't look like it can do thick lines and antialiasing. Link to comment
morbid Posted October 10, 2019 Share Posted October 10, 2019 16 hours ago, Amerio.Stephane said: Geometry Inflation state in the default mesh material, but it doesn't scale with the distance That what it does. I think geometry inflation should work fine for your case. On the attached image you can see a cylinder 1 meter in diameter from 10km view. Geometry inflation is set to Wire, Vertex Ballon = 1. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Amerio.Stephane Posted October 10, 2019 Author Share Posted October 10, 2019 Yes, that works! I've been using this wrong before! Thank you! Link to comment
Amerio.Stephane Posted October 10, 2019 Author Share Posted October 10, 2019 (edited) Just a minor remark: I changed the material to be additive and have Emission, with a high Intensity and enabled the glow effect (trying to simulate a 'ghostly' effect). But the glow effect depends on the distance, not on the visible width of the cylinder, so it is very strong near the cylinder and completely invisible far away yet the width on screen is the same (vertex balloon set to 10 for testing). Edited October 10, 2019 by Amerio.Stephane Link to comment
Recommended Posts