-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Line width issue for tracks #73
Comments
Interesting! It looks like Line2 is the best solution to me. But would outlinepass work better with MeshLine? Did you notice any other difference in performance? |
I am not sure. In terms of performance, I don't notice much difference.
|
Okay, so I vote for Line2. @emiliocortina - any thoughts? |
I am curious to see how it behaves when intersecting with the raycaster. The main issue with the tracks is not their visibility (we are already changing line width when creating tracks with the current implementation) but selecting them. Modifying their width only changes the way they are represented, but they are still one-dimensional objects, which makes it very difficult to select when hovering over them, as you have to find the exact spot. Can you make a pull request so I can check that out? Thanks! |
Sorry, I didn't follow up on this. I actually looked into selection earlier and debugged some things. For Line2, it's just as Emilio said. But we do get a weird box in the middle like this: Which might be used as an indicator (pretty sure not practical). However, increasing the linewidth does increase the selection area for tracks even though it's not as accurate. And surprisingly, for MeshLine, there seems to be a more uncommon problem. I am unable to select tracks at all even though they are basically Mesh. I will look into it a bit more. @emiliocortina the branches are in disarray and not ready for a PR so you can manually check the branches from the links I mentioned in the issue description. |
Another use of Line2 is linewidth support for Windows and chrome in Mac like I mentioned in the description. |
Cylinder Geometry for TracksSo here is another possible go at tracks: Code exists at https://github.com/9inpachi/phoenix/tree/cylinder-tracks The code is very much unrefined right now and is only for testing purposes. |
Ok, I will take a look at those approaches. If it ends up generating lag, maybe it is better to stick with either Line or Line2 for tracks. |
Again the only problem is scaling like I pointed before:
I am looking around in shaders to see if I can make |
A trick we used in another EventDisplay (VP1) is to have a |
I think it's worth to give it a try. Another approach which I had in mind was to have two different version of tracks. One with the line geometry and the other with tubes. Such that when we turn on selection, the tube geometry tracks become visible and the line tracks become hidden and vice versa. I tried a lot to edit the shaders for making |
So I gave this a try today and the result is very promising |
No, that's not ideal. But maybe this could be another configuration option? I naively assume that it's the tubes that cause the FPS drop? |
Contrary, it looks like its due to We will have to handle selections a little different for both of these to work together. I guess we can use EDIT: It looks like the FPS drop is due to the |
It seems I was not debugging properly since I was also working with collections at the same time. The performance is great for both I will be pushing the changes along with the #93 issue ( |
Excellent! |
Hi all,
The function
getTrack(trackParams: any): Object3D
currently returns an object ofTHREE.Line
.The problem is that
THREE.LineBasicMaterial
has known bugs for the linewidth property which does not work on windows and on chrome for MacOS. See THIS for details.I was working on a control for changing line width of tracks and came across this problem. The solution is to use either Line2 or THREE.MeshLine.
Using THREE.MeshLine
I have a solution using MeshLine here but the problem with it is that it scales with camera zoom since it is a Mesh. We can scale it for every render (
animate()
) we do but that is too expensive in terms of computation.Here is what it looks like:
Using Line2
I also have a solution ready using
Line2
here.Line2
is not part of three.js core and we have to use scripts inthree/examples/jsm/lines/
.Line2
does not have any scaling issues so I think this is the perfect choice.Here is what it looks like using
Line2
WHAT ARE YOUR THOUGHTS?
This is surely going to make tracks selection MUCH SIMPLER.
The text was updated successfully, but these errors were encountered: