ParallelGraphics Forums
SDK
You are here: [Forums]::[General]::[SDK]

Registration 
Registration
Forgot your password?

Help 
Help
Support

Quick search 

Subscribe to newsletters 

Install Cortona VRML Client for FREE!
Outline 3D
3D Page Of the Week
email:  password:
   General - SDK

Subject: Re: PlaneSensor
Sender: Uh 14.04.08 01:34
I have some problem with PlaneSensor. I have one Transform node with Viewpoint and NavigationInfo
node. I have another Transform node with some Shape object.
I define one PlaneSensor and I put it in the second Transform
node with the Shape. If I use a ROUTE to move the Shape
there is no problem, but if I try to move the camera insead of
the object it does not work properly. I do the follow:
    In a Script node I define a function "eventIn SFVec3f drag":
    function drag(value,time) {
    camtrans.translation[0]= -value[0];
    camtrans.translation[2]= -value[1];
    }
    I am using this ROUTE:
ROUTE PLANE_TOUCH.translation_changed TO SCRIPT.drag

...
That works:
#VRML V2.0 utf8

DEF camtrans Transform {
children Viewpoint {
description "Main"
}
}

DEF main_PLS PlaneSensor {}
Shape {
geometry Cone {}
}

DEF main_SCR Script {
eventIn SFVec3f go
field SFNode camtrans USE camtrans
url "javascript:
function go(val){
camtrans.translation[0] = -val[0];
camtrans.translation[2] = -val[1];
}
"
}
ROUTE main_PLS.translation_changed TO main_SCR.go

 


PlaneSensor / mutafchiev@gmx.de / 27.02.08 03:37
     Re: PlaneSensor / Uh / 14.04.08 01:34

Messages in thread: 2


© 1998-2009 ParallelGraphics. All rights reserved. Terms of use.