:o 11th or 12th grade math?!? Is that even possible in Scratch? (I'm doing 9th grade math right now and some of the things I don't think I could program into Scratch!
Well, It's still a 2d image on your screen. the 3d illusion come from tricks that our brains use to understand depth... smaller objects are understood as farther away, perspective lines, motion... this project uses 3d projection to translate 3d points to 2d space on your screen.
you know, if i am able to COMPLETLY understand this, i have the experties to create a 3-d game like command and conquer or starcraft. im working on one now, but its not 3d. can you set the camera direction so if you click on a button the camera moves to a specific area?
hm, i take what i said before back. but i still like my idea better. its glitch free and has 100%detail. this would take forever to make what im making.
addzero, could you look at this project I made: (link to project)
I'm not trying to spam, I just want to say it to you, because I think you will like it.
Hey, look at this perpendicular plane dragging engine I made: (link to project) It is really cool. you could translate it to 3D and then you could really interact with the 3D environment.
im not sure what you mean by choppy or smooth i mean im 12 but i dont understand everyday terms, i'd use a more safisticated term such as:fantastic or totally awsome!!!!!!!
Great! The combination of background with multiple static pictures and foreground with dynamic 3D calculation nearly fooled me to believe, there was something in Scratch I don't understand. But after a look at the code I smiled about myself.
this needs inprovement NOW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
In Blender how do you get the screenshots? I figured out how to use blende and everything, but I don't know how to import it to Scratch without manually scrolling it then taking a picture and doing that until I have everything.
Wicked sick! I found a way to view projects when the server crashed. Click the featured scratch club, then click your messages. You can go to your projects, and browse projects by other users.
no in the "render" buttons menu you see "Start" and "End" frame numbers. change the end to 10 if you only want 10 images. on the left right below output you'll see a little folder button and file path, that's where it will make image files, if you change it to "//img/" it will make a img folder from where your blend file is and add the pictures in there. now press the "ANIM" button to render the animation.
Now change the screen view at the top from "2-Model" to
"1-Animation". this shows the IPO editor. curves show up when an object that has animation curves is selected. you can select and edit curves like you do objects- the "TAB" key toggles edit mode. to make linear curves, so the object moves or rotates without speeding up and slowing, select a animation key. (dot in a curve) and press "V".
this is where you can start to learn about animation keys. They are points in space at a certain times that you can set, it automatically makes curves- smooth motion between those points.
You should start on frame 1, that number is on the button bar. with the object selected, press the "i" key. and choose "LocRotScale" now change the frame to "10" the left and right keys do this or you can click on the "1" and type it in. now rotate the object with "r" (move with "g" for grab, "s" for scale, to make big or smaller) once you have it where you want. set another key with "i" and choose "LocRotScale" now use the arrow keys to go back in time, you should have smooth motion. you can do the same for the camera. to make the camera rotate around a point in front of it, make an empty (an object that that has no geometry... useful for things like this.) place it in front of the camera, then parent the camera to it. now you can rotate the "Empty" and the camera rotates around it.
In Blender, how do you add color, copy and paste, and link groups of objects together? I am trying to make something 3d for scratch.....I also need to knwo how to get those screenshots! Thanks!
to make a render for scratch: click the scene button (f10), towards the right you'll see "SizeX" and "SizeY" change those to 480 and 360 so it's the size of the scratch window. also near there you can change the image type to png or jpg. make sure RGBA is pressed and PNG is on if you want the background cut out. then press the "RENDER" button (f12) after that's done hit ESC or close that window. to save the picture go to "file", "save image" (f3) and pick where and what you want to name the file.
to link groups of objects so they are moved together:
Select all the objects you want together by holding down the shift key while right clicking the objects.
Decide what object you want to be the 'parent'- this is the object that you move around, and all the 'children' follow. while still holding down the shift, select the one you want to be the parent, notice it is a brighter pink. now let go of the shift, and press Ctrl+p and click 'make parent'
to copy an object: select it with the right mouse button. then press Ctrl+d.
or Alt-D if you want all the copies to be the same- if you make changes to one, it changes all.
to add color, you first need to add a material to an object. select the object with the right mouse button. hit the red sphere button (f5) in the buttons window and add a material... then find the R, G, B, sliders towards the left, play with those to get the color you want. or click the color block to the left of "Col" for a color picker.
It's in two parts, premade images in the background arena and dots that are "projected" to match the 3d background. I would suggest reading on "3d projection". ...and I found this site helpful: http://www.kirupa.com/developer/actionscript/3dindex.htm
I wrote more below and on the side. Let me know if you have more questions.
Ok I'll try to give a primer to 3d camera transformation and projection.
Let's say you have a point in space that you want to put on the screen. Every point or vertices has an x, y, z. (2D is just x,y. 3D has a z, which is how far back it is.) Let's set ours to -1,1,0. so it's above the ground and to the left.
Your screen or your camera's view, by default is at 0,0,0. We want to move the camera back (z:-2) and up a little (y:1), so we can see the point, because right now, it's above and to the left of the camera, out of it's view. So let's set the camera's xyz coordinate to 0,2,-5, (up 2 and back 5) To do that, we actually do the same 'camera transformation' to every point in the scene... your 2d screen stays the same, but every point is actually moved back from the camera and down. To rotate the camera around the y axis camera, we have to 'transform' the x, y, points with sin and cos. Take a look in my lathe 3d modeler, in one drawing sprites for a cleaner code. (link to project)
after all the points are where you want them, you project them with FieldOfView setting, which is the zoom level of the camera. Take a look this (link to project) too.
I hope that helps.
This website helped me understand some of these concepts: http://www.kirupa.com/developer/actionscript/3dindex.htm
Click the flag to move the dots to random locations. Move the mouse to rotate.
Thanks everybody for rating the performance of this.
With a rating of 1 to 3, 1 being choppy and 3 being smooth, from a survey of 60 people the average is about 2.58!
Not too bad. (It's actually a 2 for me.)
Now we can use this as a very rough subjective performance benchmark.
If this project runs a little choppy to smooth for you, and your project is smooth, you can be pretty sure it will run smooth on most people's computers.
This has 15 dots.
(I used MITscratcher's fast pen idea.)
How I made it: I read up on "3d projection" and "matrix transformation". It took me quite a few websites and tinkering around to start to understanding it enough to make this work. It's about 11th or 12th grade level math.
I used a 3d program called blender to draw the arena background animation and to figure out the camera position and zoom level I needed in the script so the backgrounds and the scratch program would match.
When the program starts, every dot starts a script: it picks a random x,y,z location. (normally when you move a sprite you just have x and y. z is how far back it is.) Then in a loop, it takes the rotation of the camera, and how far it's zoomed in and converts the x,y,z location to your screen's x, y location, and moves the sprite there. Then it picks what costume to use: Big to little red dots- based on how far it is from the camera. (I could have used just one costume and changed the size, but that is slower.)
Meanwhile: There is another sprite moving to every red dot with the pen down. the camera rotation is continually set to the mouse x. And the background frame is changed according to the camera rotation. I made the "Arena" the same on all 4 sides so that I can use the 30 frame animation 4 times in one turn, otherwise it would have been 120 frames.
I hope that helps. It sounds confusing. I'll try to explain it better if there is interest.
Also, I'm open to suggestions on how to make this better.
I'd be honored if anyone was able to use any of my work in their project. Please don't just copy- try to make something new from it and at least give me a little credit in your project notes.
Thanks scratch team for helping me finally start to understand programming.
Comments
You need to be logged in to post comments
Add a Comment
how did u get the areana in scratch?
It is costumes made with a 3d program called blender... I tried to explain it in the project notes. Let me know if you have more questions.
Cool!
nice job!
2. And this is online!
Is there a solution that we don't need to code that much to make a 3D game? Is there a more simple way?
:o 11th or 12th grade math?!? Is that even possible in Scratch? (I'm doing 9th grade math right now and some of the things I don't think I could program into Scratch!
Hmmm. Way too hard to understand but are the dots tricking my eyes too?
rating:3
another good one but sadly needs a little more things to do
my rating is 2
Wowie Zowie... i didn't think that Scratch could be this fast...!!!
Wow unbelievably fantastic
Thanks. :)
3d? 4d?
Well, It's still a 2d image on your screen. the 3d illusion come from tricks that our brains use to understand depth... smaller objects are understood as farther away, perspective lines, motion... this project uses 3d projection to translate 3d points to 2d space on your screen.
Add a check for change on X and Y to clear the ray, that way wont flicker every second. I test it and looks better.
why would u even do that
Good question. for fun? for the challenge? ...not sure.
where is the texture for the model?
It is a very nice example of 3d graphics. I like it!
Wow this is great 3d
awesome!
Add Zero I loved the game!!! Where did you get the background?
Thanks! I tried to explain everything the best I could in the project notes, let me know if you have questions.
you know, if i am able to COMPLETLY understand this, i have the experties to create a 3-d game like command and conquer or starcraft. im working on one now, but its not 3d. can you set the camera direction so if you click on a button the camera moves to a specific area?
You can change the camera rotation to any angle, if that's what you mean, translating a mouse click to a specific area could be tricky.
(view all replies)hm, i take what i said before back. but i still like my idea better. its glitch free and has 100%detail. this would take forever to make what im making.
how did you do the rating survey?
Nice!
addzero, could you look at this project I made: (link to project) I'm not trying to spam, I just want to say it to you, because I think you will like it.
Hey, look at this perpendicular plane dragging engine I made: (link to project) It is really cool. you could translate it to 3D and then you could really interact with the 3D environment.
im not sure what you mean by choppy or smooth i mean im 12 but i dont understand everyday terms, i'd use a more safisticated term such as:fantastic or totally awsome!!!!!!!
i added it to my new gallery! (link to gallery)
Great! The combination of background with multiple static pictures and foreground with dynamic 3D calculation nearly fooled me to believe, there was something in Scratch I don't understand. But after a look at the code I smiled about myself.
this is almost H2○
this needs inprovement NOW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
i rate it 2
i gotsa idea
YOU COULD MAKE A GAME WITH THAT! It's cooPr
simply AMAZING!!!!!!!!!!!!
i rate it 3 out of 3.
I remixed this (link to project) This engine has a lot of potential!
3 man this is good
Hmmmm... sorry, but it is a 1 for me.
WHAT?!?!?!???? it's at least a 2. )-:<
(view all replies)yhtg3
I'm gonna make a 3-D sprite that moves around in it
tried blender and have no idea how to use it
add zero, I have no idea how to use blender, could you help me?? The only 3d animations I do are with crazy talk, iclone, etc.... YOU ROCK!!
In Blender how do you get the screenshots? I figured out how to use blende and everything, but I don't know how to import it to Scratch without manually scrolling it then taking a picture and doing that until I have everything.
scratch is harder for me since I do (college degree) programing books like C#, Java, Javascript, C++, and more. -I'm just your super smart 10-year-old
100% smooth here! I love the background shading!!
Wicked sick! I found a way to view projects when the server crashed. Click the featured scratch club, then click your messages. You can go to your projects, and browse projects by other users.
Check out what I made with it!!! (link to project)
Whoa! That sounds VERY complicated! I might have to give it a shot :P
Another use for python. :)
Thanks, but how do you rotate the camera? I see no way of doing it evenly without a Python script, and I don't even have Python.
no in the "render" buttons menu you see "Start" and "End" frame numbers. change the end to 10 if you only want 10 images. on the left right below output you'll see a little folder button and file path, that's where it will make image files, if you change it to "//img/" it will make a img folder from where your blend file is and add the pictures in there. now press the "ANIM" button to render the animation.
Now change the screen view at the top from "2-Model" to "1-Animation". this shows the IPO editor. curves show up when an object that has animation curves is selected. you can select and edit curves like you do objects- the "TAB" key toggles edit mode. to make linear curves, so the object moves or rotates without speeding up and slowing, select a animation key. (dot in a curve) and press "V".
this is where you can start to learn about animation keys. They are points in space at a certain times that you can set, it automatically makes curves- smooth motion between those points. You should start on frame 1, that number is on the button bar. with the object selected, press the "i" key. and choose "LocRotScale" now change the frame to "10" the left and right keys do this or you can click on the "1" and type it in. now rotate the object with "r" (move with "g" for grab, "s" for scale, to make big or smaller) once you have it where you want. set another key with "i" and choose "LocRotScale" now use the arrow keys to go back in time, you should have smooth motion. you can do the same for the camera. to make the camera rotate around a point in front of it, make an empty (an object that that has no geometry... useful for things like this.) place it in front of the camera, then parent the camera to it. now you can rotate the "Empty" and the camera rotates around it.
The 3D engine is AWESOME. I think it is the best on the whole website.
try to make it a game! that'll be a challenge I give this a................2.2 It's pointless... but cool :D
In Blender, how do you add color, copy and paste, and link groups of objects together? I am trying to make something 3d for scratch.....I also need to knwo how to get those screenshots! Thanks!
to make a render for scratch: click the scene button (f10), towards the right you'll see "SizeX" and "SizeY" change those to 480 and 360 so it's the size of the scratch window. also near there you can change the image type to png or jpg. make sure RGBA is pressed and PNG is on if you want the background cut out. then press the "RENDER" button (f12) after that's done hit ESC or close that window. to save the picture go to "file", "save image" (f3) and pick where and what you want to name the file.
to link groups of objects so they are moved together: Select all the objects you want together by holding down the shift key while right clicking the objects. Decide what object you want to be the 'parent'- this is the object that you move around, and all the 'children' follow. while still holding down the shift, select the one you want to be the parent, notice it is a brighter pink. now let go of the shift, and press Ctrl+p and click 'make parent'
to copy an object: select it with the right mouse button. then press Ctrl+d. or Alt-D if you want all the copies to be the same- if you make changes to one, it changes all.
to add color, you first need to add a material to an object. select the object with the right mouse button. hit the red sphere button (f5) in the buttons window and add a material... then find the R, G, B, sliders towards the left, play with those to get the color you want. or click the color block to the left of "Col" for a color picker.
cool. did you make it with blender?
I made the background in blender the dots are placed there in scratch.
(view all replies)Wow look at my 3d games
how do you get the 3-D simulation
It's in two parts, premade images in the background arena and dots that are "projected" to match the 3d background. I would suggest reading on "3d projection". ...and I found this site helpful: http://www.kirupa.com/developer/actionscript/3dindex.htm I wrote more below and on the side. Let me know if you have more questions.
On a scale of 1 to 3, I give this infinity. Hey. it rhymes! 1,2,3, infinity
i just got blender and im working on a game in scratch about king arthur and i need some help on one thing: how do i change the color of my images?
sorry I was slow at answering your question, I wrote a little tutorial above.
i would like to learn more about the camera rotation and how it effets he x,y of the dot.
Ok I'll try to give a primer to 3d camera transformation and projection. Let's say you have a point in space that you want to put on the screen. Every point or vertices has an x, y, z. (2D is just x,y. 3D has a z, which is how far back it is.) Let's set ours to -1,1,0. so it's above the ground and to the left. Your screen or your camera's view, by default is at 0,0,0. We want to move the camera back (z:-2) and up a little (y:1), so we can see the point, because right now, it's above and to the left of the camera, out of it's view. So let's set the camera's xyz coordinate to 0,2,-5, (up 2 and back 5) To do that, we actually do the same 'camera transformation' to every point in the scene... your 2d screen stays the same, but every point is actually moved back from the camera and down. To rotate the camera around the y axis camera, we have to 'transform' the x, y, points with sin and cos. Take a look in my lathe 3d modeler, in one drawing sprites for a cleaner code. (link to project) after all the points are where you want them, you project them with FieldOfView setting, which is the zoom level of the camera. Take a look this (link to project) too. I hope that helps. This website helped me understand some of these concepts: http://www.kirupa.com/developer/actionscript/3dindex.htm
2.5