google-ar / sceneform-android-sdk

Sceneform SDK for Android
https://developers.google.com/sceneform/develop/
Apache License 2.0
1.23k stars 604 forks source link

Can I put the model in other non-flat places? #424

Open HoneyHanNing opened 5 years ago

HoneyHanNing commented 5 years ago

Can another model be nested in arcode or sceneform?

Imagine a scenario like this:

First, create a huge frame/cage.

And then, switching to another model,

Finally, put the switching model into the huge frame/cage originally created

Can arcode or sceneform be done now?

Hope to get your help, any help I will be grateful, thank you! ~

siny-yao commented 5 years ago

Can another model be nested in arcode or sceneform?

Imagine a scenario like this:

First, create a huge frame/cage.

And then, switching to another model,

Finally, put the switching model into the huge frame/cage originally created

Can arcode or sceneform be done now?

Hope to get your help, any help I will be grateful, thank you! ~

I think you might want to develop a model switch function. This is very simple. You just need to set your node as a global variable, call the setRenderable() method, and set a new Renderable;

HoneyHanNing commented 5 years ago

Can another model be nested in arcode or sceneform? Imagine a scenario like this: First, create a huge frame/cage. And then, switching to another model, Finally, put the switching model into the huge frame/cage originally created Can arcode or sceneform be done now? Hope to get your help, any help I will be grateful, thank you! ~

I think you might want to develop a model switch function. This is very simple. You just need to set your node as a global variable, call the setRenderable() method, and set a new Renderable;

sorry,I don‘t want to develop a model switch function ..

You probably didn't catch my meaning. Please let me explain it again..

The original AR was based on the visible plane to display the anchor points and place the virtual image, but now I want to move away from the real plane and use the virtual image that has been placed as the benchmark to place the object.

Is that possible?

thanks for your help!~

siny-yao commented 5 years ago

Can another model be nested in arcode or sceneform? Imagine a scenario like this: First, create a huge frame/cage. And then, switching to another model, Finally, put the switching model into the huge frame/cage originally created Can arcode or sceneform be done now? Hope to get your help, any help I will be grateful, thank you! ~

I think you might want to develop a model switch function. This is very simple. You just need to set your node as a global variable, call the setRenderable() method, and set a new Renderable;

sorry,I don‘t want to develop a model switch function ..

You probably didn't catch my meaning. Please let me explain it again..

The original AR was based on the visible plane to display the anchor points and place the virtual image, but now I want to move away from the real plane and use the virtual image that has been placed as the benchmark to place the object.

Is that possible?

thanks for your help!~

Ok, my understanding is like this. You don't want to find plane,you just want to place the model on the current scene,and use the model position which you placed first as center point ,around the first model place others model? If so,you can think like this: 1.Place the first node AnchorNode anchorNode = new AnchorNode(); anchorNode.setParent(arSceneView.getScene()); Node base = new Node(); base.setLocalScale(new Vector3(2.0f, 2.0f, 2.0f)); base.setLocalPosition(new Vector3(5.0f, 5.0f, -20.0f));//Z axis is negative, because you need to place the node in front of your camera base.setParent(anchorNode); 2.Set the Child Node node1 = new Node(); node1.setLocalPosition(new Vector3(0.0f, 0.5f, 0.0f)); node1.setParent(base); You also can do like this: Vector3 local = base.getLocalPosition(); Vector3 world = base.getWorldPosition(); Node node2 = new Node(); node2.setLocalPosition(new Vector3(local.x + 0.0f, local.y + 0.5f, local.z + 0.5f)); node2.setParent(base); How to place child node,you can refer to the solarsystem example. How to ensure that the current scene has been created, you need to listen to the scene's onUpdate event.

HoneyHanNing commented 5 years ago

Can another model be nested in arcode or sceneform? Imagine a scenario like this: First, create a huge frame/cage. And then, switching to another model, Finally, put the switching model into the huge frame/cage originally created Can arcode or sceneform be done now? Hope to get your help, any help I will be grateful, thank you! ~

I think you might want to develop a model switch function. This is very simple. You just need to set your node as a global variable, call the setRenderable() method, and set a new Renderable;

sorry,I don‘t want to develop a model switch function .. You probably didn't catch my meaning. Please let me explain it again.. The original AR was based on the visible plane to display the anchor points and place the virtual image, but now I want to move away from the real plane and use the virtual image that has been placed as the benchmark to place the object. Is that possible? thanks for your help!~

Ok, my understanding is like this. You don't want to find plane,you just want to place the model on the current scene,and use the model position which you placed first as center point ,around the first model place others model? If so,you can think like this: 1.Place the first node AnchorNode anchorNode = new AnchorNode(); anchorNode.setParent(arSceneView.getScene()); Node base = new Node(); base.setLocalScale(new Vector3(2.0f, 2.0f, 2.0f)); base.setLocalPosition(new Vector3(5.0f, 5.0f, -20.0f));//Z axis is negative, because you need to place the node in front of your camera base.setParent(anchorNode); 2.Set the Child Node node1 = new Node(); node1.setLocalPosition(new Vector3(0.0f, 0.5f, 0.0f)); node1.setParent(base); You also can do like this: Vector3 local = base.getLocalPosition(); Vector3 world = base.getWorldPosition(); Node node2 = new Node(); node2.setLocalPosition(new Vector3(local.x + 0.0f, local.y + 0.5f, local.z + 0.5f)); node2.setParent(base); How to place child node,you can refer to the solarsystem example. How to ensure that the current scene has been created, you need to listen to the scene's onUpdate event.

thanks for your reply,!~

That's what I did before,like 1. : `1.Place the first node

AnchorNode anchorNode = new AnchorNode(); anchorNode.setParent(arSceneView.getScene()); Node base = new Node(); base.setLocalScale(new Vector3(2.0f, 2.0f, 2.0f)); base.setLocalPosition(new Vector3(5.0f, 5.0f, -20.0f));//Z axis is negative, because you need to place the node in front of your camera base.setParent(anchorNode); `

Node name “base“ can indeed construct a model based on AnchorNode name ”anchorNode“,but what I want to ask is, another Node name "base2" , can build a model based on Node name “base“? Node based on Node , not based on AnchorNode , Is that possible? thanks for your help!~

siny-yao commented 5 years ago

Can another model be nested in arcode or sceneform? Imagine a scenario like this: First, create a huge frame/cage. And then, switching to another model, Finally, put the switching model into the huge frame/cage originally created Can arcode or sceneform be done now? Hope to get your help, any help I will be grateful, thank you! ~

I think you might want to develop a model switch function. This is very simple. You just need to set your node as a global variable, call the setRenderable() method, and set a new Renderable;

sorry,I don‘t want to develop a model switch function .. You probably didn't catch my meaning. Please let me explain it again.. The original AR was based on the visible plane to display the anchor points and place the virtual image, but now I want to move away from the real plane and use the virtual image that has been placed as the benchmark to place the object. Is that possible? thanks for your help!~

Ok, my understanding is like this. You don't want to find plane,you just want to place the model on the current scene,and use the model position which you placed first as center point ,around the first model place others model? If so,you can think like this: 1.Place the first node AnchorNode anchorNode = new AnchorNode(); anchorNode.setParent(arSceneView.getScene()); Node base = new Node(); base.setLocalScale(new Vector3(2.0f, 2.0f, 2.0f)); base.setLocalPosition(new Vector3(5.0f, 5.0f, -20.0f));//Z axis is negative, because you need to place the node in front of your camera base.setParent(anchorNode); 2.Set the Child Node node1 = new Node(); node1.setLocalPosition(new Vector3(0.0f, 0.5f, 0.0f)); node1.setParent(base); You also can do like this: Vector3 local = base.getLocalPosition(); Vector3 world = base.getWorldPosition(); Node node2 = new Node(); node2.setLocalPosition(new Vector3(local.x + 0.0f, local.y + 0.5f, local.z + 0.5f)); node2.setParent(base); How to place child node,you can refer to the solarsystem example. How to ensure that the current scene has been created, you need to listen to the scene's onUpdate event.

thanks for your reply,!~

That's what I did before,like 1. : `1.Place the first node

AnchorNode anchorNode = new AnchorNode(); anchorNode.setParent(arSceneView.getScene()); Node base = new Node(); base.setLocalScale(new Vector3(2.0f, 2.0f, 2.0f)); base.setLocalPosition(new Vector3(5.0f, 5.0f, -20.0f));//Z axis is negative, because you need to place the node in front of your camera base.setParent(anchorNode); `

Node name “base“ can indeed construct a model based on AnchorNode name ”anchorNode“,but what I want to ask is, another Node name "base2" , can build a model based on Node name “base“? Node based on Node , not based on AnchorNode , Is that possible? thanks for your help!~

This is achievable. If you are not sure, you can look at the case of the official solar system. The solar system is a node, and other planets are created based on it.

HoneyHanNing commented 5 years ago

Can another model be nested in arcode or sceneform? Imagine a scenario like this: First, create a huge frame/cage. And then, switching to another model, Finally, put the switching model into the huge frame/cage originally created Can arcode or sceneform be done now? Hope to get your help, any help I will be grateful, thank you! ~

I think you might want to develop a model switch function. This is very simple. You just need to set your node as a global variable, call the setRenderable() method, and set a new Renderable;

sorry,I don‘t want to develop a model switch function .. You probably didn't catch my meaning. Please let me explain it again.. The original AR was based on the visible plane to display the anchor points and place the virtual image, but now I want to move away from the real plane and use the virtual image that has been placed as the benchmark to place the object. Is that possible? thanks for your help!~

Ok, my understanding is like this. You don't want to find plane,you just want to place the model on the current scene,and use the model position which you placed first as center point ,around the first model place others model? If so,you can think like this: 1.Place the first node AnchorNode anchorNode = new AnchorNode(); anchorNode.setParent(arSceneView.getScene()); Node base = new Node(); base.setLocalScale(new Vector3(2.0f, 2.0f, 2.0f)); base.setLocalPosition(new Vector3(5.0f, 5.0f, -20.0f));//Z axis is negative, because you need to place the node in front of your camera base.setParent(anchorNode); 2.Set the Child Node node1 = new Node(); node1.setLocalPosition(new Vector3(0.0f, 0.5f, 0.0f)); node1.setParent(base); You also can do like this: Vector3 local = base.getLocalPosition(); Vector3 world = base.getWorldPosition(); Node node2 = new Node(); node2.setLocalPosition(new Vector3(local.x + 0.0f, local.y + 0.5f, local.z + 0.5f)); node2.setParent(base); How to place child node,you can refer to the solarsystem example. How to ensure that the current scene has been created, you need to listen to the scene's onUpdate event.

thanks for your reply,!~ That's what I did before,like 1. : `1.Place the first node

AnchorNode anchorNode = new AnchorNode(); anchorNode.setParent(arSceneView.getScene()); Node base = new Node(); base.setLocalScale(new Vector3(2.0f, 2.0f, 2.0f)); base.setLocalPosition(new Vector3(5.0f, 5.0f, -20.0f));//Z axis is negative, because you need to place the node in front of your camera base.setParent(anchorNode); `

Node name “base“ can indeed construct a model based on AnchorNode name ”anchorNode“,but what I want to ask is, another Node name "base2" , can build a model based on Node name “base“? Node based on Node , not based on AnchorNode , Is that possible? thanks for your help!~

This is achievable. If you are not sure, you can look at the case of the official solar system. The solar system is a node, and other planets are created based on it.

Thank you very much.!~

HoneyHanNing commented 5 years ago

Can another model be nested in arcode or sceneform? Imagine a scenario like this: First, create a huge frame/cage. And then, switching to another model, Finally, put the switching model into the huge frame/cage originally created Can arcode or sceneform be done now? Hope to get your help, any help I will be grateful, thank you! ~

I think you might want to develop a model switch function. This is very simple. You just need to set your node as a global variable, call the setRenderable() method, and set a new Renderable;

sorry,I don‘t want to develop a model switch function .. You probably didn't catch my meaning. Please let me explain it again.. The original AR was based on the visible plane to display the anchor points and place the virtual image, but now I want to move away from the real plane and use the virtual image that has been placed as the benchmark to place the object. Is that possible? thanks for your help!~

Ok, my understanding is like this. You don't want to find plane,you just want to place the model on the current scene,and use the model position which you placed first as center point ,around the first model place others model? If so,you can think like this: 1.Place the first node AnchorNode anchorNode = new AnchorNode(); anchorNode.setParent(arSceneView.getScene()); Node base = new Node(); base.setLocalScale(new Vector3(2.0f, 2.0f, 2.0f)); base.setLocalPosition(new Vector3(5.0f, 5.0f, -20.0f));//Z axis is negative, because you need to place the node in front of your camera base.setParent(anchorNode); 2.Set the Child Node node1 = new Node(); node1.setLocalPosition(new Vector3(0.0f, 0.5f, 0.0f)); node1.setParent(base); You also can do like this: Vector3 local = base.getLocalPosition(); Vector3 world = base.getWorldPosition(); Node node2 = new Node(); node2.setLocalPosition(new Vector3(local.x + 0.0f, local.y + 0.5f, local.z + 0.5f)); node2.setParent(base); How to place child node,you can refer to the solarsystem example. How to ensure that the current scene has been created, you need to listen to the scene's onUpdate event.

thanks for your reply,!~ That's what I did before,like 1. : `1.Place the first node

AnchorNode anchorNode = new AnchorNode(); anchorNode.setParent(arSceneView.getScene()); Node base = new Node(); base.setLocalScale(new Vector3(2.0f, 2.0f, 2.0f)); base.setLocalPosition(new Vector3(5.0f, 5.0f, -20.0f));//Z axis is negative, because you need to place the node in front of your camera base.setParent(anchorNode); `

Node name “base“ can indeed construct a model based on AnchorNode name ”anchorNode“,but what I want to ask is, another Node name "base2" , can build a model based on Node name “base“? Node based on Node , not based on AnchorNode , Is that possible? thanks for your help!~

This is achievable. If you are not sure, you can look at the case of the official solar system. The solar system is a node, and other planets are created based on it.

抱歉,可以给你的微信我吗?按照你的举例,我也研究了那个星系的demo,但是我还是无法实现想要的效果,想要加你微信请教一下可以吗?我的微信honey618717

HoneyHanNing commented 5 years ago

Can another model be nested in arcode or sceneform? Imagine a scenario like this: First, create a huge frame/cage. And then, switching to another model, Finally, put the switching model into the huge frame/cage originally created Can arcode or sceneform be done now? Hope to get your help, any help I will be grateful, thank you! ~

I think you might want to develop a model switch function. This is very simple. You just need to set your node as a global variable, call the setRenderable() method, and set a new Renderable;

sorry,I don‘t want to develop a model switch function .. You probably didn't catch my meaning. Please let me explain it again.. The original AR was based on the visible plane to display the anchor points and place the virtual image, but now I want to move away from the real plane and use the virtual image that has been placed as the benchmark to place the object. Is that possible? thanks for your help!~

Ok, my understanding is like this. You don't want to find plane,you just want to place the model on the current scene,and use the model position which you placed first as center point ,around the first model place others model? If so,you can think like this: 1.Place the first node AnchorNode anchorNode = new AnchorNode(); anchorNode.setParent(arSceneView.getScene()); Node base = new Node(); base.setLocalScale(new Vector3(2.0f, 2.0f, 2.0f)); base.setLocalPosition(new Vector3(5.0f, 5.0f, -20.0f));//Z axis is negative, because you need to place the node in front of your camera base.setParent(anchorNode); 2.Set the Child Node node1 = new Node(); node1.setLocalPosition(new Vector3(0.0f, 0.5f, 0.0f)); node1.setParent(base); You also can do like this: Vector3 local = base.getLocalPosition(); Vector3 world = base.getWorldPosition(); Node node2 = new Node(); node2.setLocalPosition(new Vector3(local.x + 0.0f, local.y + 0.5f, local.z + 0.5f)); node2.setParent(base); How to place child node,you can refer to the solarsystem example. How to ensure that the current scene has been created, you need to listen to the scene's onUpdate event.

thanks for your reply,!~ That's what I did before,like 1. : `1.Place the first node

AnchorNode anchorNode = new AnchorNode(); anchorNode.setParent(arSceneView.getScene()); Node base = new Node(); base.setLocalScale(new Vector3(2.0f, 2.0f, 2.0f)); base.setLocalPosition(new Vector3(5.0f, 5.0f, -20.0f));//Z axis is negative, because you need to place the node in front of your camera base.setParent(anchorNode); `

Node name “base“ can indeed construct a model based on AnchorNode name ”anchorNode“,but what I want to ask is, another Node name "base2" , can build a model based on Node name “base“? Node based on Node , not based on AnchorNode , Is that possible? thanks for your help!~

This is achievable. If you are not sure, you can look at the case of the official solar system. The solar system is a node, and other planets are created based on it.

I am look at the case of the official solar system. The solar system is a node, and other planets are created based on it. but,now,I had another problem:The solar system can't be moved, and I've been trying for two days, combining the HelloSceneform Demo, still can't get the two together——

1.The solar system is a node, and other planets are created based on it,can’t be moved;

2.Model is not based on the node ,can move;

My wechat is honey618717,can U get in touch with me?I need your help,please!~help ~~~