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

No remove function for added models. #13

Open
Najaf93 opened this issue Jul 24, 2021 · 3 comments
Open

No remove function for added models. #13

Najaf93 opened this issue Jul 24, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Najaf93
Copy link

Najaf93 commented Jul 24, 2021

Hi Guys,
is there any way to remove added model? I can only find these functions:

  • add
  • addmodel
  • addImage
  • addVideo

can someone help me please figure it out, any help will be appreciable.
Thank you

@kalwalt kalwalt transferred this issue from webarkit/ARnft Sep 16, 2021
@kalwalt
Copy link
Member

kalwalt commented Sep 16, 2021

Hi @Najaf93 i moved this issue to ARnft-threejs because is more appropriate. To answer to your question: no, at the moment there aren't any function to remove the meshes or models. If i have time, i plan to add them in a near future.

@kalwalt kalwalt added enhancement New feature or request help wanted Extra attention is needed labels Sep 16, 2021
@kalwalt
Copy link
Member

kalwalt commented Nov 26, 2021

@Najaf93 and everybody has this issue, this should works for simple meshes:
Assumed that you have your mesh:

let mat = new THREE.MeshLambertMaterial({ color: 0xff0000 });
let boxGeom = new THREE.BoxGeometry(1, 1, 1);
let cube = new THREE.Mesh(boxGeom, mat);

and you add it to the NFTaddTJS instance:

let nftAddTJS = new ARnftThreejs.NFTaddTJS(nft.uuid);
nftAddTJS.add(cube, 'pinball', false);

get the scene and remove the mesh:

const scene = sceneThreejs.getScene();
scene.remove(cube);

I have not tested the code so i can not say that it can works or not...

@kalwalt
Copy link
Member

kalwalt commented Jan 26, 2022

I'm testing a new remove function on this branch https://github.com/webarkit/ARnft-threejs/tree/feature-remove, i will create a new example when i have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants