Dad72 Posted November 30, 2016 Share Posted November 30, 2016 Hi, I think all is said in the title. I wish I could move a mesh that moves a point on a line using parent/child (on a points). But this seems not possible or I don't know how to do it. Unless there's another solution, but I don't see. I made an example on this PG. can someone help me. http://www.babylonjs-playground.com/#YCVDD#2 Thanks Quote Link to comment Share on other sites More sharing options...
adam Posted November 30, 2016 Share Posted November 30, 2016 http://www.babylonjs-playground.com/#YCVDD#4 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 30, 2016 Author Share Posted November 30, 2016 In fact, no. Here's a more accurate PG. And your solution does more Adam That's why I want to do a parent child relationship http://www.babylonjs-playground.com/#YCVDD#5 Quote Link to comment Share on other sites More sharing options...
adam Posted November 30, 2016 Share Posted November 30, 2016 It still isn't clear to me what you are trying to achieve. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 30, 2016 Author Share Posted November 30, 2016 I want to do the same thing in your PG, but by moving the gizmo, it moves the point to the line. It's for my editor, I want to create a pathfinding for the PNJ follow a path. but in my editor, the user can change the path with the gizmo Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 30, 2016 Share Posted November 30, 2016 @Dad72 You want to stretch/shrink the line? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 30, 2016 Author Share Posted November 30, 2016 Yes, I want to move in any direction, and that the point of the line is still attached to the cylinder. Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 30, 2016 Share Posted November 30, 2016 Like this? http://www.babylonjs-playground.com/#YCVDD#6 Quote Link to comment Share on other sites More sharing options...
adam Posted November 30, 2016 Share Posted November 30, 2016 I would use a LineSystem and each point in the array would be the position of your points meshes (like I did in the PG). Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 30, 2016 Share Posted November 30, 2016 @Dad72 Do you have a custom version of the edit control in your PG? You have "free rotation" and that is not in Satgurus original code. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 30, 2016 Author Share Posted November 30, 2016 8 minutes ago, DigiHz Data said: Like this? http://www.babylonjs-playground.com/#YCVDD#6 No, This all moved the line, I want to move one single point (one or the other) Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 30, 2016 Share Posted November 30, 2016 @Dad72 But you not have any "points", you mean that you want to move one of the cylinders but keep the line attaches while moving the selected cylinder? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 30, 2016 Author Share Posted November 30, 2016 Yes Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 30, 2016 Author Share Posted November 30, 2016 I think that the ideal would be to connect points (vector3) as: line.points[0].parent = box; There are points in a line: var points = [cylinder1.position, cylinder2.position]; var line = BABYLON.Mesh.CreateLines("lines", points, scene, true); But points is not accessible in the line. Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 30, 2016 Share Posted November 30, 2016 @Dad72 Almost there i think. http://www.babylonjs-playground.com/#YCVDD#7 Quote Link to comment Share on other sites More sharing options...
adam Posted November 30, 2016 Share Posted November 30, 2016 11 minutes ago, Dad72 said: I think that the ideal would be to connect points (vector3) as: line.points[0].parent = box; A Vector3 doesn't have parent property. Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 30, 2016 Share Posted November 30, 2016 @Dad72 This is what you want? http://www.babylonjs-playground.com/#YCVDD#8 Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 30, 2016 Author Share Posted November 30, 2016 Yes, that's right DigiHZ. Big thanks for your help. Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 30, 2016 Share Posted November 30, 2016 BTW Dad72. I know you not write english so good, you told me that before, but.-.... Do you read and understand english good? Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 30, 2016 Share Posted November 30, 2016 Your welcome @Dad72 Keep in mind that it is a speciall version of edit control that i am using. It only uses eular. Quote Link to comment Share on other sites More sharing options...
adam Posted November 30, 2016 Share Posted November 30, 2016 @DigiHz Data Why are you disposing the lineMesh? Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 30, 2016 Share Posted November 30, 2016 @adam I not know how to update the lines positions. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 30, 2016 Author Share Posted November 30, 2016 3 minutes ago, DigiHz Data said: Do you read and understand english good? Yes, my translator well translate the English to the french, but not very well french into English. Thanks again Quote Link to comment Share on other sites More sharing options...
adam Posted November 30, 2016 Share Posted November 30, 2016 2 minutes ago, DigiHz Data said: I not know how to update the lines positions. Look at my PG. DigiHz Data 1 Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 30, 2016 Share Posted November 30, 2016 @adam You mean like this instead? http://www.babylonjs-playground.com/#YCVDD#9 Dad72 1 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.