|
From: cheribhai <cha...@gm...> - 2010-03-23 16:58:24
|
Hello Braden,
The problem seems to be occurring when the field of an
external node is changed in a script node. I have attached an example where
I try to toggle between the binding of two viewpoints from a script. The
bind values remain unchanged when using simple assignment.
Cheers - Cherian
http://old.nabble.com/file/p28003831/jsassign.wrl jsassign.wrl
Braden McDaniel wrote:
>
> On Mon, 2010-03-01 at 04:40 -0800, cheribhai wrote:
>>
>> Hello,
>> A quick question on vector asssignment using openvrml. I have a
>> javascript function where I am dynamically changing the key values of a
>> position interpolator, but the assignment does not seem to work.
>> I have tried
>> PosInter.keyValue[1][0] = targetPosition[0]; // x
>> PosInter.keyValue[1][0] = targetPosition[1]; // y
> ^
> a typo, presumably. :-)
>
>> PosInter.keyValue[1][2] = targetPosition[2]; // z
>
> First off, you need to be using directOutput TRUE in order to set the
> node field like this.
>
> But assuming you've done that, I think this still doesn't work because
> you end up setting the elements of a temporary SFVec3f that keyValue[1]
> returns. I think there's an argument to be made that this syntax should
> work; but I haven't found a good way to do that with SpiderMonkey.
>
> It should work to set the entire SFVec3f element at once:
>
> PosInter.keyValue[1] = targetPosition;
>
>> and also
>>
>> PosInter.keyValue = [0 0 0, targetPosition[0] targetPosition[1]
>> targetPosition[2]];
>>
>> but both don't work.
>
> MF* types are not JavaScript arrays; so I wouldn't expect that to work.
>
> --
> Braden McDaniel <br...@en...>
>
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> openvrml-develop mailing list
> ope...@li...
> https://lists.sourceforge.net/lists/listinfo/openvrml-develop
>
>
--
View this message in context: http://old.nabble.com/Vector-Assignment-tp27742867p28003831.html
Sent from the openvrml-develop mailing list archive at Nabble.com.
|