[X3D-Public] SFTime.setValue()

Giorgos Papadakis gpapadak at ced.tuc.gr
Tue Apr 7 10:40:31 PDT 2009


Thanks for your quick reply.

The specifications of the methods are that getValue() returns a double and
setValue() gets a double as an argument so it still seems right to me.

Moreover the exception is thrown at the first line,

From: Ioan Marius BILASCO [mailto:mbilasco at gmail.com] 
Sent: Tuesday, April 07, 2009 8:22 PM
To: Giorgos Papadakis
Cc: x3d-public at web3d.org
Subject: Re: [X3D-Public] SFTime.setValue()

 

My feeling is that you should explicitely convert the timein.getValue()+2.0
to an SFTime value... 

As you wrote the code I think that it is trying to put directly an integer
value into a SFTime slot... and I guess that this is not acceptable.

 

cheers,

 

 

On Apr 7, 2009, at 6:05 PM, Giorgos Papadakis wrote:





Hello, I am having some troubles with SAI (script called inside an x3d
world).

My code has an input SFTime value, routed from an TouchSensor, and I want to
use this to trigger an animation (startime=input and stoptime=input+2.5
seconds)

I am trying to do this at the following simple code:

 

timeoutstart.setValue(timein.getValue());

timeoutstop.setValue(timein.getValue()+2.0);

 

When viewing the world using the Xj3D browser, I am getting the following
exception:

 

System.out: Error: System.out: Error while sending event

System.out: java.lang.NullPointerException

System.out:       at Control3.readableFieldChanged(Control3.java:62)

System.out:       at
org.web3d.vrml.scripting.sai.BaseField.fireEventNotification(BaseField.java:
352)

System.out:       at
org.web3d.vrml.scripting.sai.JavaSAIScriptWrapper.sendEvents(JavaSAIScriptWr
apper.java:572)

System.out:       at
org.web3d.vrml.renderer.common.nodes.scripting.BaseScript.processEvents(Base
Script.java:571)

System.out:       at
org.xj3d.impl.core.eventmodel.DefaultScriptManager.processEvents(DefaultScri
ptManager.java:287)

System.out:       at
org.xj3d.impl.core.eventmodel.DefaultEventModelEvaluator.evaluateRunning(Def
aultEventModelEvaluator.java:936)

System.out:       at
org.xj3d.impl.core.eventmodel.DefaultEventModelEvaluator.evaluate(DefaultEve
ntModelEvaluator.java:605)

System.out:       at
org.web3d.vrml.renderer.ogl.browser.PerFrameManager.clockTick(PerFrameManage
r.java:126)

System.out:       at
org.web3d.vrml.renderer.ogl.browser.ApplicationFrameManager.updateSceneGraph
(ApplicationFrameManager.java:89)

System.out:       at
org.j3d.aviatrix3d.management.SingleThreadRenderManager.run(SingleThreadRend
erManager.java:648)

System.out:       at java.lang.Thread.run(Unknown Source)

This happens only with SFTime variables, I have successfully changed  an
object's position and orientation using similar code.

I appreciate any help you can give me.

Thank you in advance,

Giorgos.

_______________________________________________
X3D-Public mailing list
X3D-Public at web3d.org
http://web3d.org/mailman/listinfo/x3d-public_web3d.org

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20090407/4eaff8fc/attachment.html>


More information about the X3D-Public mailing list