HomefieldOfView | SPi-V dev

Navigation

user

shorter way to one pan value to another

I have built a tour containing many panos and hotspots and we would like to have a transition during which the camera is animated. The camera will zoom and center to the hotspot you have just clicked before going to the other scene.

I have a solution that works pretty well but there is a problem when the hotspot is near pan value or 180.0. For instance if hotspot pan is 170.0 and the camera pan is at -170.0 when the user click on the hotspot, my ramp will make the camera do a 340° from -170.0 to 170.0 instead of taking the shorter way from -170 to -190 (equivalent to 190 down to 170). I have tried to find a formula with many getProperty, max, min, abs and so on this has proved to be quickly overcomplicated for a pretty simple and usual need.

A good solution would be to have a simple function that would be usable with in value expression used by setProperty. The function I suggest would work in the following way :

on angleBetween(aAngle1, aAngle2)
  tDelta = aAngle2 - aAngle1
  repeat while tDelta <= -180.0
    tDelta = tDelta + 360.0
  end repeat
  repeat while tDelta > 180.0
    tDelta = tDelta - 360.0
  end repeat
  return(tDelta)
end

The return tDelta values would always gives the shorter angle from aAngle1 to aAngle2, expressed between -180 and +180

I would then be able to adjust value2 of my ramp to value1+tDelta as returned by my function.

A more generic to implement this would be to let us define our own lingo function usable in expression within a xml node, that you would add to Spi-V dynamically setting the scriptText of a new movie scripts.
Sometimes, things that are easy to program with a few if then else or repeat loops are impossible to express with a single math expression.

Re: shorter way to one pan value to another

I am looking in to the most elegant solution for the problem for SPi-V 1.4

I don't want to offer a full Lingo interface, because it will make SPi-V too dependent on Shockwave. My aim is still to have an XML format that is independent of the underlying platform, and tieing in with a language makes the spec less portable in my opinion.

Re: shorter way to one pan value to another

Is there any solution to this problem introduced in Spi-V 1.4beta 1 ? using variables ? or a new undocumented function available with setProperty ?

Re: shorter way to one pan value to another

Improvements to the ramp node are slated for a later beta

Re: shorter way to one pan value to another

This has been fixed with minValue and maxvalue attributes of the ramp node introduced in 1.4.1. It's now easy to make this kind of ramp by setting minvalue to -180 and maxvalue to 180, then adjusting the pan to the ramp value.

But there is a terrible lack of documentation about these new attributes in the nodes specs. I have just found them by chance in 1.4.1 minimal release notes ;-)

Re: shorter way to one pan value to another

I am also complaining about lack of documentation. Who else?

Re: shorter way to one pan value to another

Whining will get you nowhere

Re: shorter way to one pan value to another

Thanks for adding a note here.