This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > VRML > January 2004 > About PositionInterpolator





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author About PositionInterpolator
Unregistered

2004-01-17, 1:32 pm

Hi everyone,

I need to manipulate the keyValue inside PositionInterpolator. That means keyValue can be
[x1 y1 z1,
x2 y2 z2]

x, y, z are based on calculation from user's input. I have a script to compute x,y,z but the problem is keyValue is an exposedField and I cannot ROUTE my result to keyValue. Only eventIn can be routed to eventOut. I tried doing this:


PROTO CalculatePos [
eventIn SFFloat x_pos # this is from user
field MFVec3f keyValue []
# this is the PositionInterpolator I defined outside of this
#PROTO
field SFNode PosInt USE POSINT
] {
DEF CalPos Script {
eventIn SFFloat x_pos IS x_pos

url "vrmlscript:
function x_pos (){
<compute x,y,z for keyvalue>
PosInt {keyValue[]};
}"
}
}

I got a complain in PosInt {keyValue[]}; when I tried executing. Any idea from you guys or is there a better way to do so? Would like to hear from you.
Herbert Stocker

2004-01-17, 8:30 pm



Unregistered wrote:
quote:

> Hi everyone,
>
> I need to manipulate the keyValue inside PositionInterpolator. That
> means keyValue can be
> [x1 y1 z1,
> x2 y2 z2]
>
> x, y, z are based on calculation from user's input. I have a script to
> compute x,y,z but the problem is keyValue is an exposedField and I
> cannot ROUTE my result to keyValue. Only eventIn can be routed to
> eventOut. I tried doing this:
>
>
> PROTO CalculatePos [
> eventIn SFFloat x_pos # this is from user
> field MFVec3f keyValue []
> # this is the PositionInterpolator I defined outside of this
> #PROTO
> field SFNode PosInt USE POSINT
> ] {
> DEF CalPos Script {
> eventIn SFFloat x_pos IS x_pos
>
> url "vrmlscript:
> function x_pos (){
> <compute x,y,z for keyvalue>


quote:

> PosInt {keyValue[]};



This line is syntactically not correct.
It must look like:

PosInt.keyValue= ...;


The whole function should look like this:

function x_pos(val)
{
var ani= new MFVec3f;
<compute the values>
PosInt.keyValue= ani;
}
quote:

> }"
> }
> }
>
> I got a complain in PosInt {keyValue[]}; when I tried executing. Any
> idea from you guys or is there a better way to do so? Would like to
> hear from you.
>
>
> Unregistered -
> ------------------------------------------------------------------------
> Posted via http://www.forum4designers.com
> ------------------------------------------------------------------------
> View this thread: http://www.forum4designers.com/message33931.html
>




--
Herbert Stocker (aka hersto)
http://www.hersto.de
www.bitmanagement.de

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews