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

Multi NFT feature #199

Merged
merged 27 commits into from
Sep 24, 2021
Merged

Multi NFT feature #199

merged 27 commits into from
Sep 24, 2021

Conversation

kalwalt
Copy link
Member

@kalwalt kalwalt commented Sep 13, 2021

Multi NFT feature

This PR will add the multi NFT feature to ARnft. A simple example is provided see arNFT_multi_example.html. It load 3 NFT markers. But i think it can load much more. ARnft will create a separate WebWorker for every marker, each Worker will dispatch an event with the matrix information for every NFT marker detected and tracked. During initialization the user/dev must provide for every NFT marker, via the init() function or with entities with the initWithEntities() function see a44d437, a uniqe name for every NFT marker added.
Note: if you are using a previuos ARnft version, probably you must make some changes in your code and use the newest ARnftThreejs provided (not yet merged) in the examples.
In detail, related to ARnft-threejs there are changes in the add, addModel, addVideo, addImage functions. objVisibility is now an option of these methods, is not required to add an entry to the config.json file. more info about Arnft-threejs in the PR webarkit/ARnft-threejs#12

This is the to do list:

  • multi NFT with an array of Workers.
  • minimal working example.
  • working example with at least 3 markers
  • fix all examples
  • improved nftTrackingLost event listener
  • improved getNFTData listener
  • change dispose() and disposeNFT(): they should dispose all the NFTworkers and give also the option to dispose one single NFTWorker in the array. they works but i will improve in a separate PR.
  • upgrading jsartoolkitNFT to solve some security issue.
  • fix error: NFTWorker.ts:167 Uncaught TypeError: Cannot read properties of null (reading 'removeChild')
    at NFTWorker.ts:167

@kalwalt kalwalt added the 🚀 enhancement New feature or request label Sep 13, 2021
@kalwalt kalwalt self-assigned this Sep 13, 2021
@kalwalt kalwalt marked this pull request as draft September 13, 2021 21:16
@kalwalt kalwalt added the WIP issue or PR Works In Progress label Sep 13, 2021
@kalwalt
Copy link
Member Author

kalwalt commented Sep 15, 2021

Most of the examples (80%) now works with the new code. I think i have to improve the getNFTData listener, not sure if it works correctly with the new code.

@kalwalt
Copy link
Member Author

kalwalt commented Sep 20, 2021

I created the initWithEntities function to initialize ARnft with an object that help a little bit the user/dev. An Entity is composed by a unique name and the marker Url associated, see the interface in ARnft.ts:

interface Entity {
    name: string, 
    markerUrl: string
}

if you want to access the name of the first Entity, you can get it with entity[0].name.

I added also the getEntities method to retrieve the entities property object. I will add more function in a near future.
I get this erron in the console, that need to be fixed:

NFTWorker.ts:167 Uncaught TypeError: Cannot read properties of null (reading 'removeChild')
    at NFTWorker.ts:167

I will add It to the to do list.

@kalwalt kalwalt marked this pull request as ready for review September 21, 2021 21:15
@kalwalt
Copy link
Member Author

kalwalt commented Sep 23, 2021

i think that this is ready to be merged in the dev branch now, i will update the information on the top of PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement New feature or request WIP issue or PR Works In Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant