• Content Count

  • Joined

  • Last visited

About yzthr

  • Rank

Profile Information

  • Location

Recent Profile Visitors

346 profile views
  1. Hi, Wingnut! So nice of you! Your PG inspired me. You use animation to your box in PG. So i think it will be possible to use animation in my camera. I find a topic about ArcRotateCamera animation, it's very useful. As to the problem of smallest angle to rotate, we can determine whether the rotation angle larger that PI(L105-125). Then i use the function in ExecuteCodeAction and it works. Here is my new Playground. may be it will help somebody. And I think that camera.lockedTarget act incorrectly. It acts like camera.setTarget but not "locked to" mesh.
  2. Thank u very much, Wingnut! The space demo is brilliant. The above two demos both use mesh.rotation.x/y/z property. But I wanna rotate the camera instead of rotation of meshes because my scene is so big which contains a lot of different meshes(or if i change another scene by import, i will rewrite some code). Otherwise i will rotate so many meshes all together(so much matrix calculation will cost a lot of time(in 3D especially)). It seems that mesh.rotation ranges from 0 to 2PI or -Pi to Pi, but camera.alpha ranges from positive infinite to negative infinite? I am totally agree that your camera.lookAt({position: anyPosition} or {direction: anyDirection},duration) is needed. It is necessary.(Haha) I think it's possible to use actionManager to solve roatation problem. When i use a ExecuteCodeAction before InterpolateValueAction, it seems that InterpolateValueAction statement execute before the ExecuteCodeAction. Then i make an experiment to use combineAction, and the execution is in the same order. Is there any posible way to make sure that the actions execute in the correct order or is it possible to pass return result to InterpolateValueAction statement? Thank you again for your reply.
  3. Hi Sebavan! I make a experiment to make sure that it is not the problem with the parenthesis. I use a ExecuteCodeAction before InterpolateValueAction.(add codes from L105-133) Here is the new PG and the camera also rotate incorrectly. And I think that there is nothing wrong with the parenthesis and there is no need to use a callback. Because when u click the button, it will calculate a new 'alpha'.
  4. Thank you, Wingnut! your experiments can solve the problem partly, but sometimes the camera also rotate abnormal(when cam_initial_alpha larger than 2Pi), it rotates an angle larger than Pi to go back to the original position. And i think it will be better to put the code that calculates cam_initial_alpha into the leftpicktrigger action. (code in BeforeRender will effect the performance) BTW: I don't know why the codes don't work. "sphere.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnLeftPickTrigger, camera, "alpha", (Math.PI+camera.alpha-(camera.alpha)%(2*Math.PI)), 500, condition2));"
  5. I find camera.alpha goes larger when i rotate the scene clockwise. If camera.alpha=0 or 2*Pi or ...2n*Pi, the scene will look the same. So i consider to calculate the (2n*Pi) so that the camera will not rotate too much circles. Here is the formula: camera.alpha-(camera.alpha)%(2*Math.PI); I change the code (line 105) as below: sphere.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnLeftPickTrigger, camera, "alpha", (Math.PI+camera.alpha-(camera.alpha)%(2*Math.PI)), 500, condition2)); but the camera rotate back to the original position as usual. new Pg:
  6. Hi guys! I find a problem that i can't make the arcrotateccamera rotate to the nearest 'destination'. here is the PlayGround. https://www.babylonjs-playground.com/#RVZ1O#2 Rotate several circles around the center, then click the purple button. You will find meshes rotate back quickly to the original position before rotation. I want the purple button rotate to the position which camera.alpha=0 or PI but not rotate to the original position(for instance, the button just rotate a angle about -PI/2).
  7. Hi, Sebavan! I find the bug only in my playground in latest version(4.0). And it's OK in stable version. Here is my PG.
  8. hi guys! I find some bugs in new Inspector. When i click "show gizmo" button, the node will disappear. then click button in DEBUG tag for example:"Display axes", after that i can't rotate the camera. shotscreen:
  9. Oh, I find it was my mistake that my project have 2 html file and i just reference babylonjs.laoders.js once. So the problem is solved. Sorry for wasting for time and Thanks for all above.
  10. thank you for your answer! i just use Max2babylon plugin to export the .gltf file as usual. And i test to load the .gltf file in a plain html file and it works. I don't think anything about producer tag is wrong.
  11. Thank you for your reply. sorry for my misunderstanding. i used the source: "https://preview.babylonjs.com/loaders/babylonjs.loaders.js" in my project for test for sure. And also sorry for not sharing my code because the project is so big and i have tried my best to make sure that there is no error in other part of my project(as mentioned above: i can load .babylon file correctly). Please forgive me for my poor english.
  12. Yes, i search the whole file, but i can't find anything about "importScene´╗┐ of undefined" or "loadAssts´╗┐ of unknown".
  13. Hello, recently i met a problem and it really troubles me. I use BABYLON.SceneLoader.Append() to load the .glb file(export from Max2babylon plugin) and it failed. The browser said: "Unable to load from ../BIM/incremental/helin.glb: importScene of undefined from undefined version: undefined, exporter version: undefinedimportScene has failed JSON parse". then i load the .gltf file, The browser said: "Unable to load from ../BIM/incremental/helin.gltf: loadAssts of unknown". It's really wired, huh? After that i use the same project load .babylon file(also export from Max2babylon plugin) correctly to make sure it's not the problem with project. And i test to load the .gltf file in a plain html file and it works, so i think it's no the problem with the file and the peoject. So i think it's a bug.(no offense)
  14. Hi, i have already post the screenshot of the function "createGUI", after that i just call the function once to create the GUI. Sorry for not posting the code cauz the code has not been finished yet. I think it's a bug.
  15. Yes, u're right. but "addControl" is also undefined.