setProperty
Description
Sets a property of an element that is currently loaded (in the current scene or global node).
Not all properties of an element are dynamically settable. See the nodes documentation for details on settable properties.
Syntax
Action:
<action event="ready" type="setProperty" target="panoelement1" property="visible" value="false"/>
API call:
setProperty("panoelement1","visible","false")
Arguments
-
target
ID of a currently loaded element. -
property
Property/attribute of the referenced element. -
value
New value to set the property to. -
flags
Comma delimited options for the getProperty call. Options include:persistent
Also change the persistent value in the XML document, instead of just the active instance.
History
- 23-Mar-07: Added flags
- 13-Jan-06: Initial version
fieldOfView | SPi-V dev
What mathematical ...
Hi Aldo,
What mathematical functions can be used in e.g. setProperty call.
example:
type="setProperty" .... value='=randomFloat(-1,1)'
The following functions are used in some of your examples:
+ - * / randomFloat()
following work too: abs() sign() integer()
What other function can be used?
I tried floor() ceil() round(), but they seem not to work.
Any suggestions?
Thanks
These are the legal
These are the legal functions you can use with the value="=..." syntax:
"getproperty",
"abs", "max", "min", "random", "randomfloat",
"integer", "float", "string", "bool",
"sin", "cos", "tan", "sqrt", "power", "log"
You can use integer() instead of floor, ceil and round(). Integer rounds 'logically' (ie: 1.4 -> 1, 1.5 -> 2)
I'll considder adding sign().
That's great ...
That's great. Thanks a lot.
Interesting:
sign() is working already in the current release!!!!
So no need to do anything, unless it's a "illegal" function. ;-)
it shouldn't
Could you post a link with an example where sign() works?
Here it is ...
Here it is, the example:
http://panoquest.net/sign_test.html
More or less self explaining. Using API calls from java script, ramps as local vars ;-) and finally the sign function. With the buttons you can pass the shown values to the SPi-V environment.
BTW:
How many ramps can be used in a tour, and what is the value range of the ramp value? (double float?)
silly bug...
Hmm, silly bug in SPi-V. Fixed in upcomming 1.3.4 release, which adds 'real' support for sign().
Very creative use for ramp nodes...
There's no limit to the number of ramps (ok, maybe something like 65536), other than performance. The range of a float in Shockwave is between 2 to the power of 1024 and -(2 to the power of 1024). But I am not sure the ramp likes going over (-) 949999999999, after which Shockwave uses the 9.5e11 notation. Haven't tested that though...
getting mouse or panoelement location ?
Is there a way to place something like a uielement at or near the location of the mouse or a panoelement. Can we use properties like "the mouseH" or "the mouseV" in value argument of setProperty ? The ideas behind this question is :
- placing a non-distorted text at the location of the mouse when rolling over a hotspot
- Displaying a non-distorted image or animation at the location of a hotspot whom size would not be dependant of the field of view
But perhaps there are other simpler solutions that I have missed.
Re: getting mouse or panoelement location ?
Is it now possible to put interactive text near mouse cursor that will move with mouse movements in some parts of panorama?
ebeuque proposed in 2006 nodes like mouseH ands mouseV...
Karol
Re: getting mouse or panoelement location ?
What ebeuque asked for has been possible for a while.
getProperty("_mouse","x")getProperty("_mouse","y")