Solution 1 :
you can detect the walls by creating a custom arfragment and making it detect planes vertically then you can place anchors on the wall . Another option will be using markers on the wall
Problem :
hi i want to create some thing like this
picture that
but i do not know how to place anchors on a wall and place images on the wall using those anchors
AR fragment
fragment = (ArFragment)
getSupportFragmentManager().findFragmentById(R.id.sceneform_fragment);
CompletableFuture<ViewRenderable> imgView = ViewRenderable.builder()
.setView(this, R.layout.textview)
.build();
CompletableFuture.allOf(imgView).handle((notUsed, throwable) -> {
// When you build a Renderable, Sceneform loads its resources in the background while
// returning a CompletableFuture. Call handle(), thenAccept(), or check isDone()
// before calling get().
if (throwable != null) {
Log.d("MainActivity", "onCreate: " + "Unable to load renderable");
return null;
}
try {
imageViewRenderable = imgView.get();
} catch (InterruptedException | ExecutionException ex) {
Log.d("MainActivity", "onCreate: Unable to load renderable");
}
return null;
});
try {
mArSession = new Session(this);
} catch (UnavailableArcoreNotInstalledException e) {
e.printStackTrace();
} catch (UnavailableApkTooOldException e) {
e.printStackTrace();
} catch (UnavailableSdkTooOldException e) {
e.printStackTrace();
} catch (UnavailableDeviceNotCompatibleException e) {
e.printStackTrace();
}
mArConfig = new Config(mArSession);
mArConfig.setUpdateMode(Config.UpdateMode.LATEST_CAMERA_IMAGE);
mArConfig.setPlaneFindingMode(Config.PlaneFindingMode.VERTICAL);
mArSession.configure(mArConfig);
fragment.getArSceneView().setupSession(mArSession);
fragment.setOnTapArPlaneListener((HitResult hitresult, Plane plane, MotionEvent motionevent) -> {
Anchor anchor = hitresult.createAnchor();
AnchorNode anchorNode = new AnchorNode(anchor);
anchorNode.setParent(fragment.getArSceneView().getScene());
TransformableNode art = new TransformableNode(fragment.getTransformationSystem());
art.setParent(anchorNode);
art.setRenderable(imageViewRenderable);
art.select();
ImageView imageView = (ImageView)imageViewRenderable.getView();
Picasso.get().load("http://www.cbk-enschede.nl/plaatjes/ens/jpg/GSA023.jpg").into(imageView);
}
);
this is the code that i got from a question on stackoverflow this is the one i want my user to be able to add images from gallery to the wall
Comments
Comment posted by developers.google.com/ar/develop/c/augmented-images
Have you read:
Comment posted by Kashif Mehmood
i dont want to augument using an image did u saw the link i included?
Comment posted by ARCore – How to place/create objects on surfaces like walls without any Feature Points?
So more like:
Comment posted by Kashif Mehmood
yes more like that