Discuss Scratch

ilikerats4
Scratcher
100+ posts

how do i make an arm?

so im making a arm and i want to control it with my mouse but im having a hard time here it is https://scratch.mit.edu/projects/1326186851/ please help me fix this problem,
dem_bot
Scratcher
1000+ posts

how do i make an arm?

https://scratch.mit.edu/projects/1326367686/
So essentially, what I did was just go through the angles until the amount it was off from the right distance was as low as possible. I did a few attempts at finding a formula to get theta directly, but ig im too bad at maths to solve that.
Jlerpy
Scratcher
1000+ posts

how do i make an arm?

If you want to control it with your mouse (by which I'm guessing you want to have the hand move to the mouse pointer, and the arm bend accordingly, then I think the easiest way would be to use triangular wizardry, treating the distance between the “shoulder” and the “hand” as one side of a triangle, and keeping the lengths of the other two sides fixed (the upper arm and forearm), from which you can calculate the angle at the intersection between those two sides. Then from that you can calculate how much to turn and move.
ilikerats4
Scratcher
100+ posts

how do i make an arm?

Jlerpy wrote:

If you want to control it with your mouse (by which I'm guessing you want to have the hand move to the mouse pointer, and the arm bend accordingly, then I think the easiest way would be to use triangular wizardry, treating the distance between the “shoulder” and the “hand” as one side of a triangle, and keeping the lengths of the other two sides fixed (the upper arm and forearm), from which you can calculate the angle at the intersection between those two sides. Then from that you can calculate how much to turn and move.
can you please add it to the project? i dont understand i would love it if you like just fix the project or show it with scratch projects..
ilikerats4
Scratcher
100+ posts

how do i make an arm?

Jlerpy wrote:

If you want to control it with your mouse (by which I'm guessing you want to have the hand move to the mouse pointer, and the arm bend accordingly, then I think the easiest way would be to use triangular wizardry, treating the distance between the “shoulder” and the “hand” as one side of a triangle, and keeping the lengths of the other two sides fixed (the upper arm and forearm), from which you can calculate the angle at the intersection between those two sides. Then from that you can calculate how much to turn and move.
please elebarote
dem_bot
Scratcher
1000+ posts

how do i make an arm?

Jlerpy wrote:

triangular wizardry
I kinda forgot
cos(A) = (b^2 + c^2 - a^2)/(2bc)
was a thing lol

well so you can use Pythagoras' theorem to compute the distance between hand and shoulder, then, along with the upper and lower arm lengths, you have a b and c. That you can then plop into this formula, take the acos of the answer and you have an angle of one of the joints.
ilikerats4
Scratcher
100+ posts

how do i make an arm?

dem_bot wrote:

Jlerpy wrote:

triangular wizardry
I kinda forgot
cos(A) = (b^2 + c^2 - a^2)/(2bc)
was a thing lol

well so you can use Pythagoras' theorem to compute the distance between hand and shoulder, then, along with the upper and lower arm lengths, you have a b and c. That you can then plop into this formula, take the acos of the answer and you have an angle of one of the joints.
please use scratch blocs so i can understand
ilikerats4
Scratcher
100+ posts

how do i make an arm?

ilikerats4 wrote:

dem_bot wrote:

Jlerpy wrote:

triangular wizardry
I kinda forgot
cos(A) = (b^2 + c^2 - a^2)/(2bc)
was a thing lol

well so you can use Pythagoras' theorem to compute the distance between hand and shoulder, then, along with the upper and lower arm lengths, you have a b and c. That you can then plop into this formula, take the acos of the answer and you have an angle of one of the joints.
please use scratch blocs so i can understand
hello?
Jlerpy
Scratcher
1000+ posts

how do i make an arm?

I'm much better at expressing in actual blocks than forum blocks, so here's a worked example: https://scratch.mit.edu/projects/1326867984/

It all hinges on the principle that dem_bot said, that you can calculate the sides of a right triangle from the values of the other sides, because the length of the hypotenuse is always the square root of the squares of the other two sides added together.
And if we define the length of our forearm and upper arm as the hypotenuse of a triangle, then we can use half the distance from our start point to the mouse pointer as one of the other sides, and from that, calculate the length of the third side - the distance between the midpoint between shoulder and mouse pointer and the elbow.
ilikerats4
Scratcher
100+ posts

how do i make an arm?

Jlerpy wrote:

I'm much better at expressing in actual blocks than forum blocks, so here's a worked example: https://scratch.mit.edu/projects/1326867984/

It all hinges on the principle that dem_bot said, that you can calculate the sides of a right triangle from the values of the other sides, because the length of the hypotenuse is always the square root of the squares of the other two sides added together.
And if we define the length of our forearm and upper arm as the hypotenuse of a triangle, then we can use half the distance from our start point to the mouse pointer as one of the other sides, and from that, calculate the length of the third side - the distance between the midpoint between shoulder and mouse pointer and the elbow.
so when i make it smaller it dosent work
ilikerats4
Scratcher
100+ posts

how do i make an arm?

bump
ilikerats4
Scratcher
100+ posts

how do i make an arm?

Jlerpy wrote:

I'm much better at expressing in actual blocks than forum blocks, so here's a worked example: https://scratch.mit.edu/projects/1326867984/

It all hinges on the principle that dem_bot said, that you can calculate the sides of a right triangle from the values of the other sides, because the length of the hypotenuse is always the square root of the squares of the other two sides added together.
And if we define the length of our forearm and upper arm as the hypotenuse of a triangle, then we can use half the distance from our start point to the mouse pointer as one of the other sides, and from that, calculate the length of the third side - the distance between the midpoint between shoulder and mouse pointer and the elbow.
hello?
dem_bot
Scratcher
1000+ posts

how do i make an arm?

ilikerats4 wrote:

so when i make it smaller it dosent work
when i make it smaller it does work. The project just lacks a bit to prevent your mouse from going out of range, meaning it goes flying.
ilikerats4
Scratcher
100+ posts

how do i make an arm?

dem_bot wrote:

ilikerats4 wrote:

so when i make it smaller it dosent work
when i make it smaller it does work. The project just lacks a bit to prevent your mouse from going out of range, meaning it goes flying.
yeah i need a better remix and a small script for it
Jlerpy
Scratcher
1000+ posts

how do i make an arm?

ilikerats4 wrote:

Jlerpy wrote:

I'm much better at expressing in actual blocks than forum blocks, so here's a worked example: https://scratch.mit.edu/projects/1326867984/

It all hinges on the principle that dem_bot said, that you can calculate the sides of a right triangle from the values of the other sides, because the length of the hypotenuse is always the square root of the squares of the other two sides added together.
And if we define the length of our forearm and upper arm as the hypotenuse of a triangle, then we can use half the distance from our start point to the mouse pointer as one of the other sides, and from that, calculate the length of the third side - the distance between the midpoint between shoulder and mouse pointer and the elbow.
hello?

Stop bumping so soon. You're meant to wait a whole 24 hours before bumping.
ilikerats4
Scratcher
100+ posts

how do i make an arm?

Jlerpy wrote:

ilikerats4 wrote:

Jlerpy wrote:

I'm much better at expressing in actual blocks than forum blocks, so here's a worked example: https://scratch.mit.edu/projects/1326867984/

It all hinges on the principle that dem_bot said, that you can calculate the sides of a right triangle from the values of the other sides, because the length of the hypotenuse is always the square root of the squares of the other two sides added together.
And if we define the length of our forearm and upper arm as the hypotenuse of a triangle, then we can use half the distance from our start point to the mouse pointer as one of the other sides, and from that, calculate the length of the third side - the distance between the midpoint between shoulder and mouse pointer and the elbow.
hello?

Stop bumping so soon. You're meant to wait a whole 24 hours before bumping.
okay??? i just bumped cuz like no one was helping me out goodly :
ilikerats4
Scratcher
100+ posts

how do i make an arm?

bump
ilikerats4
Scratcher
100+ posts

how do i make an arm?

hello??
dem_bot
Scratcher
1000+ posts

how do i make an arm?

ilikerats4 wrote:

hello??
well, to me this topic seems answered already. Please elaborate on what you still want.
ilikerats4
Scratcher
100+ posts

how do i make an arm?

dem_bot wrote:

ilikerats4 wrote:

hello??
well, to me this topic seems answered already. Please elaborate on what you still want.
just someone to give me the answer i need in scratch blocks aka these
move () steps
scratch blocks becuase i dont understand

Powered by DjangoBB