App developer How to rotate a 3D cube?

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
Post Reply
stefan.erni
Valued Contributor
Posts: 738
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 170 times

App developer How to rotate a 3D cube?

Post by stefan.erni »

Hi Ben

Flowcode has a nice 3D windows.

It's simple to import 3D object.
How can I move and rotate the object in runtime?

I have an electronic in a box ready to work with an ESP32, Akku and 6-Axis IMU (*) and my goal is with the App developer fetch movement data from the cube via wifi and rotate the cube in the App developer.

(*) 6-Axis IMU Unit is a 6-axis attitude sensor with 3-axis gravity accelerometer and 3-axis gyroscope, which can calculate tilt angle and acceleration in real time.

This can also be a demo App if if a few people are interested.

regards

Stefan
Attachments
cube-move-2021-01-11_17-59-37.png
cube-move-2021-01-11_17-59-37.png (110.99 KiB) Viewed 5212 times

Steve-Matrix
Matrix Staff
Posts: 1234
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

Re: App developer How to rotate a 3D cube?

Post by Steve-Matrix »

Hi Stefan,

You can rotate objects in simulation and in App Developer projects using the various "Rotate" simulation macros. Add a simulation macro and look at "Built in functions...Panel...Position".

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: App developer How to rotate a 3D cube?

Post by BenR »

Hi Stefan

This blog post from a few years back might be useful for you.

https://www.matrixtsl.com/blog/quadroco ... -and-gyro/

stefan.erni
Valued Contributor
Posts: 738
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 170 times

Re: App developer How to rotate a 3D cube?

Post by stefan.erni »

Hi Steve, Hi Ben

The 3D functions are fantastic. Perfect!

My computer is on my network with a network cable.
The cube is also on my network with WiFi. PING from the computer to the cube works.

For the ESP32 Cube looks there is a socket connection ready to use in Flowcode9.

How can I create a socket connection with the App developer ?

regards

Stefan

cube_rotate_2021-01-12_10-41-09.png
cube_rotate_2021-01-12_10-41-09.png (119.34 KiB) Viewed 5177 times

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: App developer How to rotate a 3D cube?

Post by BenR »

Hi Stefan,

Using App Developer use the Network Comms component and that should do everything you need.

Let us know how you're getting on.

stefan.erni
Valued Contributor
Posts: 738
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 170 times

Re: App developer How to rotate a 3D cube?

Post by stefan.erni »

Hi Ben

Ok for the App developer I have to use Network Comms.

In the forum I saw wardelder is using Network Comms on the ESP32
https://flowcode.co.uk/forums/viewtopic.php?f=5&t=115
But for the ESP32 program is not clear if Network Comms or just the Wlan_ESP32?

Both shows socket..

regards

Stefan
Wlan_ESP32_2021-01-12_16-53-45.png
Wlan_ESP32_2021-01-12_16-53-45.png (19.91 KiB) Viewed 5162 times
net_com_2021-01-12_16-51-59.png
net_com_2021-01-12_16-51-59.png (11.2 KiB) Viewed 5162 times

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: App developer How to rotate a 3D cube?

Post by BenR »

Hello,

The way it goes is the network comms component provides a general purpose interface for networking which includes simulation for Flowcode and App Developer.

This then can be linked to specific hardware interfaces e.g. the ESP32 WLAN or the ESP8266 WLAN to provide an embedded solution with a common socket interface.

You can drive the network comms component yourself or you can use it with library components such as the Modbus TCP, Webserver or other components designed for use with it.

I hope this makes sense.

stefan.erni
Valued Contributor
Posts: 738
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 170 times

Re: App developer How to rotate a 3D cube?

Post by stefan.erni »

Hi Ben

Ok the network comms component is very good.

What about a new component "Data socket server".

Something similar like the webserver but it's serve instead of HTML Code one or various data-buffer with 512byte (or much more).
This data buffers can be updated (changed) at runtime.

I suspect the socket client in the app developer can download this data very quickly and easily. Of course, many socket programs can download this data regardless of whether it is C #, C ++ or Python

regards

Stefan
Data_socket_server_2021-01-13_10-15-54.png
Data_socket_server_2021-01-13_10-15-54.png (27.63 KiB) Viewed 5139 times

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: App developer How to rotate a 3D cube?

Post by BenR »

Hi Stefan,

I like it it's a great idea. Would the data socket be able to act as both a server and client or would we have two seperate components do you think?

The DSP components have a Multiplex and Demultiplex ability which can pack up seperate streams into a single data array and visa versa. Could be useful or maybe we can find a way of doing this in a more static form so we don't need DSP streams.

I think before I dive in I'd lke to sniff around the possibilites and hopefully make something very useful :D

Modbus TCP is a similar thing but the data is pre-arranged into addresses. Might be worth you having a look at this while we work out the details.

stefan.erni
Valued Contributor
Posts: 738
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 170 times

Re: App developer How to rotate a 3D cube?

Post by stefan.erni »

Hi Ben

Two seperate components seem easier to use and easier to understand.

Static is ok for me.
DSP component are very good and nice to use.
The output of DSP components can easily be written into a buffer. But definitely a great opportunity for the future.
When I think of a FLAC DSP component ...

https://www.matrixtsl.com/mmforums/view ... ac#p103930

regards


Stefan

Post Reply