aframe-extras icon indicating copy to clipboard operation
aframe-extras copied to clipboard

aframe 1.2.0 and navmesh

Open DrMicPhys opened this issue 4 years ago • 2 comments

when using a simple navigation mesh

  • Using aframe 1.0.4 with aframe-extras works

  • Using aframe 1.2.0 with aframe-extras does not, with the following

    Uncaught TypeError: THREE.Geometry is not a constructor

When I then used a local non-min copy of aframe-extras the additional info indicates the error is

Uncaught TypeError: THREE.Geometry is not a constructor at i.loadNavMesh (aframe-extras.js:11127)

when I used a local, non-min copy of aframe-extras

I am not a programmer, but I THINK it's the THREE.js issue mentioned in "Ocean extra nlot working on aframe 1.2.0". That said, I have no idea what a work around might look. There are a few other features in aframe 1.2.0 that I am trying to hold on to (for very simple student VR projects)

DrMicPhys avatar Oct 20 '21 02:10 DrMicPhys

I tried this fix : https://github.com/n5ro/aframe-extras/pull/358 and can't have a navmesh with aframe 1.2.0 too. and with aframe 1.1.0 work only on safari and firefox, not on Chrome. Thanks

Turtleted21 avatar Jan 21 '22 11:01 Turtleted21

I looks like this issue was maybe fixed in src but never made it into dist? Fix navmeshes

Omegahed avatar May 25 '22 18:05 Omegahed

The castle example is working for me on latest build, see #388

vincentfretin avatar Dec 04 '22 09:12 vincentfretin

I see that @vincentfretin is working hard in this repo, first of all, thanks for that! Really appreciate it.

Then: I prepared a Glitch with a navmesh example which is working fine with 1.0.4 and not so fine with 1.3.0. I saw that you created a new master and took the liberty to update the glitch with the current build (135d4a5): https://glitch.com/edit/#!/dk-navmesh-02

Two observations: a) it doesn't really work yet, but one can move a bit. b) the console claims that Three.js was already imported, I wonder why that is?

dirkk0 avatar Dec 04 '22 09:12 dirkk0

Thanks for the reproduction case @dirkk0 Your navmesh looks correct when I open it in blender. Indeed "WARNING: Multiple instances of Three.js being imported." is not normal, that may be the issue.

vincentfretin avatar Dec 04 '22 10:12 vincentfretin

I actually also have "WARNING: Multiple instances of Three.js being imported." on the castle example but it's working correctly there.

vincentfretin avatar Dec 04 '22 10:12 vincentfretin

yes, I saw that too. Also, if you uncomment the 1.0.4 in the header, the example is working. so I am pretty sure that the meshes are ok. I am comparing the castle example to the glitch now.

dirkk0 avatar Dec 04 '22 10:12 dirkk0

got it!!

problem nr1: the arch enemy of Blender users: 'apply all tranforms'

blender1

dirkk0 avatar Dec 04 '22 11:12 dirkk0

problem nr2:

navmesh doesn't like 'position' or 'scale' anymore, that's also new.

working glitch: https://dk-navmesh-03.glitch.me/

dirkk0 avatar Dec 04 '22 11:12 dirkk0

so in a nutshell:

  • don't position or scale the navmesh in A-Frame
  • apply all transforms in Blender.

dirkk0 avatar Dec 04 '22 11:12 dirkk0

Oh good catch for nr1. I'm glad you figured it out. For nr2 it's actually a regression introduced in #358 where the applyMatrix was removed.

vincentfretin avatar Dec 05 '22 10:12 vincentfretin

Can you please help me reintroducing the applyMatrix. Can you please create a glitch example with your fixed models and add again scale and position, so I can remix it and work on a fix.

vincentfretin avatar Dec 05 '22 10:12 vincentfretin

Actually I could also work on the castle example. I see that the navmesh is 3 times bigger than the castle glb. There is a scale="3 3 3" on the castle. We should apply a position on both castle and navmesh on this example and reintroduce the applyMatrix, this way we won't reintroduce the regression in the future.

vincentfretin avatar Dec 05 '22 10:12 vincentfretin

True!

If you still need an example, here it is: https://glitch.com/edit/#!/dk-navmesh-04?path=index.html

dirkk0 avatar Dec 05 '22 10:12 dirkk0

Thanks. I fixed it in #390. You can give the build a try in your glitch example.

vincentfretin avatar Dec 05 '22 11:12 vincentfretin

I did! It's working! Great work, and thanks, Vincent!

dirkk0 avatar Dec 05 '22 11:12 dirkk0