Varsha Kamble

Sample code for features in babylonEditor

Recommended Posts

@Ravi Sure, I can try to do that, would a flag on the rotation gizmo such as lockScale that when set to true and dragging occurs scales the mesh equally or are you looking for another gizmo type like the triangle in your video?

Share this post


Link to post
Share on other sites

Hi @trevordev ,

Triangular representation is standard and is used widely in 3D softwares. If you could implement triangular representation as per video then that will be great. I have used 3DS Max for recording video. @Dad72 has also mentioned the full model scaling scenario which indicates its globally acceptable feature. Thanks @Dad72 for mentioning that here.

Share this post


Link to post
Share on other sites

Thanks @Dad72 and @Ravi for the feedback sorry for the delayed response (I was out for a week+), 

Snapping: this is possible today via

var gizmoManager = new BABYLON.GizmoManager(scene)
gizmoManager.positionGizmoEnabled=true;
gizmoManager.gizmos.positionGizmo.xGizmo.snapDistance = 0.3
gizmoManager.gizmos.positionGizmo.yGizmo.snapDistance = 0.3
gizmoManager.gizmos.positionGizmo.zGizmo.snapDistance = 0.3

    but I will add a helper method for this

gizmoManager.gizmos.positionGizmo.snapDistance = 0.3;

Possibilities to define euler
    In Babylon, I believe it is recommended to always use Quaternions instead of euler angles. 
    If you wish to continue using euler angles you can always use the methods to convert Quaternions to euler and vice verca.

BABYLON.Quaternion.RotationYawPitchRollToRef
quaternionObj.toEulerAnglesToRef

Add layerMask to the gizmo:
    One of the goals when creating the gizmos was to avoid modifying the existing scene. 
    To avoid this it uses the UtilityLayerRenderer which creates another scene that is overlayed on top of the original.
    Because of this, unfortunately, I don't believe the layer mask would have any effect. 
    What you could do to work around this is to use another UtilityLayerRenderer for the minimap and place on the minimap contents in the UtilityLayerRenderer's scene.

Triangular equal scaling gizmo:
    @ravi Sure I will take a stab at creating a new gizmo type for this. https://github.com/BabylonJS/Babylon.js/issues/4844

Hopefully these resolutions are acceptable.
 

Share this post


Link to post
Share on other sites
On 7/28/2018 at 2:25 AM, trevordev said:

Thanks @Dad72 and @Ravi for the feedback sorry for the delayed response (I was out for a week+), 

Snapping: this is possible today via


var gizmoManager = new BABYLON.GizmoManager(scene)
gizmoManager.positionGizmoEnabled=true;
gizmoManager.gizmos.positionGizmo.xGizmo.snapDistance = 0.3
gizmoManager.gizmos.positionGizmo.yGizmo.snapDistance = 0.3
gizmoManager.gizmos.positionGizmo.zGizmo.snapDistance = 0.3

    but I will add a helper method for this


gizmoManager.gizmos.positionGizmo.snapDistance = 0.3;

Possibilities to define euler
    In Babylon, I believe it is recommended to always use Quaternions instead of euler angles. 
    If you wish to continue using euler angles you can always use the methods to convert Quaternions to euler and vice verca.


BABYLON.Quaternion.RotationYawPitchRollToRef
quaternionObj.toEulerAnglesToRef

Add layerMask to the gizmo:
    One of the goals when creating the gizmos was to avoid modifying the existing scene. 
    To avoid this it uses the UtilityLayerRenderer which creates another scene that is overlayed on top of the original.
    Because of this, unfortunately, I don't believe the layer mask would have any effect. 
    What you could do to work around this is to use another UtilityLayerRenderer for the minimap and place on the minimap contents in the UtilityLayerRenderer's scene.

Triangular equal scaling gizmo:
    @ravi Sure I will take a stab at creating a new gizmo type for this. https://github.com/BabylonJS/Babylon.js/issues/4844

Hopefully these resolutions are acceptable.
 

Awesome. This is working fine. Thanks for your help! Will check with larger models and let you know the results.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.