Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

OBJECTIVES In this activity you will learn how to: Create 3 D box objects Update the position of an object iteratively ( repeatedly ) to

OBJECTIVES
In this activity you will learn how to:
Create 3D box objects
Update the position of an object iteratively (repeatedly) to animate its motion
Update the momentum and position of an object iteratively (repeatedly) to predict its motion
TIME
You should plan to finish this activity in 50 minutes or less.
I. Setup statements
In this task, we are going to use VPython to model a moving cart on a 2.0 m track.
1. In a browser, go to the webpage www.glowscript.org to get to the Glowscript home page.
2. In the right hand corner click Sign In and login using your existing Google account from Lab 1.
3. You are now on the Glowscript program development page where you can either run programs that you have previously
written or create new programs. We want to click on the Create New Program.
4. In the pop-up display give the program the name Cart
a. Creating objects
5. We use a white box to represent the track. Type the following command and run the program.
track = box(pos=vector(0,-.05,0), size=vector (2.0,0.05,.10), color=color.white)
6. We will now use a red box whose center is at the origin to represent a moving cart located at the origin. Type the following
command and run the program.
cart=box(pos=vector(0,0,0), size=vector(0.1,0.05,0.06), color=color.red)
Test Your Knowledge
Reposition the cart so its left end is aligned with the left end of the track.
Run the program and make are sure it is working.
b. Initial conditions
To model the motion of an object over time, we need to know the value of two vector:
initial position; and
initial velocity.
You have already given the cart an initial position. Now you need to give it an initial velocity, velcart. If you push the cart with your
hand, the initial velocity is the velocity of the cart just after it leaves your hand.
7. Give the cart a velocity of 0.5 m/s in the +x direction by adding the following command
velcart = vector(0.50,0,0) #sets the carts velocity at 0.5 m/s in the +x direction

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions

Question

4. Describe five ways to lose an NLRB election.

Answered: 1 week ago

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago