Jump to content

Sample code for features in babylonEditor


Varsha Kamble
 Share

Recommended Posts

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.

Link to comment
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.
 

Link to comment
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.

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...