|
From: cheribhai <cha...@gm...> - 2010-03-01 12:48:05
|
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
PosInter.keyValue[1][2] = targetPosition[2]; // z
and also
PosInter.keyValue = [0 0 0, targetPosition[0] targetPosition[1]
targetPosition[2]];
but both don't work.
cheers
Cherian
--
View this message in context: http://old.nabble.com/Vector-Assignment-tp27742867p27742867.html
Sent from the openvrml-develop mailing list archive at Nabble.com.
|
|
From: Braden M. <br...@en...> - 2010-03-03 18:13:32
|
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...>
|
|
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.
|
|
From: Braden M. <br...@en...> - 2010-03-24 00:37:16
|
On Tue, 2010-03-23 at 09:58 -0700, cheribhai wrote: > 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 $ wget http://old.nabble.com/file/p28003831/jsassign.wrl --2010-03-23 20:35:00-- http://old.nabble.com/file/p28003831/jsassign.wrl Resolving old.nabble.com... 216.139.236.162 Connecting to old.nabble.com|216.139.236.162|:80... connected. HTTP request sent, awaiting response... 410 Gone 2010-03-23 20:35:00 ERROR 410: Gone. :-( -- Braden McDaniel <br...@en...> |
|
From: cheribhai <cha...@gm...> - 2010-03-26 15:42:37
|
Hi Braden,
Sorry about this. Figured out why it didn't work. Then tried to
edit the post but couldn't.
cheers - Cherian
Braden McDaniel wrote:
>
> On Tue, 2010-03-23 at 09:58 -0700, cheribhai wrote:
>> 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
>
> $ wget http://old.nabble.com/file/p28003831/jsassign.wrl
> --2010-03-23 20:35:00--
> http://old.nabble.com/file/p28003831/jsassign.wrl
> Resolving old.nabble.com... 216.139.236.162
> Connecting to old.nabble.com|216.139.236.162|:80... connected.
> HTTP request sent, awaiting response... 410 Gone
> 2010-03-23 20:35:00 ERROR 410: Gone.
>
> :-(
>
> --
> 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-tp27742867p28044275.html
Sent from the openvrml-develop mailing list archive at Nabble.com.
|