Develop a simple canvas animation of your own design

Assignment Help Computer Networking
Reference no: EM131243966

Assignment: HTML 5 Canvas, JavaScript and Theory Questions

Assignment Brief:

Develop HTML 5 and JavaScript code to re-create the following vector graphics sequence using appropriate HTML 5 Canvas methods such as:

- beginPath()
- closePath()
- rect()
- arc()
- stroke()
- moveTo()
- lineTo()
- fill()
- ...

Using these methods you will need to draw lines, rectangles, circles (complete arcs) at appropriate co-ordinates using both fillStyle and strokeStyle to reproduce the diagram below.

Note: that when drawing the vector shapes you should use different coordinate variables (var variableName; in JavaScript) to make it easier to keep track of where all the different rectangles, lines and arcs should be placed. For example, it would be wise to keep track of the size of the square with a JavaScript variable such as:

Part A: HTML 5 Canvas Drawing 20%

1. Reproduce the diagram above by defining a canvas object with a width and height of 600 pixels and following the instructions outlined below. In each step be sure to introduce new variables to keep track of things like position, size, and how different objects are offset (differ) from each other.

2. Draw a light green square using code similar to that in Figure 2. The square should have a side length of 300 pixels and should be drawn so that the square is drawn at the center of the canvas as shown in Figure 1.

3. Draw the line objects using the lineTo(), moveTo() and stroke() canvas methods to draw line strokes which create a diamond shape around the canvas. Set the stroke style to black as in Figure 1. The diamond should have four lines on the outside, it should also have lines which converge in the middle (which will later be covered by the center green circle).

4. Fill a complete light green arc (circle) such that the circle is drawn at the center of the canvas with a size less than the width of the rectangle, as shown in Figure 1. Draw a red coloured arc (circle) around the outside of the diamond, as shown in Figure 1. The radius should of the circle should be canvas.width / 2.8

5. Draw filled circles positioned using trigonemtry at diagonal corners of the red circle at the angles of 45°,135°, 225° and 315°. You will be able to calculate the offset (difference) from the center using cos 45° × radius to find the x offset and sin 45° × radius to find the offset for the y position. Remember to use radians!

Part B: Challenge Questions

1. Develop a simple canvas animation of your own design. For example, you could rotate the four circles around the large outside red circle using trigonometry (sin and cos) to locate the x,y coordinates of the circles at different angles. Check that your animation is of an appropriate difficulty level with your lecturer before submitting the assignment.

2. Use Canvas EventListeners to enable user interaction. For example, a user could spin the canvas image using their mouse, buttons and mousedown / mousemove events.

Submission Details and Marking Criteria:

This is an individual assignment. You must work on the individual tasks by yourself and all work on these tasks must be your own. Your final submission should contain the following:
- All the code required to view your animation (your .html file)

Verified Expert

This assignment deals with the HTML5 concept. This assignment deals with the canvas and the graphic method and also uses the event listener. Canvas.html : Simple Use of canvas : Problem A canvasAnimation_A.html : deals with the animation part of Problem B canvas_EventListener.html: deals with the event listener part of Problem B

Reference no: EM131243966

Questions Cloud

Evaluate the financial status of the company : Evaluate the financial status of the company in terms of its liquidity, solvency, structure and profitability. Use your comprehensive analysis to decide whether it would be a wise decision to invest in the company or not
How will this transaction affect the companys balance sheet : How will this transaction affect the Company's income statementeach year from 2016 through 2021? What lines and sub-totals / totals that will be affected and by how much?
What is a composition of functions : 1. What is a composition of functions? What is the difference between the composition and the product of two functions? 2. Write a short paragraph about the number e.
Provide analysis of unexpected events using project schedule : In a separate Word document, provide an analysis of unexpected events using the Project Schedule Template below (the unexpected events are located in Tab 2 of the document).
Develop a simple canvas animation of your own design : ISCG4500 - Introduction to Information Technology - Draw a light green square using code similar to that in Figure 2. The square should have a side length of 300 pixels and should be drawn so that the square is drawn at the center of the canvas as ..
Calculate the value : Given x=2.6*10^4 and y=5.0*10^-8 calculate the value of w=x*y. Given your answer in the form a*10^k where 1
Identify all of information you would need to effectively : Identify all of the information you would need to effectively manage the three goals above. Identify the challenges and potential issues related to implementing the three goals above. Develop recommendations for strategies to address these challenges..
Joining the midpoints of the four sides : Let ABCD be a quadrilateral. Show that the figure formed by joining the midpoints of the four sides is a parallelogram.
How does it differ from an investment demand curve : What is an investment schedule and how does it differ from an investment demand curve?

Reviews

Write a Review

Computer Networking Questions & Answers

  Create a report exploring the stages

Create a report exploring the stages involved in a specific attack (of your choice) against a computing system.

  List the range of normal vlan

List the range of Normal VLANs. What VLANs are reserved in that range? List the Extended VLAN range. What, if any, VLANs are reserved in that range?

  Describe the purpose of the dynamic host control protocol

question 1 what is the purpose of the address resolution protocol arp?question 2 what is the purpose of the dynamic

  Question 1ai differentiate between denial of service attack

question 1ai differentiate between denial of service attack dos and distributed denial of service ddos attack.ii give

  What is meant by router interfaces with ssh listening

What is meant by router interfaces with ssh listening on the internet.

  Operating systems

The figure below shows a tunnel going through a mountain and two streets parallel to each other-one at each end of the tunnel. Traffic lights are located at each end of the tunnel to control the cross flow of traffic through each inter¬section.

  Describe the network configuration

Describe the network configuration that will address the needs of the organization. Topic coverage should include DNS, DHCP, network protocols, WINS, IP Routing, and Certificate Services

  What is scope planning and scope creeping

Based on your understanding of project planning and budgeting, express your views on the following: What is scope planning and scope creeping? What are some of the ways to avoid problems and manage scope correctly

  Overview of data communications

Overview of Data Communications. What three disciplines are involved in data communications. What are the conceptual pieces of a data communications system

  Determine maximum number of ip addresses assigned

Determine the smallest size subnet which can be utilized to fulfil this requirement? _______. Determine the maximum number of IP addresses which can be assigned in this size subnet?

  Beyond the literal meaning write down the broader

beyond its literal meaning what are the broader implications of the clicheacute keeping the family name alive? or has

  Will the network be peer to peer or server based?

Will the network be peer to peer or server based?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd