Skip to content
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

error: THREE.Mesh: .drawMode has been removed. #78

Open
dirkk0 opened this issue Feb 24, 2020 · 6 comments
Open

error: THREE.Mesh: .drawMode has been removed. #78

dirkk0 opened this issue Feb 24, 2020 · 6 comments

Comments

@dirkk0
Copy link

dirkk0 commented Feb 24, 2020

The controls throw an error on the console: 'THREE.Mesh: .drawMode has been removed.'
Commenting out the offending line:
https://github.com/fernandojsg/aframe-teleport-controls/search?q=drawmode&type=Code
makes the error go away.

@rotoglup
Copy link

rotoglup commented Feb 25, 2020

The full message is

THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.

It seems that the current Meshes are constructed using drawMode == THREE.TriangleStripDrawMode, so commenting the lines is probably not enough, one should also call BufferGeometryUtils.toTrianglesDrawMode()

@rotoglup
Copy link

I've been looking into this to improve my AFrame knowledge : this component uses an 'old' THREE API, that came with AFrame 0.9.2.

More recent versions of AFrame come with newer revisions of THREE (r111, soon r113) which may not be compatible, see THREE migration guide.

How is this usually handled in other external componants ?

@blasco
Copy link

blasco commented Apr 26, 2020

Facing same issue here. Any possible solution?

@Galadirith
Copy link

@blasco The suggestion by @rotoglup was great and as the migration guide suggests, however I don't think simply using toTrianglesDrawMode() is sufficient because the rest of the code to update the line still assumes it's a triangle strip. I've made some of my own changes over on my fork (master...Galadirith:migrate-tri-strip-to-tri) and you can include the distribution from jsdelivr in your HTML.

Let me know if that works for you. It seems to have solved my issues and now correctly renders the line as it should do. I'll open a PR with this if it looks good 😊

@Ten-Zen
Copy link

Ten-Zen commented Nov 6, 2020

@Galadirith this eliminates the warning but does not solve all the problems I currently am having. Could be entirely unrelated, but my teleport lines are still not showing up and i have no functionality.

@jure
Copy link

jure commented Dec 18, 2020

I've ported the ray to use the default Three.js draw mode, i.e. the triangles draw mode, here: https://github.com/jure/aframe-blink-controls/blob/main/src/index.js#L525-L603

You can pretty much copy the body of this function into your aframe-teleport-controls code (https://github.com/fernandojsg/aframe-teleport-controls/blob/master/lib/RayCurve.js#L3-L58) and it will work as intended.

Hope that helps someone! I did enjoy the very elegant and efficient approach of TriangleStripDrawMode, but since it's been removed it doesn't help to lament, it is what it is :)

AnaCoda added a commit to AnaCoda/AFramePractice that referenced this issue Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants