Select to view content in your preferred language

Moving the robot's legs

1079
4
Jump to solution
11-27-2023 12:29 AM
Farhan
by
Emerging Contributor

Hello friends . I want the robot's legs to move when I change the attribute of the Robot_Move. Its value is between positive 20 and negative 20. However, when I change the DistanceMove(n) between positive 20 and negative 20 , the robot's legs to move. when i change the value Robot_Move attribute which causes the robot's legs to move .Does anyone have a solution?. Thank You

Farhan_0-1701073653147.png

 

Farhan_1-1701073678989.png

 

Farhan_2-1701073705497.png

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ThomasFuchs
Esri Regular Contributor

Thanks, @Farhan for your reply.
Here is a prototype of a walking animation based on Tutorial 18: Handles—ArcGIS CityEngine Resources | Documentation
bipedAni.gif

It can be achieved by making the following modifications to biped.cga (s. attachment):

ThomasFuchs_0-1701774951765.png

 

View solution in original post

4 Replies
ThomasFuchs
Esri Regular Contributor

Hello @Farhan 

Thanks for your question. Your robot looks like a fun education project.

To me, it looks like you are returning a floatArray from the distanceMove(n) function. However, the r operation—ArcGIS CityEngine Resources | Documentation needs a float input. 

I suggest, that you adjust your function in a way that you derive the leg angle from the Robot_Move value. 

All the best for your project!

0 Kudos
Farhan
by
Emerging Contributor

Thank you Thomas for your reply. this is good idea. What I think is that attribute Robot_Move should be written inside a function that repeats the value of attribute Robot_Move as a repeating loop until the limit of 5, then moves from 5 to 0 again, and this causes the robot's legs to repeat in The distance becomes 5. and another idea is to add the value of attribute Robot_Move to its inverse value, if the maximum value of attribute Robot_Move is 20, then by adding the inverse value of this attribute to the normal state, every time we change attribute X, its value becomes 20, and this number is Negative 20 and positive 20 are repeated in a loop, which causes the robot's legs to move 

However, the problem that exists in using the array for this case, as you said, does not accept the r of the presented value and gives an error. Is there a way to remove the array from the function?

my English is not very good, if there is something incomprehensible, please tell me so that I can correct it

 

Farhan_0-1701444218948.png

 

0 Kudos
ThomasFuchs
Esri Regular Contributor

Thanks, @Farhan for your reply.
Here is a prototype of a walking animation based on Tutorial 18: Handles—ArcGIS CityEngine Resources | Documentation
bipedAni.gif

It can be achieved by making the following modifications to biped.cga (s. attachment):

ThomasFuchs_0-1701774951765.png

 

Farhan
by
Emerging Contributor

hi Thomas . thank you for your help 😊- I was also able to do this using the pow function

Farhan_0-1701860403667.gif

 

0 Kudos