Forum

3D Locator

26 November 2016 00:15
Hello,
In one of my demos I start with a PNG to show the location of a part. As the user clicks, the PNG disappears and the camera moves and an animation starts. Once the animation is finished and shows how to remove a part, the user have the ability to rotate around the object.

My question is: how can I have a locator on the corner that rotates at the same time as the part, to show which direction the user is facing?

Kind of like this example with the engine:
http://animagraffs.com/supercharger-vs-turbo/

BUT imagine if you were looking at the piston and the piston in the locator would be highlighted in red and as you turn around the piston, the engine would also rotate. (kind of like attached)
Thanks
26 November 2016 15:54
"a locator on the corner that rotates"
Do you mean a 3D arrow type of object that has its position parented to the part?
Parenting one object to another is fairly simple if I understand your question.
See if this is what you are looking for:
http://blender.stackexchange.com/questions/26108/how-do-i-parent-objects
26 November 2016 20:59
Hey Will,

Thanks for that tip.

I am a newbie to Blender and Blend4web. That could actually work. All I have to do is to make sure I can also parent my locator to the camera.
26 November 2016 21:28
It seems that the parenting works when I rotate an object. What I want to to is when the object is exported and the camera rotates around the cube, the small cube will also rotates. see attached blender. experimenting with two cubes now.
27 November 2016 07:19
So your example uses one parent and one constraint. The parenting exports in Blend4Web, but the constraint does not.
In Blender you could achieve what you want with two "Child of" constraints, one for location and the other for rotation. But I don't believe Blend4Web currently supports constraints. You could do it with coding though, here is the related code documentation: https://www.blend4web.com/api_doc/module-constraints.html
 
Please register or log in to leave a reply.