How to render object on cylinder #167
-
Hi! Overview of the target AppConditionsCylinder
Andy
Questions1. How to scale the radius or height of the cylinder? 2. How to rotate Andy along the side of the cylinder?
For the above steps, I would like to ask for a way to render and rotate the model Thanks very much for supporting this wonderful library 👍. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi, Very interesting and clear question (even if you should better put it in the Discussion section). What I would suggest is having an You can then change its dimensions using the Keep z at 1.0f and adjust the radius with scale.x and the height with scale.y For the Andy part, depending on if you want your Cylinder to rotate with him or not, you can simply add it has a child or as sub-child If you want it to be independent from the Cylinder, add the Cylinder as a child of your ArNode instead of loading the glb at the ArNode level.
For the rotation part, all you have to do is to put it at a certain distance using from the pivot ArNode and then rotate the ArNode .
You can also have a look at the :-) function for controlling what is Andy looking at during rotation. Pay attention to the fact that depending on your
|
Beta Was this translation helpful? Give feedback.
-
Thanks for your great help! And I'm sorry for using the wrong tab😂. I have some more questions.
The code seems to adjust the position by directly entering the value. And I have a simple question about the relationship between the child and parent node. |
Beta Was this translation helpful? Give feedback.
-
I solved it in the way you suggested before. Thx! |
Beta Was this translation helpful? Give feedback.
Hi,
Very interesting and clear question (even if you should better put it in the Discussion section).
What I would suggest is having an
ArModelNode
withPlane
placement that displays a cylinder coming from a glb for now.For now because it will soon (v1.0.0) be easier and more efficient to use a
Cylinder
Geometry
(It will look like this: https://gist.github.com/ThomasGorisse/7e07681e6aae794982ced3bc61af7f8d)But if it is well defined inside Blender, it's not much more consuming to have it coming from a glTF.
You can then change its dimensions using the
sceneview-android/sceneview/src/main/java/io/github/sceneview/node/Node.kt
Line 184 in b7341cc
…