首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
辅导WebGL程序、辅导Python、Java
项目预算:
开发周期:
发布时间:
要求地区:
2021/9/27 An Interactive 2D Drawing Application
An Interactive 2D Drawing Application
Due Sunday by 11:55pm Points 100 Submitting a text entry box
Available Sep 23 at 10am - Oct 13 at 11:55pm 21 days
Start Assignment
Overview
The purpose of this first assignment is to set you up for the programming environment. You are asked to implement a web-based
interactive 2D drawing application, which requires you to start learning and using WebGL.
This homework will use Github Classroom.
IMPORTANT: Click on this link (https://classroom.github.com/a/CJr-sPKC (https://classroom.github.com/a/CJr-sPKC) ) to join the
assignment on Github and get access to your personal repository.
After you join, you might be prompted with a message like this:
2021/9/27 An Interactive 2D Drawing Application
https://canvas.ucdavis.edu/courses/595787/assignments/718396 2/7
You can disregard that message and head directly to your repository (blurred-out section in the image).
You will use this repository to manage your submission. Please commit and push regularly to save your work.
Pushing will only be possible up until the deadline, so make sure everything you want to submit has been pushed by then.
2021/9/27 An Interactive 2D Drawing Application
https://canvas.ucdavis.edu/courses/595787/assignments/718396 3/7
We provide a template code that contains basic files to get you started. Feel free to do your own implementation from scratch, but if you
choose to do so, do not build on technologies that have to be set up for grading (i.e., no web servers or libraries that require the grader to
download and/or install them). The provided template is an HTML/JS webpage that you can display by hosting the index.html file locally
and viewing the local URL in your browser of choice. We strongly recommend developing in Google Chrome as it will be the platform used
for grading, but feel free to develop using any other browser, provided the code runs in Chrome. We'll show you how to simply host a page
locally in one of the lectures.
Requirements
Your drawing application should allow the user to place lines and simple shapes in the display area by using keyboard-mouse
combinations. The user will press a key to select a color or a shape, and make a mouse click to place the current shape filled with the
current color at the location of the cursor. Note that the outline of the shape needs to be shown in a distinctive color. Please provide at
least the following key-color and key-shape mappings:
p - point: a point of size canvas.height/100
h - horizontal line: a horizontal line with length canvas.height/4
v - vertical line: a vertical line with length canvas.height/4
t - triangle: an equilateral triangle with a side length canvas.height/8
q - square: a square with side length canvas.height/10
g - color: Aggie Gold #FFBF00
b - color: Aggie Blue #022851
f - fill mode: fill triangle / square
o - outline mode: only draw the outlines of a triangle / square (i.e., no fill color)
c - clear: clear the canvas (remove all objects)
Each shape’s center is the mouse click’s location. However, for lines, the click location is where the line begins. If shapes would overlap,
the newly added one should be drawn over the previously added ones.
2021/9/27 An Interactive 2D Drawing Application
https://canvas.ucdavis.edu/courses/595787/assignments/718396 4/7
Your application should also allow the user to resize the window such that as the canvas size changes accordingly the sizes of all the
current shapes also change correspondingly in a refresh. There is a function in app.js called resizeToDisplay( ) to handle scaling. It's
bound to the window.onresize event, so it's called whenever a user changes the window size. Keep in mind, that most devices these days
support high dpi scaling. That means that 1px read from the DOM doesn't necessarily equate 1px on a browsers screen. You'll need to use
window.devicePixelRatio to get the correct ratio.
Here is an example of what a drawing might look like:
2021/9/27 An Interactive 2D Drawing Application
https://canvas.ucdavis.edu/courses/595787/assignments/718396 5/7
If have all the requirements, feel free to implement and play around with the application in any way you want. Add more shapes, colors,
etc. however you see fit. A useful bonus interaction would be to show the outline of the shape (e.g. in red) to be drawn when hovering
(before adding it to you internal data structure). That way you get finer controls to create nicer drawings.
2021/9/27 An Interactive 2D Drawing Application
https://canvas.ucdavis.edu/courses/595787/assignments/718396 6/7
Template
The file structure of the template code is as follows:
.
├── css
│ └── style.css style sheet for the application; no need to modify
├── index.html single html file with a ui that helps you track what mode you're in; no need to modify
├── js
│ ├── app.js sets up the application and contains the main render loop
│ ├── appstate.js changes the state of the application; handlers for input should be implemented here
│ ├── drawables.js contains an abstract drawable class and child classes that implement the objects to draw
│ ├── input.js monitors and stores all necessary input to complete the assignment; no need to modify
│ ├── main.js main entry point to the application; no need to modify
│ ├── shader.js class to encapsulate shader program usage; no need to modify
│ └── utils.js contains few useful utility functions; no need to modify
└── shaders
├── fragment.glsl fragment shader of the program; no need to modify
└── vertex.glsl vertex shader of the program; no need to modify
Each file contains extensive comments on what each method does or is supposed to be doing. Wherever you find a TODO, you are
expected to implement your solution. Note that you're certainly allowed to add functions as you see fit. We will go over the template code
in a lecture / discussion session.
Grading Criteria:
20% Shapes
20% Coloring and Outline Rendering
10% Locations
10% Drawing Order
2021/9/27 An Interactive 2D Drawing Application
https://canvas.ucdavis.edu/courses/595787/assignments/718396 7/7
20% Resize / refresh
20% Overall (robustness, programing style, documentation, etc.)
How to submit your work:
Submit this homework by submitting the URL to your Github repository along with your Github username here on Canvas.
Structure your Canvas submission like this:
Github User: [your Github username here]
Repository: [your repository URL here]
Your work has to be submitted to Canvas and pushed to Github before the due date (11:55pm, 10/03/2021). We will consider the latest
commit for grading, so consider if your improvements are worth a late penalty.
Nota Bene
We do not grade a program that does not run. Late submissions will lose 10% per day.
You are encouraged to help one another, but you must write your own code. If you use somebody else's code, document it. You
must abide by the UC Davis Code of Academic Conduct.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做ceng0013 design of a pro...
2024-11-13
代做mech4880 refrigeration a...
2024-11-13
代做mcd1350: media studies a...
2024-11-13
代写fint b338f (autumn 2024)...
2024-11-13
代做engd3000 design of tunab...
2024-11-13
代做n1611 financial economet...
2024-11-13
代做econ 2331: economic and ...
2024-11-13
代做cs770/870 assignment 8代...
2024-11-13
代写amath 481/581 autumn qua...
2024-11-13
代做ccc8013 the process of s...
2024-11-13
代写csit040 – modern comput...
2024-11-13
代写econ 2070: introduc2on t...
2024-11-13
代写cct260, project 2 person...
2024-11-13
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!