Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology
Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered
You are not logged in.
i'm trying to figure out how to properly control the walkthrough plugit but I'm having trouble understanding the form of the tuple that must be sent to the walkthrough plugit when (the plugit I am designing) undergoes an event named "Command"
let's say i want to make the shell to look up, although this question would apply to any type of movement/rotation
would
//psuedocode for plugit named mycontroller
let [0 0 0l]-> vector in
let [1 0 0l]-> rotation in
let itoa vector -> vector in
let itoa rotation -> rotation in
let vector::"\n"::rotation:: nil->commandstring in
(
_DMSevent this (getPluginInstanceEvent constr.mycontroller_instance "Command") commandstring nil;
be enough to make the camera shell rotate upwards along its x axis?
once the event message is sent to the walkthrough plugit, do i have to then send another message to stop the rotation? like
//psuedocode for plugit named mycontroller
let [0 0 0]-> vector in
let [0 0 0l]-> rotation in
let itoa vector -> vector in
let itoa rotation -> rotation in
let vector::"\n"::rotation:: nil->string to send in
(
_DMSevent this (getPluginInstanceEvent constr.mycontroller_instance "Command") commandstring nil;
Offline
look at the "control" event code from the joypad plugIt for example
i see, so would this be the proper format to send complete position and rotation information (from an event named "Command") to the walkthrough cbControl action:
//code to stop the walkthrough from moving or rotating that will be properly processed by walkthrough cbControl function
let 0.0-> vx in
let 0.0-> vy in
let 0.0-> vz in
let 0.0-> ax in
let 0.0-> ay in
let 0.0-> az in
(
_DMSevent this (getPluginInstanceEvent inst "Command") (strbuild ((ftoa vx)::(ftoa vy)::(ftoa -.vz)::nil)::((ftoa ay)::(ftoa ax)::(ftoa az)::nil)::nil) nil;
//more code here
Last edited by hebdemnobad (14-Nov-2014 16:59:32)
Offline
this is values from -1 to 1 for translation and rotation
there is some possible behavior change as you can see in the oculus plugIT
Offline
this is values from -1 to 1 for translation and rotation
there is some possible behavior change as you can see in the oculus plugIT
I don't even know what an oculus looks like.
it's ok, i'll create a plugit with some text controls that sends the values to the walkthrough Control action and see what happens...
Offline
this works:
fun deleteOb(inst)=
0;;
fun cbmoverotatePreRender(inst, viewstr)=
//make camera shell rotate around y axis for ever when linked to walkthrough control action (without setting any parameters)...if you set the interger higher, the rotation is faster (i'm not sure if that is good coding or not but there it is
_DMSevent this (getPluginInstanceEvent inst "Control") strbuild ("0"::"0"::"0"::nil)::("0"::"1"::"0"::nil)::nil nil;
0;;
fun newOb(inst)=
setPluginInstanceCbPreRender inst @cbmoverotatePreRender;
setPluginInstanceCbDel inst @deleteOb;
0;;
fun IniPlug(file)=
PlugRegister @newOb nil;
setPluginEditor @dynamicedit;
0;;
Offline