Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to modify the speed of panning and zooming when mouse move and mouse wheel scroll #110

Open
zyjiang0571 opened this issue Aug 22, 2018 · 0 comments

Comments

@zyjiang0571
Copy link

zyjiang0571 commented Aug 22, 2018

Hi all,
I want to make some change of PickFlyOrbit parameter. So, I add some code in 3dview.html, see the following:

this.load = function(){
		var promise = new BimServerApiPromise();
		debugger
		o.viewer = new BIMSURFER.Viewer(Global.bimServerApi, 'viewport');
		Global.viewer = o.viewer;  // added by jiang
		$(window).resize(o.resize);
		o.resize();
		o.viewer.loadScene(function(){
			Global.scene = o.viewer.scene;			
			debugger;
                        var clickSelect = o.viewer.getControl("BIMSURFER.Control.ClickSelect");			
	                clickSelect.activate();
	                clickSelect.events.register('select', o.nodeSelected);
			clickSelect.events.register('unselect', o.nodeUnselected);
                        // added by me ---begin
	               var panOrbit = o.viewer.getControl("BIMSURFER.Control.PickFlyOrbit");						
	               panOrbit.activate();			
	              panOrbit.rate = panOrbit.rate * 5;
	              var eyepos = {x: 0.0, y: 1.0, z: 1.0};
	              panOrbit.eye = eyepos;			
	              alert("loadScene's callback");
	              // added by me ---end
	              promise.fire();
	         }, {useCapture: true});
	return promise;
};

But it does not work!
And, I found that the activate() function of PickFlyOrbit is called twice. The 1st time is in the above callback function. The 2nd time is called by bimviews itselft. So it does not work and I think I should change the parameter(such as the rate) after the 2nd time call of activate().
So, how can I do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant