-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
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
computeLineDistances in BufferGeometry? #7013
Comments
This is a bit more complicated than it appears on the surface. First of all, In the case of If the geometry is indexed, we can't even do this, because the vertices are reused. So to add a We also need to know if the geometry represents a sequence of points, or a sequence of pairs of points -- same issue as before. Maybe Remember, we do not know if a geometry represents a line, line segments, or a mesh. This has always been an issue -- just not a particularly problematic one. |
I do agree put the I also take a look where threejs are using the However, we have different updates for |
I have tried implementing my own computelinedistance into the threejs library for BufferGeometry because I know my positions are in order and do not repeat or have indices, but still does not work. I also may be able to provide the line distances before drawing. Any suggestions how I can get around this limitation(knowing my vertices are non-indexed and in order)? |
|
Ahh yes I should of mentioned I tried this solution... it leads me to a TypeError: Cannot read property 'x' of undefined.
which seemed to be also discussed here: #6610 |
@andrevega3 If you are not able to get your code to work, please first get help on a help site. If you can demonstrate a three.js bug, then please make a new post and provide a link to a live example demonstrating it. |
Alright I guess it is not possible to compute line distances without converting to geometry first. |
Since the lack of lineDistances in BufferGeometry effectively breaks THREE.ShaderLib.dashed (until the feature's added), would it not be a good idea to have some sort of warning in code and console? (I just fell down the rabbit hole chasing this, and interesting learning experience, but still.) |
I tried to create an dashed line material using
BufferGeometry
. For some reason, it looks like whenever you create an line usingLineDashedMaterial
, you will need to call thiscomputeLineDistances
method. Do we want to add this method inside BufferGeometry as well?The text was updated successfully, but these errors were encountered: