This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-06-10 09:12:29

murraylang
New Scratcher
Registered: 2011-06-10
Posts: 3

Movement in real-world units

Hello,

I am brand new to scratch and trying to evaluate its usefulness to me. One thing that I want to be able to do is define motion in, say, metres, and have that motion superimposed accurately onto a background map. In other graphics programming environments I can define a viewport and window so that I can use arbitrary units in my logic, and have those values scaled to pixels automatically.

Is there a way that I can achieve this neatly in scratch?

Regards,
Murray

Offline

 

#2 2011-06-10 09:35:11

Adventurer
Scratcher
Registered: 2011-05-28
Posts: 80

Re: Movement in real-world units

I am COMPLETELY confused so I can't really help you :c

Offline

 

#3 2011-06-10 10:52:21

meew0
Scratcher
Registered: 2010-02-22
Posts: 1000+

Re: Movement in real-world units

The problem is, Scratch is designed for little kids which might not understand that. You have to scale the metres to pixels manually. (BTW The scratch stage is 480x360 pixels big.)


http://i.imgur.com/mJV3j.pnghttp://i.imgur.com/HwWAX.pnghttp://i.imgur.com/sZ7Ui.pnghttp://i.imgur.com/0y6yh.pnghttp://i.imgur.com/nOC4l.png

Offline

 

#4 2011-06-10 11:28:54

murraylang
New Scratcher
Registered: 2011-06-10
Posts: 3

Re: Movement in real-world units

Thanks Meew0,

I didn't see the kids necessarily getting involved in that side of it, at least not the mathematics. It doesn't really matter what the size of the stage is in pixels, as long as it's a workable minimum. What I would like to be able to do is set the stage background to a scanned image of a street map. Then I'd like to be able to say "move 10 metres" and have that movement correspond to the scaling of the map image.

Anyway, it looks like Scratch isn't up to scratch for what I want. Perhaps it could be achieved neatly with the user-defined blocks supposedly coming in version 2. I'll wait for that and then have another look.

Cheers,
Murray

Offline

 

#5 2011-06-10 12:24:58

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Movement in real-world units

It would be pretty easy to set up a scale factor and some global variables and a set of broadcasts to make this happen, if you want to work with this some more.  I'd be happy to set up a demo project.  Just leave a comment on one of my projects so that I'm sure to get your message  smile


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#6 2011-06-10 13:11:08

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Movement in real-world units

Paddle2See wrote:

It would be pretty easy to set up a scale factor and some global variables and a set of broadcasts to make this happen, if you want to work with this some more.  I'd be happy to set up a demo project.  Just leave a comment on one of my projects so that I'm sure to get your message  smile

I was thinking the same thing. As long as you have a distance you know on the background image, you could fairly easily figure out a pixel to meter conversion unit by determining how many pixels there are in that distance and then just finding the meter/pixel ratio.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#7 2011-06-10 20:06:30

murraylang
New Scratcher
Registered: 2011-06-10
Posts: 3

Re: Movement in real-world units

Many thanks Paddle2See,

You've given me some key words to get started in the right direction, so I'll use this to sink my teeth into Scratch. I think we learn most when we have a problem to solve, but I'll get back to you if I get stuck all the same.

Cheers and thanks again,
Murray

Offline

 

Board footer