3D

3D Scripting

Home

Using Alice!

We started using Alice today! We got to program objects! We are starting to do programming in 3D!! Its crazy because you get to make what you want and do many fun things.

I'm working on two dragons. Here is how they look like from a camera angel. I'm making them flap their wings and breath out fire. However, I was only able to make one of them fly by flapping their wings.

I started off using this dragon. This is the dragon that can flap its wings while it flies.

Here is the code to make your dragon flap its wings. One thing I will mention before you start is that you would need about 3 methods before you start the process. Name one method, "dragonleftwing", another "dragonrightwing", and "dragonflapwings". This code if for the right wing of the dragon.

This is the coding to for the left wing to flap. It's like the right wing coding but you just need to change some things and now you are down with your wings.

After you have finished coding you right and left wing, you want to code this in the "flapwings" method you had created. The loop is so your dragon can repeat the coding as many time as you want and by code I mean the dragon f

Now we are going to start putting the fire method on our dragon. You can find the fire in the "special and effects" column. Make a method named "dragonfire" and go to its properties and make sure you click on the vehicle and set it to the object you want to have fire.

This is the coding for your fire.

On the top they have a Event command. I put the "if the world starts command" that is in the Event command to tell my codes when to start.


Using Sketchup!


Today we are using Sketchup! We get to build whatever we want in 3D!! We are learning how to make images look 3D and why it's possible for us to do this.

This is how Sketchup would look like. As you can see you are given a big field to put objects on. You are also given so many tools to work with to make your 3D more better and realistic.

You can make 3D objects. Just click on the shape or click on the pencil on your tool bar to make shapes.

In order to lift up your object so it can look 3D, You want to click the "push/pill" button. It's the one that is circled in the picture.

You can also import building, cars, furniture, etc. into the sketch. All you need to do is click the "get models" button. It is circled on the picture for you. Sometimes the models you click will be small so click the "scale" button that is located in your tool bar to make them bigger.

This is my 3D house that I built using sketchup. I imported in some objects and build some free handed. It's not completed but just an example of what you can do using sketchup and how it will look.

This is the famous teapot that was used to make 3D objects at first. Its a Utah teapot.

This is how they used the teapot to make the lines for 3D object. They will study it time over time.

Using Vidle Python!


Today we are using Vidle Python! We are going to program a ball to move. You want to use this program.

This is the coding to make the walls. You don't need to add the "#", they are there to tell you what that command is doing.

Notice on the top picture on the walls it has "materials" you don't have to put the material I put in. Go to the website "vpython.org" to get codes. Click on documentations that is circled red in the picture.

Once you are there, click on the "full documentation" link. I have circled it in red for you.

Then click on "Work with 3D objects" and click on materials. This will give you the code to change your wall to any choice you want.

Your walls should be in the same position as my walls are right now. Your color of your walls don't have to be the same as mine. Don't worry about the ball and the red lines yet.

This is the code for the ball. You want to copy exactly how it is because it lets the ball bounce off the walls and stay in the box. Also the words that have "#" before them, they are colored red, you don't need to add those in, they are just there to tell you what the coding is doing

Once you have finished coding, your ball should stop like the ball in the picture.

Next we are making a Sun and Earth orbit around! Here is the code for it.

We have our sun and our earth! You can change the material on the ball by doing the steps that were in the begining.

This is how the final product should look like. The earth orbiting the sun of course you can add more and make it so the earth only shines when the sun is hitting it, however I wasn't able to do that step.