cedricpinson / osgjs

Javascript Implementation of OpenSceneGraph [DISCONTINUED] Website archived https://cedricpinson.github.io/osgjs-website/
MIT License
786 stars 202 forks source link

PagedLOD Uncaught TypeError: this.children[j].accept is not a function #979

Closed WinterCodeForEverything closed 6 years ago

WinterCodeForEverything commented 6 years ago

When I used load-model in example to load osgjs models with LOD, it shows error "Uncaught TypeError: this.children[j].accept is not a function" at PagedLOD.js:210 over and over again, so where does the "accept" define?

jtorresfabra commented 6 years ago

Hey @WinterCodeForEverything

Can you post the code of how you did it, or a URL? Otherwise is difficult to get what is happening.

WinterCodeForEverything commented 6 years ago

Sorry I don't have a URL and thanks for answer. I didn't change anything in load-model example except loading another model, I used osgconv trans osgb to osgjs, just like : osgconv -O "mergeAllBinaryFiles" ../osgb_data/model.osgb ../test/model.osgjs, the code: load-model.zip

the model : test.zip

jtorresfabra commented 6 years ago

It seems you missed the most important errors at the beginning of the execution:

image

So the children files (tiles) were not found and the LOD mechanism was not working. To fix this you need to set the database path pointing to your files path like:

osgDB.registry().setDatabasePath('path/to/your/files');

WinterCodeForEverything commented 6 years ago

thanks very much and maybe I should learn more about osg.js. And another small question is I miss texture and image when I use osgconv transform osgb to osgjs. How can I save texture and image ? Maybe also change the path that image save?

jtorresfabra commented 6 years ago

Seems you are saving your textures (and hence the link in your LOD files) to: /home/zdai/tmp/tmp_south_osgb_5953145c9096412211c90d9e/final/tile_6_4_0_tex_tex0.jpg So the textures should be in a place accesible by the server and well referenced in the LOD files.

There exists options in OSG to write out the textures, but I don't remember the options from the top of my head. You can see all the options on the osgb format doing osgconv --format

Hope it helps.