BangTao Posted January 14, 2017 Share Posted January 14, 2017 hi.me again//// Q1:Look at this PG.i set the position x and y to 5.Is there anything I missed?http://www.babylonjs-playground.com/#2KXNQ6#6 Q2:this.http://www.babylonjs-playground.com/#24NW28,,and i wanna check the red ball and the wihte ball(tmpDistance and shortest) every time i change the ball's position in the loop ..but it didn't work.. and if i set ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ var octreeSub = {X: 100, Y: 100, Z: 100}; i can't get the green box...which is http://www.babylonjs-playground.com/#2KXNQ6#7 thank u thank u. > < Quote Link to comment Share on other sites More sharing options...
JohnK Posted January 14, 2017 Share Posted January 14, 2017 @BangTao hi again you have asked similar questions two or three times and jumped into Mesh Facet Data thread with a PG combining a little of what you were doing with some of what I showed you and some very new methods without a full understanding- result confusion. Please take a deep breath and think through what you want. You are tending to ask technical questions about your code without telling us what you want to achieve.. You could explain what you want to do overall and the particular area that is causing problems and diagrams could help. So while the following description may not be what you want to do, use it as a basis to try to explain your project and problems together with your playground. I have a 3D grid of cells within this grid there is a large sphere and a small sphere. The small sphere moves around in the cells when it hits the large sphere it changes color. I am using a for loop for the animation and it is not working. How do you animate the small sphere so that I can check when it hits the large sphere. I have produced a playground without the cells to show my problems with animation. Also I have seen that you have been trying to use scene.registerAfterRender or scene.registerBeforeRender here are some links of them in action that might help you learn about them. http://www.babylonjs-playground.com/#92EYG#10 http://www.babylonjs-playground.com/#1JLGFP http://www.babylonjs-playground.com/#1JLGFP#3 Basically they deal with changing properties of a mesh after or before each frame is drawn that way is one method of animating a mesh.. jerome 1 Quote Link to comment Share on other sites More sharing options...
BangTao Posted January 14, 2017 Author Share Posted January 14, 2017 @JohnKThank u for reply me,i'm new this,so..and there will be many problems for me...hope u don't mind it.I've take a very deep breath,and come again~~and i kinda know what i'm i want...erm ... i wanna use the " for loop " to control the red little ball's move path (seems like there missed something),not useing scene.registerAfterRender.but if i directly use "for loop",i cant get the Facet Data to check if ...collision Quote Link to comment Share on other sites More sharing options...
JohnK Posted January 14, 2017 Share Posted January 14, 2017 Because of the way Babylonjs works you cannot use a for loop the loop will finish before the ball is drawn. Quote Link to comment Share on other sites More sharing options...
dbawel Posted January 16, 2017 Share Posted January 16, 2017 Cloning and repeating on seperate clones perhaps? DB GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
BangTao Posted January 16, 2017 Author Share Posted January 16, 2017 @dbawel thx,now ,i can create a custom mesh,and can get the all vertexs。 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.