This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > VRML > February 2004 > dear mufti...and the likes..!!





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 dear mufti...and the likes..!!
satyendra verma

2004-01-31, 8:28 am

i have been involved in learning vrml on my own since the last 5 years
and my unofficial teachers have been you all....thanks a lot..ive
learnt so much from the questions already posted that i ner had to
come out in open...

...but a small problem forced me too....could you please tell me whats
wrong wid this code..

...all i am trying to do is to highlight a location by drawing a
sphere whose radius increases wid time...something wrong in the SCRIPT
i know.....

THANKS in advance

satyendra




#VRML V2.0 utf8
Group { children [
DEF TS1 TimeSensor {
# enabled FALSE
loop TRUE cycleInterval 10.0
}
DEF SI ScalarInterpolator {

key [ 0.0, .5, 1.0 ]
keyValue [ 0, .9, 0 ]

}

DEF T1 Transform {
translation -4 0 0
children [
Shape {
geometry DEF T2 Sphere { radius 0.5 }
appearance Appearance {
material Material { diffuseColor 1 1 1 }
}}
DEF TOS TouchSensor {}
]
}
Viewpoint { position 0 0 10 description "Animation on"}
] }

DEF SCRIPT Script {
eventIn SFTime timenow
eventOut SFVec3f scalenow
url "vrmlscript:
function scalenow(value) {
value[0] = Math.round(timenow)*4;
value[1] = Math.round(timenow)*4 ;
value[2] = Math.round(timenow)*4 ;
scalenow = scalenow(value)
}"

# missing ( before formal parameters: function scalenow{


}

ROUTE TS1.fraction_changed TO SI.set_fraction
ROUTE TS1.time TO SCRIPT.timenow
ROUTE TOS.touchTime TO TS1.startTime
#ROUTE SI.value_changed TO SCRIPT.timenow
ROUTE SCRIPT.scalenow TO T1.scale
Eckhard M. J?ger

2004-01-31, 3:30 pm

Try this:

DEF SCRIPT Script {
eventIn SFTime timenow
eventOut SFVec3f scalenow
url "vrmlscript:
function timenow(value) {
scalenow = new SFVec3f (Math.round(value)*4, Math.round(value)*4,
Math.round(value)*4);
}"

Renember the name of the function must be the same as eventIn and not
eventOut. Do not forget the ';' at the end of lines. The values that
can be transported by the routes always a value and a timestamp of the
value (timenow ist the function and not the value).
About creating new MF-Objects:
http://www.web3d.org/resources/vrml...ual/apph.htm#MF

Karamba!
::VRMLsuck::Bart
http://www.neeneenee.de/vrml/
satyendra verma

2004-02-03, 12:34 pm

bart@neeneenee.de (Eckhard M. J?ger) wrote in message news:<15525540.0401311126.12a96e0@posting.google.com>...
quote:

> Try this:
>
> DEF SCRIPT Script {
> eventIn SFTime timenow
> eventOut SFVec3f scalenow
> url "vrmlscript:
> function timenow(value) {
> scalenow = new SFVec3f (Math.round(value)*4, Math.round(value)*4,
> Math.round(value)*4);
> }"
>
> Renember the name of the function must be the same as eventIn and not
> eventOut. Do not forget the ';' at the end of lines. The values that
> can be transported by the routes always a value and a timestamp of the
> value (timenow ist the function and not the value).
> About creating new MF-Objects:
> http://www.web3d.org/resources/vrml...ual/apph.htm#MF






thanks a lot bart , it was real helpful but there seems to be morre
then that.....still do not work....i thought it was some thing wid da
TIME field so i changed it ...could you have a look...

thanks again in advance....

satyendra



#VRML V2.0 utf8


#VRML V2.0 utf8
Group { children [
DEF TS1 TimeSensor {
# enabled FALSE
loop TRUE cycleInterval 10.0
}
DEF SI ScalarInterpolator {

key [ 0.0, .5, 1.0 ]
keyValue [ 0, .9, 0 ]

}

DEF T1 Transform {
translation -4 0 0
children [
Shape {
geometry DEF T2 Sphere { radius 0.5 }
appearance Appearance {
material Material { diffuseColor 1 1 1 }
}}
DEF TOS TouchSensor {}
]
}
Viewpoint { position 0 0 10 description "Animation on"}
] }

DEF SCRIPT Script {
eventIn SFFloat timenow
eventOut SFVec3f scalenow
url "vrmlscript:
function timenow(value) {
scalenow = new SFVec3f (Math.round(value)*2, Math.round(value)*2,
Math.round(value)*2);
}"


# missing ( before formal parameters: function scalenow{


}

ROUTE TS1.fraction_changed TO SI.set_fraction
ROUTE TOS.touchTime TO TS1.startTime
#ROUTE SI.value_changed TO SCRIPT.timenow
ROUTE SCRIPT.scalenow TO T1.scale
ROUTE SI.value_changed TO SCRIPT.timenow
Sponsored Links


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