christian.wolf2 Posted February 25, 2019 Posted February 25, 2019 Hi, I am currently trying to migrate my traffic network code to support the new spline system. While this is working for segments I am struggeling to implement the intersections. What I tried was to get the source mesh for the spline point (if any) and calculate the exact outer bone positions. Those positions should be the entry/exit point for the intersections. Therefor I can currently only calculate the position of the source mesh, without considering the rotation of the node. With the "getSources"-function I am only able to get a GUID for the used skinned mesh, which I can load separately but not directly from the WorldSplineGraph. For my use case I want to get either the exact t-value of the nearby spline segments, where those positions are. I am also able to calculate from a "nearby" position the closest t-value by myself, but therefor I have to use a proper position vector. So is it currently somehow possible to get/calculate those positions or can this be added with the next version? Best Christian
morbid Posted February 25, 2019 Posted February 25, 2019 Hi Christian, I think I'm missing something. So you have a modified crossroad, it has bent entries and exits. What do you mean by the exact value of the nearby spline segments? What should it be? Coordinates only? Can you explain a little bit more? Thanks. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
christian.wolf2 Posted February 25, 2019 Author Posted February 25, 2019 Hi morbid, of course! The above example is the sample road network, provided within the demo tab of your SDK browser. For the current implementation of your spline system dedicated for roads, each spline segment (bezier curve) starts and ends at a spline point. For simple road segments this is fine, because the applied mesh are tiled and stretched between an exact start and end point of a spline segment. But for intersections you have a problem. The segment mesh couldn't be stretched until the intersection point, because it will overlap with the node mesh at your intersection. As far as I can interpret your implementation of the spline system, you place a skinned mesh at the SplinePoint where an intersection happened. I took a look into your fbx file and the intersection meshes ("cross-x", "cross-y",...) have multiple bones, where the intersection entry/exit of your mesh will be. During the generation process, the bones will be placed along the spline to fit the curve. The stretched mesh from your segment will not be stretched 'til the SplinePoint, but to the position, where the bone is. In the above picture you can see the intersection skinned mesh, with the bones. Thos will be aligned to the bottom, blue line (the spline). What I need is the exact (world) position, where those bones will be placed/ the intersection mesh from the SplinePoints ends and the tiled mesh from the SplineSegment starts (green circle). Therefor, one of the following two approaches is enough: 1. Getting the exact (world) position of the bones. Because they are aligned with the spline segment you can easily convert them to the specified t-value of the segment. At the current API, you can get the source name of the mesh, that will be used as intersection mesh. Unfortunately this is only the guid, where I am able to load the specified mesh by myself, without any transformation of the intersection, and the re-positioning of the child bones. 2. Getting the t-Value of the SplineSegment, where the intersection mesh ends/ the stretched tile mesh starts. With the current function you can easily convert them to a (world) position. Last but not least a screenshot of my currently generated traffic lanes: The white lines represent the spline of the SplineSegment itself. Blue/Green lines are just the left/right lanes of a road. Here, the spline should end at the intersection entry/exit. For now, the splines should be drawn from position t= 0 until t= t1, where t1 is the intersection entry/exit. In my second step I will create new splines inside the intersection to allow my agents traveling in different directions. In the above picture I got the SourceName of the intersection mesh, loaded them seperately and calculated the t1-values by myself. Problem: The loaded source mesh is neither rotated, nor their bones re-aligned with the SplineSegments. I guess in your implementation you already know where those bones of the intersection mesh will be positioned, because you re-align them with the SplineSegment. The tiled/stretched nodes of the SplineSegment ends perfectly at the position, where the intersection mesh started. Regards Christian
morbid Posted February 26, 2019 Posted February 26, 2019 Thanks, Christian! I'm afraid right now there's no appropriate method to get the bones positions. We'll add this one in 2.8. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
christian.wolf2 Posted February 26, 2019 Author Posted February 26, 2019 That would be suitable for me. Thanks in advance!
morbid Posted February 26, 2019 Posted February 26, 2019 Thanks, we'll keep you posted. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
christian.wolf2 Posted May 6, 2019 Author Posted May 6, 2019 Hi morbid, I dived into the changelog of the 2.8 release but couldn't find any hint about the implementation of bone positions. The documentation wasn't updated as well. Does it mean, that this feature will be available in the next release?
morbid Posted May 7, 2019 Posted May 7, 2019 Hello Christian, Unfortunately, we've faced some problems with SplineGraph development and decided to keep it unchanged for 2.8. The updated version (production ready) will be available in the SDK 2.9 (summer 2019). How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
morbid Posted July 24, 2019 Posted July 24, 2019 Hi Christian, we've added new method SplinePoint::getLinkWorldPosition for getting bone positions. Will be available in 2.9 (august). 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
christian.wolf2 Posted July 24, 2019 Author Posted July 24, 2019 Hi morbid, that is awesome and definetly what we are looking for. Looking forward to test the new feature and working on our traffic system again. Best Christian
Recommended Posts