-
Notifications
You must be signed in to change notification settings - Fork 368
Plane modelMatrix Order #75
Comments
Check out the ARPlanes.js code that's used to visualize planes when using ARDebug, which is a bit more complicated since we have to tesselate the plane's vertices, rather than just using the extent -- you're also correct in understanding in of the modelMatrix. |
@jsantell
Now the planes are positioned and rotated correctly. However, I may switch to similar code from the example you provided as I'm attempting to apply physics and using these meshes as the ground. So having them fit the exact vertices would be best. |
Good luck! As a note, iOS planes are always rectangular, so the extents should be sufficient. ARCore on Android has convex polygons which require the tessellation seen in ARPlanes. We're looking at making ARPlanes more easily consumable outside of debugging so you'd just have to add your own texture if you wanted, something like that. Good luck! |
I'll keep that in mind. |
@msimpson just to clarify, on iOS we create a polygon using vertices that match the extent, so you should probably use the polygon on both platforms for maximum accuracy. |
Okay. Thanks. |
I'm having some trouble visualizing planes. I'm listening to
planesadded
onARDisplay
and attempting to render them as aTHREE.Mesh
usingTHREE.PlaneGeometry
. For example:The result of which are planes of seemingly the correct extent being added to the scene. However, their position seems incorrect and their rotation is most certainly wrong (vertical instead of horizontal).
I assume this is a result of incorrectly interpreting the given
modelMatrix
. In what order is this matrix given? I've tried the above method,matrix.fromArray
, which assumes column-major andmatrix.set( ...modelMatrix )
which assumes row-major.I'm not well versed in transformation matrices, so any help would be appreciated.
The text was updated successfully, but these errors were encountered: