You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, December 16th 2022, 1:19pm

How does "set(control, mouse=drag, touch=drag);" work? (from krpano example)

Hello,

I was reviewing krpano examples code and found one line which I couldn't understand.
Example - https://krpano.com/viewsource.html?releases/1.20.11/examples/../viewer/examples/control-mode/example.xml

Quoted

onclick="set(control, mouse=drag, touch=drag);.."

I have just learned that I could set multiple values to an object, but

In the code above, the "control" object does not have mouse/touch attributes and it seems that the "drag" values belong to "control.mode" attribute.

So the shouldn't the code be something like

Quoted

onclick="set(control.mode, mouse=drag, touch=drag);.."



or

Quoted


onclick="set(control, mode.mouse=drag, mode.touch=drag);.."

I have tried both but none of them work.

Can someone explain how "set(control, mouse=drag, touch=drag);" exactly work?


Thank you in advance!
Hyung


2

Friday, December 16th 2022, 3:15pm

you are right, the documentation is confusing here...
control.mouse and control.touch are both not mentioned in the attributes

but in the examples they are
<control mouse="drag" touch="drag" />

maybe thats an error in the docs...

as the example still works it seems that mouse / touch are working attributes
i'd guess they were replaced by control.mode and are deprecated but kept for compatibilty reasons
*huh*

This post has been edited 9 times, last edit by "indexofrefraction" (Dec 17th 2022, 7:37pm)


kme

Intermediate

Posts: 260

Location: Belgium

Occupation: Long time coder, product manager and 3D enthousiast

  • Send private message

3

Saturday, December 17th 2022, 12:02pm

Found some more undocumented functions/variables in the code examples:

view.ox_rotated
view.oz_rotated
view.oy_rotated

and

lookto(0,0,90,default,true,true); (this is documented in https://krpano.com/docu/actions/#lookto)

But I read that klaus is working on the release of the .21 and is also updating documentation that comes along with it, so fingers crossed *thumbsup* *thumbsup*

This post has been edited 1 times, last edit by "kme" (Dec 17th 2022, 1:04pm)


4

Saturday, December 17th 2022, 12:17pm

Yes, I think I should wait for the next version of documentation.

Thank you for your replies!


Cheers!
Hyung

5

Saturday, December 17th 2022, 7:17pm

view.ox_rotated
view.oz_rotated
view.oy_rotated

i think this is the view / camera position after view rotation

This post has been edited 5 times, last edit by "indexofrefraction" (Dec 17th 2022, 8:07pm)


kme

Intermediate

Posts: 260

Location: Belgium

Occupation: Long time coder, product manager and 3D enthousiast

  • Send private message

6

Sunday, December 18th 2022, 6:44pm

view.ox_rotated
view.oz_rotated
view.oy_rotated

i think this is the view / camera position after view rotation


I found it back in: https://krpano.com/docu/xml/#view.ox_rotated

Kind of weird that I did not find them before: when I go directly to https://krpano.com/docu/xml/ these values are not there, but using the previous link, they are *confused* *confused*
Ah, nevermind, it's only visible when you use "advanced" on the "view" tag... so much for using "find" in the page *unsure*