satguru Posted March 13, 2016 Author Share Posted March 13, 2016 On vacation . Will get back soon. Quote Link to comment Share on other sites More sharing options...
Voobus Posted March 13, 2016 Share Posted March 13, 2016 Good, it will give me some time to fix some pretty big bugs in my translated version... I have no idea what's wrong, since it's a 1:1 translation... Fixed! One of the bugs was just a silly typo, one was a missing 'this' on a property (since JS classes don't know their own local vars, so you have to reference them as properties on itsself), and one was some funky behaviour with the rotation axis that I fixed by just copy/pasting your java and changing it. I must have made a mistake in the first attempt. I now have it running locally in an electron app. I copy/pasted your demo's HTML and JS, and it now works, and seems to be 100% caught up to your version. Hope to speak to you when you get back from vacation. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
satguru Posted March 18, 2016 Author Share Posted March 18, 2016 @Dad72, Thanks for following up on the issue and getting it resolved. @Voobus Nice work!. Never thought about running it in Electron. Now that I think about it, Electron might make a good platform for creating a scene editor. Regarding making my code more module friendly I think I can do that. JSweet, which is what I used to write this, does provide options to package it as such. I will make those changes and you can let me know if that helps. Regarding collaborating on this, my knowledge of JavaScript is weak, (which is why I use Java and JSweet) so I may not be of much help there but I can definitely help you figure out my code in case you get stuck. From the looks of it though, you seem to have a pretty good handle on this already Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 18, 2016 Share Posted March 18, 2016 I still have the problem for very sensitive rotations for certain object. Quote Link to comment Share on other sites More sharing options...
satguru Posted March 18, 2016 Author Share Posted March 18, 2016 @Dad72 Can you provide a video of the issue? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 18, 2016 Share Posted March 18, 2016 I'll try to make a video for you soon. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 19, 2016 Share Posted March 19, 2016 I was thinking of sampling some of the script from this. Thanks for the example. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 19, 2016 Share Posted March 19, 2016 Here is a video where we see the extremely sensitive rotation. I can not turn the character of 45 degree for example. http://www.babylon.actifgames.com/rotation_bug.mp4 You can see the short trips of my mouse. @Pryme8 : the code source JS is here : https://github.com/ssatguru/BabylonJS-EditControl/blob/master/webapp/js/org/ssatguru/babylonjs/component/EditControl.js Thanks Satguru Quote Link to comment Share on other sites More sharing options...
satguru Posted March 19, 2016 Author Share Posted March 19, 2016 @Dad72, Thanks for the video. That helped 1) do you have the same issue in 2.3? 2) what is the scale of the object ? 3)comment out this line and see if that helps https://github.com/ssatguru/BabylonJS-EditControl/blob/master/webapp/js/org/ssatguru/babylonjs/component/EditControl.js#L440 4)do you have some code which I can play around with ? Maybe something in the playground? Thanks Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 19, 2016 Share Posted March 19, 2016 Hi, 2 hours ago, satguru said: 3)comment out this line and see if that helps Yes commenting the line you say, it fixed the problem. 2 hours ago, satguru said: 4)do you have some code which I can play around with ? Maybe something in the playground? I made you a little PR for testing: http://www.babylonjs-playground.com/#GA8XI#33 Quote Link to comment Share on other sites More sharing options...
satguru Posted March 20, 2016 Author Share Posted March 20, 2016 Glad it worked for you. I will be moving that change and hopefully module changes sometime in the coming week. Very busy with my "Vishva" project ? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 23, 2016 Share Posted March 23, 2016 There is a bug that when an object is the last object you want to click. On this PR there is a sphere behind the character and if I want to click on the character and move, it is not possible. Try to comment out the sphere and it works. I try to see if it had not Picked babylon. rather, it comes from EditorControl. I tested here: http://www.babylonjs-playground.com/#1GDJ17#1 Also, there is an error with 'parent' in your class (after clcik on "Run"), but I do not know where. Bug here: http://www.babylonjs-playground.com/#GA8XI#51 Quote Link to comment Share on other sites More sharing options...
satguru Posted March 23, 2016 Author Share Posted March 23, 2016 @Dad72 There is a problem with the logic. Your scene.pointerDown is switching editControl before editControl can do anything see http://www.babylonjs-playground.com/#GA8XI#53 This works. I just added "scene.onPointerDown = function () { };" I will look into the 'parent' error Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 23, 2016 Share Posted March 23, 2016 May sound can no longer select the sphere then. If you select one the other can not be selected. Quote Link to comment Share on other sites More sharing options...
satguru Posted March 23, 2016 Author Share Posted March 23, 2016 It is possible. You just need to figure out the logic Here is one way to do this http://www.babylonjs-playground.com/#GA8XI#56 This uses right click to select item. I just added the following line if ((evt.button != 2)) return; Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 23, 2016 Share Posted March 23, 2016 I understand the logic, but I do not find convenient to have to select an object by right-click and move with the left click or the reverse. On my editor I already use right click to display a menu. Quote Link to comment Share on other sites More sharing options...
satguru Posted March 23, 2016 Author Share Posted March 23, 2016 maybe a "double click" or a flag - "if (selectFlagOn and leftClick) then select else do nothing ". I am writing an editor (sort of ) and I use right click in my editor to select. Not sure what I can do in the EditControl. Quote Link to comment Share on other sites More sharing options...
satguru Posted March 23, 2016 Author Share Posted March 23, 2016 What if I provide a function to check if the pointer is over the editcontrol? Maybe "editControl.isPointerOver()" ? then you could do something like if (pickResult.hit) { if (editControl && editControl.isPointerOver()) return; var EditControl = org.ssatguru.babylonjs.component.EditControl; if (editControl) editControl.detach(); editControl = new EditControl(pickResult.pickedMesh, camera, canvas, 1.0); editControl.enableTranslation(); } Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 23, 2016 Share Posted March 23, 2016 This could be useful, yes: editControl.isPointerOver() Thanks you Satguru Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 23, 2016 Share Posted March 23, 2016 I used the variable this.prevOverMesh. is it works if (editControl && editControl.prevOverMesh) return; Quote Link to comment Share on other sites More sharing options...
satguru Posted March 24, 2016 Author Share Posted March 24, 2016 "prevOverMesh" will not work all the time. I have added the function "isPonterOver()" http://www.babylonjs-playground.com/#GA8XI#61 Latest changes here https://github.com/ssatguru/BabylonJS-EditControl/releases Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 24, 2016 Share Posted March 24, 2016 Thank you Sutguru. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 25, 2016 Share Posted March 25, 2016 @satguru The "parent" bug came from Babylon. it has been corrected here: Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 26, 2016 Share Posted March 26, 2016 @satguru Nice work, bro! I'm not sure I understand what an editControl IS, but maybe I do... and it seems ingenious! After a person finishes manipulating a mesh or 20, can the editControl produce the JS code lines that "keeps" the state of the object (after the editControl is disconnected from the mesh) ? I should just read the docs for it, eh? Now, about this Vishva thing: https://www.google.com/search?q=Vishva&tbm=isch This Vishva? I would be VERY willing to be a power collaborator on THAT project, I would. Do tell! Quote Link to comment Share on other sites More sharing options...
satguru Posted March 26, 2016 Author Share Posted March 26, 2016 @Wingnut Once the editControl is disconnected from the mesh it "forgets" everything about the mesh. While it is connected to the mesh, the only information it maintains about the mesh are the actions that were performed on the mesh, so that it can do "undo"s and "redo"s. This information is also lost when it is disconnected from the mesh. Regarding Vishva.. dream on buddy Just means "World" or to be more pompous, https://en.wikipedia.org/wiki/Vishva It is a simple live scene editor that I have been struggling with for the last couple of months. I think I have finally figured out the direction I want to take it to. Hopefully soon, would have a very "alpha"ish version to show Wingnut 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.