Ready : control movements in a daz scene using your phone/tablet also multitouch

mCasualmCasual Posts: 4,604
edited November 2022 in Freebies

> > > > > https://sites.google.com/site/mcasualsdazscripts7/mcjtcpbridge

on your phone, using a normal browser (ex:chrome) you open a web page i wrote

note: it was observed that some minimalist browsers offered by some phones ( Samsung ) wont work

probably because they don't support the websocket protocol

 

behind the scene, using javascript, your phone's position and acceleration sensors are read and transmitted over wifi/ethernet to your PC

on the PC there's a minimalist websocket server that receives the data and hand it over to a daz script

the  websocket server i will supply is for PC/Windows only but a Mac version is very probably coming because

the server is simply an example program ( print server ) that comes with zaphoyd's websockpp libraries (  open source (BSD license)   )

this daz script then applies the orientation to .... something ( for now it's whatever is selected )

if your phone doesnt have Gyroscope/compass then it wont be as practical

BUT using accelerometers, which are normally present on all phones, someone may be able to obtain usable phone orientations

Release Page will be here : https://sites.google.com/site/mcasualsdazscripts7/mcjtcpbridge

 

Post edited by mCasual on

Comments

  • nonesuch00nonesuch00 Posts: 17,929

    very cool

  • mCasualmCasual Posts: 4,604
    edited September 2016

    Today ! -- will include Multi-Touch Touch coordinates

    from your Phone/Tablet to Daz Studio!

    finger painting in Daz Studio? ... the future will tell

    Posing figures in Daz Studio using your iPad? ... could be 

    another nice feature of that system is that, someone proficient in javascript

    can simply modify this 'web page' and sent whatever data they want to Daz Studio

    as long as the message is formatted like this :

    [ LABELS Time Touch.x Touch.y ]

    [ DATA 1800 320 240 ] 

    ... there is no need to modify the server that relays the data to daz studio

    no need to modify the daz studio script that receives the data

     

    Post edited by mCasual on
  • mCasualmCasual Posts: 4,604

    and down the road i'll probably have s script that converts those phone movements/touches into a midi file, for example a theremin midi file

  • mCasualmCasual Posts: 4,604
    edited September 2016

    the initial special web page you will be able to use on your phone

    to transmit up to, say, 4 finger touches to Daz Studio

     

    touches.jpg
    405 x 720 - 119K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,604
    edited September 2016

    4 finger touches

    the finger positions will be in x/y coordinates and as an angle plus a radius

    so you'll me able, for example, to rotate a camera by touching the graticule

    graticule.jpg
    1080 x 1920 - 593K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,604

    it's ready

    it's not as responsive as i'd like, so maybe i'll come back to this later this autumn

    ( but i'm returning to work on mcjElasticSim )

    https://sites.google.com/site/mcasualsdazscripts7/mcjtcpbridge

  • mCasualmCasual Posts: 4,604

    if you went to https://sites.google.com/site/mcasualsdazscripts7/mcjtcpbridge

    and could not find the daz script it's because i forgot to upload it sorry !

    but it's there now, the DS1/DS2 version too - though i only tested it on DS1 and tested the DS3/DS4 version on DS4.9

     

  • mCasualmCasual Posts: 4,604

    using mcjTCPBridge kit i recorded the movements of my pen on my Nexus screen

    i created a primitive plane

    mcjTelemetryClient scrit's

    t0x channel was driving the translateX channel of the plane

    t0y channel was driving the translateY channel of the plane

    once the 1000 frames recording was done

    i used mcjTransport to create a 6-sided 1000 segments long tube that followed the movements of the plane

    due to flipped-normals issues i had to make the tube emissive ( opengl render, pixel shading on, reflection strength 100% white )

    and there you have it 

     

     

    rendah.jpg
    1080 x 1920 - 372K
  • mCasualmCasual Posts: 4,604
    edited September 2016

    using mcjTCPBridge kit i recorded the movements of my pen on my Nexus screen

    i created a primitive plane

    mcjTelemetryClient script's

    t0x channel was driving the translateX channel of the plane

    t0y channel was driving the translateY channel of the plane

    once the 1000 frames recording was done

    i used mcjTransport to create a 6-sided 1000 segments long tube that followed the movements of the plane

    due to flipped-normals issues i had to make the tube emissive ( opengl render, pixel shading on, reflection strength 100% white )

    and there you have it 

     

    Post edited by mCasual on
  • mCasualmCasual Posts: 4,604
    edited September 2016

    Demonstration movie !!!!

    so it's a kit of 3 "apps"
    a modern HTML web page on your phone/tablet
    a tiny server App on your PC ( someday maybe Mac )
    a script in daz studio to receive the data

    which data? it depends on the web page on your phone
    i made one that transmits the gyroscope and accelerometer data
    and one that transmits touch-screen touches, line-drawings

    https://sites.google.com/site/mcasualsdazscripts7/mcjtcpbridge

    http://www.daz3d.com/forums/discussion/111551/ready-control-movements-in-a-daz-scene-using-your-phone-tablet-also-multitouch

    Post edited by mCasual on
  • JamesJames Posts: 875
    edited November 2022

    I'm testing your script.
    On my phone it can connect ot the PC through LAN. But the MCJTELEMETRY.HTML doesn't show data of orientation  and motion:rotationRate.
    They are all 0

    motion: acceeration
    seems to response when I move my phone.

    I can connect to PC is by running the mcjTcpServer.exe.
    And it shows the connection.
    But If I click the play button on MCJTELEMETRY.HTML
    It shows 0 0 0 0 of all data on the server.

    What should I do?

    Does this software require a hardware gyro on the phone?
     

     

     

     

     

    Post edited by James on
  • mCasualmCasual Posts: 4,604

    i'll see if it still works

    what you could do is open the 'console' of your browser

    and see if there are javascript error messages 

     

    ekajuan_9f765a669b said:

    I'm testing your script.
    On my phone it can connect ot the PC through LAN. But the MCJTELEMETRY.HTML doesn't show data of orientation  and motion:rotationRate.
    They are all 0

    motion: acceeration
    seems to response when I move my phone.

    I can connect to PC is by running the mcjTcpServer.exe.
    And it shows the connection.
    But If I click the play button on MCJTELEMETRY.HTML
    It shows 0 0 0 0 of all data on the server.

    What should I do?

    Does this software require a hardware gyro on the phone?
     

     

     

     

     

     

  • mCasualmCasual Posts: 4,604
    edited November 2022

    well in a way it's good news it also doesn't move on the phone interface for me too

    so if I fix it for me it should fix it for you

    Note that it's the phone that transmitted the names of the data channels to the Daz Script

    so it's not because the communication link doesn't work

    maybe the daz script has to start the dance .... ( I didn't use it in years )

     

    ekajuan_9f765a669b said:

    I'm testing your script.
    On my phone it can connect ot the PC through LAN. But the MCJTELEMETRY.HTML doesn't show data of orientation  and motion:rotationRate.
    They are all 0

    motion: acceeration
    seems to response when I move my phone.

    I can connect to PC is by running the mcjTcpServer.exe.
    And it shows the connection.
    But If I click the play button on MCJTELEMETRY.HTML
    It shows 0 0 0 0 of all data on the server.

    What should I do?

    Does this software require a hardware gyro on the phone?
     

     

     

     

     

     

    phonehome1.jpg
    665 x 532 - 111K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,604
    edited November 2022

    well that's interesting when i start  mcjTelemetry.html using the default browser of the Samsung phone, nothing moves

    so i installed a random free file browser from the Play Store

    browsed to my phone's download folder

    and opened mcjTelemetry.html in * chrome *

    and what do i see, all the accelerometer values are live

    Now what happens if i start the server using the daz script

    and i press the connect button in mcjTelemetry.html?

    ( after setting the IP address of mcjTelemetry.HTML to 192.168.2.99:9002 in my case )

    nothing since we did not link the incoming data to an object/limb in the daz studio scene

    ( actually something happens we see the list of 'server channels' fill )

    so

    1, select an object in the scene, football

    2 - launch the daz script mcjTelemetryClient.dsa

    3a make sure you told mcjTelemetryClient where the server is located , ex: C:/Users/jacqu/Downloads/mcjTcpServer/mcjTcpServer.exe

    3 - press the start server button of mcjTelemetryClient.dsa

    4a - Open mcjTelemetry.html with a good browser not a basic one offered by android

    4 - on the phone,  set the IP address according to your PC's intranet address ( obtained using CMD ipconfig ) on Port 9002: 192.168.2.99:9002 

    6 - on the phone [Connect]

    7 - the phone's available data channels appear in mcjTelemetryClient.dsa's list of 'Server Channels'

    8 - add a link between the phone's ori.y channel to the Y-Rotate of the football to mcjTelemetryClient's list  of 'Server/Client Linking'

    one could make a game where the motion of your phone throws a football in the Daz Scene, everybody would crack their phone screen !

    now if you press the [Send] button of mcjTelemetry.html one sample will be sent to the football and it will rotate according to your phone's y orientation

    if you press [Play] on the phone the samples will be sent every x seconds depending on mcjTelemetry.html's Samples/Sec setting

    if you want to record a session, then the Phone must be in Play mode ( though [Send] would work too

    and press mcjTelemetryClient.dsa's [Record] button 

     

     

     

    I'm testing your script.
    On my phone it can connect ot the PC through LAN. But the MCJTELEMETRY.HTML doesn't show data of orientation  and motion:rotationRate.
    They are all 0

    motion: acceeration
    seems to response when I move my phone.

    I can connect to PC is by running the mcjTcpServer.exe.

    And it shows the connection.select the But If I click the play button on MCJTELEMETRY.HTML

    It shows 0 0 0 0 of all data on the server.

    What should I do?

    Does this software require a hardware gyro on the phone?
     

     

     

     

     

     

    Post edited by mCasual on
  • JamesJames Posts: 875
    edited June 2023

    My phone is redmi 9A

    I tried using the default mi browser, chrome and firefox, uc browser, opera.
    None is working.
    MCJTELEMETRY.HTML doesnt register any values.
    Only in mi browser, chrome, opera and uc browser that register motion: acceeration values.
    But still the rest is either 0 or n/a

    and no javascript errors on the console.

    ----------------------------

    I also tested the touch.
    I got this error on DAZ script when starting the server.

    Launching WiiServer

     

    launchFinished

    readyReadStderr( [2023-06-06 20:41:06] [info] asio listen error: system:10048 (Only one usage of each socket address (protocol/network address/port) is normally permitted)

    )

    processExited

     

    Screenshot_2.png
    1919 x 890 - 68K
    Post edited by James on
  • mCasualmCasual Posts: 4,604
    edited June 2023

    maybe you did not type in the [Server IP] field the actual IP address:port that mcjTelemetry is ( or should be running ) on

    but if 192.168.100.103:9002 is correct and mcjTelemetry won't start, the javascript app won't be able to connect evidently

    if another app, like stable-diffusion or some other app runs on port 9002 then it could explain things

    You may also want to check using TaskManager to see if previous sessions of mcjTelemetry are still running in the background ( sometimes they dont shut down as they should )

     

    James said:

    My phone is redmi 9A

    I tried using the default mi browser, chrome and firefox, uc browser, opera.
    None is working.
    MCJTELEMETRY.HTML doesnt register any values.

    Post edited by mCasual on
Sign In or Register to comment.