Jump to content

BabylonJS EditControl


satguru
 Share

Recommended Posts

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.

Screen Shot 2016-03-13 at 9.08.40 AM.png

Link to comment
Share on other sites

@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 :)

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

@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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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();	
        }

 

Link to comment
Share on other sites

@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!

Link to comment
Share on other sites

@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 :P

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 :)

 

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...