70001681 Support CmdRotate 3d on WebControl

Article 70001681
Type Wish
Product WebJS
Version 8003
Date Added 2/3/2020
Fixed 8.8004.0.3 (2/11/2020)
Submitted by Bogumil

Summary

I would like to be able to determine the rotation axis in order to rotate 3d an entity.

Solution

In version 8004.0.3 new command CmdRotate3D was added in vdrawObj with an extra parameter at the end which defines the axis rotation.Also scriptCommand rotate3d was added.

vdrawObj.CmdRotate3D(object entities, object rotationCenter, double angle, object axis)
Example: Start a new user action rotate3D command around the Y axis.
vdrawObj.CmdRotate3D(null, null, null, [0,1,0]);

vdrawObj.scriptCommand.rotate3d(object originPoint, double rotation, object axis, ScriptSelectDelegate callback)
Example: Start a new user action rotate3D command around the X axis.
vdrawObj.scriptCommand.select(null,function (_vdcanvas) { _vdcanvas.scriptCommand.rotate3d(null, null, [1,0,0]); } );

Axis Rotations:
[1,0,0] for rotation about X
[0,1,0] for rotation about Y
[0,0,1] for rotation about Z same as simple CmdRotate

Send comments on this topic.