babbleon Posted May 8, 2018 Share Posted May 8, 2018 Hello, Here's a PG: http://www.babylonjs-playground.com/#A5R1J3 and here's what should happen: The problem is the large cylinder does not "lookAt" the smaller cylinder. The large cylinder is parented to an empty which in turn is parented to an animated mesh and I think that is where the problem is. Is this by design or am I being hard of thinking? Thank you, Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 8, 2018 Share Posted May 8, 2018 In fact it works, it's the pivot point that lookAt looks at (the center of your tube) You must change the pivot point so that lookAt looks in the right place and not the center of your tube. http://www.babylonjs-playground.com/#A5R1J3#1 Quote Link to comment Share on other sites More sharing options...
babbleon Posted May 8, 2018 Author Share Posted May 8, 2018 Thank you @Dad72, The larger cylinder looks at the pivot point of the small cylinder, but it still doesn't work as per my screen capture on my first post. 45 minutes ago, Dad72 said: In fact it works ..am I missing something here? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 8, 2018 Share Posted May 8, 2018 The first cylinder looks at the center of the other cylinder that corresponds to the pivot point. You must move the pivot point to the base. If this cylinder is an instance, you should instead make a clone and change its pivot point. The problem is in the design of the model Quote Link to comment Share on other sites More sharing options...
babbleon Posted May 8, 2018 Author Share Posted May 8, 2018 The cylinder is not an instance. Attached is a screenshot showing pivot points of both cylinders (the yellow / orange dot). Surely, this should work? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 8, 2018 Share Posted May 8, 2018 Ok, I see, it's because of parenting. The child object is not positioned correctly at the time of export to Babylon. Have you try without making a parent. I do not use Blender, so I'm not sure to be of much help. Quote Link to comment Share on other sites More sharing options...
babbleon Posted May 8, 2018 Author Share Posted May 8, 2018 Yup, as per first post: 2 hours ago, babbleon said: The large cylinder is parented to an empty which in turn is parented to an animated mesh and I think that is where the problem is. Is this by design or am I being hard of thinking? I don't think the parenting is the problem, it's the parent animation that is causing the issue. I was asking if I am doing something wrong or if this is a limitation / feature of BJS. Thank you for you help, though! Quote Link to comment Share on other sites More sharing options...
babbleon Posted May 8, 2018 Author Share Posted May 8, 2018 Hey @Dad72, this is my mistake and you were correct - apologies. I need to work on this and will post once I have sorted it. My head is itself pivoting wildly at the moment. ? Dad72 1 Quote Link to comment Share on other sites More sharing options...
babbleon Posted May 9, 2018 Author Share Posted May 9, 2018 This is sorted and only has one lookAt now. http://www.babylonjs-playground.com/#A5R1J3#2 The large cylinder is parented to the small cylinder, the small cylinder looks at an empty at the top of the vertical bar. The large cylinder copies the location of the empty. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.