Opened 14 months ago

Last modified 6 weeks ago

#31601 new defect

threejs does not allow to rotate the object in any direction

Reported by: tmonteil Owned by:
Priority: major Milestone: sage-9.7
Component: graphics Keywords:
Cc: egourgoulhon, gh-jcamp0x2a, paulmasson, slelievre, gh-guenterrote Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Here is an example to reproduce it yourself:

theta,z=var('theta,z')
c = cylindrical_plot3d(2,(theta,0,2*pi),(z,-5,5))

Compare

c.show(aspect_ratio=1)

with

c.show(viewer='jmol', aspect_ratio=1)

In the threejs case, it is only possible to rotate the cylinder around its own axis, and along one horizontal axis. For example, it seems impossible to turn the cylinder so that it looks horizontal.

Change History (5)

comment:1 follow-up: Changed 14 months ago by gh-jcamp0x2a

The viewer currently uses Three.js's OrbitControls to control the camera: https://threejs.org/examples/#misc_controls_orbit

Three.js also has a TrackballControls that might be useable with a bit of modification to the viewer: https://threejs.org/examples/#misc_controls_trackball

The trackball controls have no fixed "up" direction like the orbit controls. Is that similar to what you had in mind?

comment:2 in reply to: ↑ 1 Changed 14 months ago by tmonteil

Replying to gh-jcamp0x2a:

The viewer currently uses Three.js's OrbitControls to control the camera: https://threejs.org/examples/#misc_controls_orbit

Three.js also has a TrackballControls that might be useable with a bit of modification to the viewer: https://threejs.org/examples/#misc_controls_trackball

The trackball controls have no fixed "up" direction like the orbit controls. Is that similar to what you had in mind?

Yes it seems that TrackballControls would do the job, though it should still be tested within Sage context.

comment:3 Changed 10 months ago by mkoeppe

  • Milestone changed from sage-9.4 to sage-9.5

comment:4 Changed 5 months ago by mkoeppe

  • Milestone changed from sage-9.5 to sage-9.6

comment:5 Changed 6 weeks ago by mkoeppe

  • Milestone changed from sage-9.6 to sage-9.7
Note: See TracTickets for help on using tickets.