联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> C/C++编程C/C++编程

日期:2025-05-11 09:14

COMS W4172: 3D User Interfaces and Augmented Reality

Assignment 1—Spring 2025

COMS W4172: 3D User Interfaces and Augmented

Reality—Spring 2025

Prof. Steven Feiner

Date out: Thursday, February 6, 2025

Date due: Tuesday, February 25, 2025 (Only one late day allowed)

Figure 1. A real-life tilt maze

Assignment 1: A Maze Yourself

Introduction

For your first assignment, you will build from scratch a simple but fun tilt-controlled maze

game for a mobile phone using Unity. The inspiration is a physical marble maze (e.g., Figure 1),

though we don’t expect your maze to look and act exactly like a physical one. This assignment

will introduce you to Unity and mobile physics-based interaction using the device’s IMU (inertial

measurement unit), requiring you to implement tilt-based motion, simple physics, and game

mechanics.

Unity is a powerful development environment. However, that power comes at the price of a

sizable learning curve: You'll need to get comfortable with a workflow that may be different from

what you're used to, along with what will probably be an unfamiliar language, C# (although you

1

COMS W4172: 3D User Interfaces and Augmented Reality

Assignment 1—Spring 2025

should already know the basic object-oriented programming concepts underlying it). Therefore,

please start as early as possible on this assignment, so you can explore and become

comfortable with the Unity editor and begin designing your game enough in advance that you'll

have time to come to office hours if you need assistance. Remember to take advantage of

Unity's extensive online Manual and Scripting API Reference, its many free tutorials, and online

Q&A such as Unity Discussions and StackOverflow.

Please start by either working through the Unity Roll-a-Ball tutorial (or reviewing it if you’ve done

it previously) to familiarize yourself with the Unity workflow.

Important: At most one of your four late days may be used on this first assignment, so, the latest you

can turn it in will be 11:59 pm Wednesday, February 26, using that single late day.

Game Overview

The goal is to navigate a marble through three different maze configurations, avoiding

obstacles and collecting items before reaching the end zone as quickly as possible.

● The player tilts their phone to control a marble (a sphere primitive) rolling through a

maze.

● The game features three different maze configurations, each with increasing difficulty.

● The goal is to reach the end zone of the maze as quickly as possible while collecting

items.

● Obstacles include walls, holes, gaps, doors, and rotating platforms.

● A victory screen with a leaderboard that shows the completion time when the player

reaches the end zone as well as the number of items collected.

Requirements

1. Core Mechanics

● Tilt-based movement (Tip: Check out the Unity Rigidbody component)

○ The motion of the marble (which should roll rather than slide) should be

implemented using the Unity physics engine and feel natural and responsive.

○ The marble should change speed and direction in response to gravity based on

the angle of your phone relative to the direction of gravity.

■ You can implement this with the Input System attitude sensor.

2

COMS W4172: 3D User Interfaces and Augmented Reality

Assignment 1—Spring 2025

○ Implement a maximum effective tilt angle (30°) to prevent extreme motion. In

other words, even if the phone is tilted more than 30°, the marble should not act

as if the tilt angle is greater than 30°.

○ You should use one or more plane primitive objects for the floor and experiment

to find appropriate values for friction (tip: check out Unity Physics Material).

○ Changes in the position of the phone (e.g., moving/jerking the phone in any

direction, which could make a physical marble resting on the phone move)

shouldn’t affect the marble.

● Jumping

○ The player should be able to tap on a jump button to make the marble jump a

fixed amount to a height that is limited to the radius of the marble.

■ Ensure the marble cannot jump over walls nor “outside” of the maze by

making the walls sufficiently high!

○ It is up to you whether you allow the marble to “bounce” when it lands.

○ Jumping should be realistic, using Unity physics (Rigidbody.AddForce). You can

decide whether the direction of the force used for the jump is against gravity or

perpendicular to the maze floor.

○ Jumping should be disabled while the marble is in the air to prevent double

jumps.

2. Obstacles & Collectibles

Obstacles in the game include:

● Walls: A wall is a static obstacle that the marble will bounce off. Test values of

“Bounciness” for Physic Material to find an appropriate value.

● Holes: A hole is an area on the floor that is large enough for the marble to fall through. If

the marble falls into a hole, it should reset to the start of the level.

○ To make holes, you have multiple options. You can mix and match different-sized

plane primitives to make holes; holes don't have to be round (e.g., see Figure 2).

○ Alternatively, you can make custom meshes with holes with Unity ProBuilder.

○ You can easily detect if the marble has fallen through by adding a collider below

the hole(s) in the coordinate system of the maze).

3

COMS W4172: 3D User Interfaces and Augmented Reality

Assignment 1—Spring 2025

Figure 2. You can create a square hole by arranging a set of plane primitives.

● Doors

Figure 3. Example door and “door-opening” zone.

A door is a dynamic obstacle that opens only when the marble rolls over a specific zone

on the floor associated with that door. The size of this zone should be similar to the size

of a hole. You can place a door-opening zone near holes to increase the difficulty.

4

COMS W4172: 3D User Interfaces and Augmented Reality

Assignment 1—Spring 2025

● Gaps

Figure 4. Example gap.

A gap is a missing portion of the floor bounded by walls such that the marble must jump

the gap while rolling to pass between the portions of the floor that it separates. You

should design a gap such that it’s impossible to get past it without jumping, even if you

have high speed. Similar to holes, if the marble falls into a gap, it should reset to the

start of the level. You should include some easier-to-jump-over narrow gaps and some

more challenging wide gaps that require more speed.

● Rotating platforms:

Figure 5. Example rotating platform.

5

COMS W4172: 3D User Interfaces and Augmented Reality

Assignment 1—Spring 2025

A rotating platform is intended to allow the marble to traverse a gap it could not normally

pass. Start by creating a large gap that the player cannot jump across directly. In the

center of this gap, place a circular disc (made from a primitive cylinder) to act as the

central part of a rotating platform.

● Position a cube so that it touches the edge (rim) of the disc.

● The disc should rotate around its vertical axis, and the cube should orbit around

the disc, maintaining a constant distance from the center of the disc.

● Ensure that two sides of the cube remain parallel to the gap’s edges while it

rotates, so the cube maintains a consistent orientation during rotation.

● To help the marble stay on track, add walls on the other two sides of the cube,

making it harder for the marble to fall off while it’s on the moving platform.

● Experiment with the size, height (relative to the maze floor), and distance

(relative to the edges of the gap) of the top face of the cube to make your game

playable by you and us!

Collectibles in the maze allow players to score by collecting them.

● Collectibles should be created from at least two different free assets, as described

below.

● The collectibles should be placed strategically to encourage exploration.

● The UI should display the number of items collected.

● When the marble is within a set distance from a collectible (experiment with values), the

collectible should signify this visually and play a sound.

● If the player taps on the collectible (see Physics.Raycast and the

Camera.ScreenPointToRay() function) while the marble is within that set distance:

○ The collectible should disappear from the scene.

○ The collectible counter in the UI should be incremented.

○ Visual and audio feedback should be provided (tip: Consider using a particle

system for the visual effect).

○ Unlike many games you may have played, collectibles should not be collected

when the marble touches them. Instead, the player collects a collectible by

tapping it when the marble is sufficiently close, as described above.

3. Levels, Camera, and Lights

The game features a series of three levels with different designs. The player unlocks the next

level by completing the previous level.

Here is what each level should include:

● Level 1: A small maze. The entire maze is visible from the camera. The only obstacles

are walls, holes, and gaps. Gaps must be jumped over, as shown in Figure 4. There

6

COMS W4172: 3D User Interfaces and Augmented Reality

Assignment 1—Spring 2025

should be at least three walls, three holes, and three gaps (at least one of which should

be wide).

● Level 2: A small maze. The entire maze is visible from the camera. In addition to walls,

holes, and gaps, doors and collectibles are introduced. There should be at least one

door, and at least three walls, three holes, three gaps (at least one of which should be

wide), and three collectibles.

● Level 3: A larger maze where only part of the maze is visible. Implement an arrow

indicator pointing in the direction of the end zone (see Section 4. UI and Game Flow).

The camera should follow the player as they roll around the map. There should be

at least one door, and at least three walls, three holes, three gaps (at least one of which

should be wide), and three collectibles. At least one rotating platform should also be

included (see Section 2 for details).

Camera and Light Requirements

● Projection: Please use perspective projection.

● Position: Levels 1 and 2 should use a fixed camera to show the entire maze. A following

camera should be used for level 3 to track the marble.

● Camera angle: Assume the player is standing upright (relative to gravity) with a specific

edge of the phone closest to them. The maze floor aligns with the plane of the phone,

and the camera looks along a vector at a set angle relative to the direction of gravity.

Feel free to experiment with different camera angles to ensure good visibility, especially

with levels 1 and 2 in which camera position is fixed.

● Arrow Indicator: Show an arrow pointing to the end zone when it's off-screen (level 3

only).

● Lights: Include at least one directional or point or spot light source overhead that is not

attached to the maze coordinate system, so that objects are lit differently and shadows

change as the maze rotates. Don’t place point or spot lights too close to the maze.

Figure 6. An example maze configuration, with holes and collectibles (coins) along the way.

7

COMS W4172: 3D User Interfaces and Augmented Reality

Assignment 1—Spring 2025

4. UI and Game Flow

You should use the Unity UI to present the player with a Canvas object on the screen.

● Start Screen

○ Displays a start button and then a maze selection screen. In the beginning, the

player can select only level 1. They can unlock levels 2 and 3 by clearing the

previous level.

● In-Game UI

○ Timer: Starts counting once the game begins.

○ Collectible counter: Displays the number of items collected.

○ Reset button: Allows the player to restart a level at any time.

○ Jump button: Causes the marble to jump a fixed amount.

○ Return to the start screen button.

○ Arrow indicator: If the end zone is not visible, an arrow indicator should

appear at the edge of the screen pointing toward it.

○ Audio feedback: Should be provided when each of the following occurs:

■ The marble is rolling.

■ The marble hits a wall (with a sound whose amplitude is ideally

proportional to speed; use colliders).

■ The marble jumps.

■ A door is opened.

■ A collectible is close enough to be collected.

■ A collectible is collected.

■ The marble reaches the end zone.

(tip: you can easily find and download sound effects from YouTube!)

● Victory Screen:

○ Shows when the end zone is reached.

○ Displays completion time and number of collectibles gathered

○ Buttons for going to the next level, restarting the level, return to the start

screen. The go-to-next-level button won’t show if this is the last (third) level.

● If the marble falls into a hole or gap, the level automatically restarts.

5. Design

● Use only 3D primitives except for collectibles. You should only use basic 3D

primitives (e.g., spheres, cubes, cylinders) or objects created in ProBuilder for the

marble and maze. For collectibles, you must use at least two distinct free assets

obtained from the Unity Asset Store or some other source, such as those listed in the

IA Resource Page. Your assignment should use free assets only. You are welcome to

adjust material colors, lighting, and scale to make objects visually distinct. For

example, you can use different colored materials for the marble, floor, and walls.

8

COMS W4172: 3D User Interfaces and Augmented Reality

Assignment 1—Spring 2025

● Ensure the UI is optimized for mobile (easy-to-tap buttons, clear display).

● Playability: Make sure that we (and you) can test your game by playing it through.

The levels should not be overly difficult—ensure that a typical player can complete

each in between twenty seconds and two minutes. This will be especially important

for making a video demo showcasing your work.

6. Development Approach

● Start simple: Implement basic movement first using the device tilt.

● Gradually add features: Work in the following order:

1. Create the layout for level 1. This will be your main testing ground.

2. Implement basic physics-based movement with the Unity Rigidbody component.

3. Add UI elements: Timer, collectible counter, restart button, jump button.

4. Add jumping mechanics, making sure the marble cannot be made to jump again

during a jump or while in the air.

5. Introduce obstacles (holes, gaps, doors, and the rotating platform).

6. Implement raycasting for tap-to-collect collectibles.

7. Refine camera movement: Ensure the camera follows the marble smoothly in

level 3, with the marble remaining in the center of the screen.

8. Create levels 2 and 3, and make sure the game logic (e.g., unlocking levels)

works.

9. Test extensively on your mobile device before submission.

As a metric for progress, if you haven’t gotten to step 3 one and a half weeks before the

assignment is due, please come to office hours for help.

● Hierarchy & Object Organization: organize objects logically in the Unity hierarchy.

The maze should be the parent object with obstacles, doors, and collectibles as

children.

● Testing Without a Mobile Device: Deploying and testing on an actual mobile device

can take a long time. To save deployment overhead, you can interleave (but not omit)

testing on a mobile device with either or both of the following:

○ Play your game in Unity play mode. Implement substitute controls for Play Mode

in Unity. For example, use keyboard keys (e.g., arrow keys, WASD) to

simulate tilt. Note that substitute control is not required for your

submission but is highly recommended so you can test your game

efficiently.

○ Play your game using Unity Remote. This is an app that you install on your

phone, allowing the application to run in the Unity editor, but display on your

phone and use its sensors for input, though with different performance than

running on the phone. Note: To use Unity Remote on an Android device, you

must have the Android SDK on your computer.

9

COMS W4172: 3D User Interfaces and Augmented Reality

Assignment 1—Spring 2025

Hints

Playability. Please be sure that you (and we) can last long enough to try all the features,

remember that we will have little time to practice. Playability will be especially important for

making a video showing your work!

Documentation. Before starting this assignment, please look through the Unity Manual, to get a

better feel for the Editor and see the reference page on Input for a comprehensive overview of

its functionality. You can also take advantage of some of the many other free Unity Tutorials (in

addition to Roll-a-Ball).

Usability heuristics. Your application should be designed bearing in mind the Nielsen usability

heuristics. We will not grade your work based on the aesthetics of the models. You should not

use any assets that are not free or any code/scripts written by others. Other than that, we will be

evaluating your work with the heuristics in mind. Think about the feedback you provide to your

player. How do you want to show different game states to them?

Hierarchy. Understanding rotation is crucial here. Note that when an object is rotated, its

descendants will also rotate. Therefore, if you want object B to act as if it were a descendant of

object A, but not be affected by A’s rotation (e.g., to have A rotate at a different rate than B), the

easiest way to do this is to create empty GameObject A′, make A and B both children of A′,

where A is centered at A′ and B is offset from A′, and then rotate A and B individually. If you do

this, transforming A′ will transform all its descendants, but A and B can each rotate

independently.

Model Files. Each model file you find for an asset will most likely not be of an appropriate scale

relative to the other objects you’re using. Therefore, be prepared to apply a scale transform to

one or more of your models to bring them up or down to a reasonable size. In addition, note that

some models may contain too many polygons for your mobile device to render your scene at a

reasonable frame rate. Before you get too enamored of any model, please try it out on your

device in context with the rest of your scene to make sure that it will work well. See also How do

I fix the rotation of an imported model?

Raycasting. When using the Physics.Raycast function, you will be returned a RaycastHit

object. The RaycastHit object contains a reference to a Collider. The Collider contains a

reference to the GameObject to which it is attached. You can use that reference to determine

the object with which a raycast collided through the screen. You should use raycasting for your

touch-based input, so that when you touch the screen, a ray will be cast through the point you

touched (from the camera’s perspective.) You can accomplish this using the

Camera.ScreenPointToRay() function.

Rotation and orbiting. In Unity, the Transform.Rotate method specifies a relative orientation

change that will be composed with the current orientation. Transform.Rotate needs to be given

the amounts to rotate as Euler angles about the X, Y, and Z axes, either as three separate floats

or as a Vector3. It will apply a rotation to the object about the Z-axis, X-axis, and Y-axis (in that

specific order, as discussed in the Unity documentation). You should also read about and use if

10

COMS W4172: 3D User Interfaces and Augmented Reality

Assignment 1—Spring 2025

needed Transform.RotateAround. Please be sure that you understand the relativeTo parameter

of Transform.Rotate and how Transform.{right, up, down} differ from Vector3.{right, up, down}.

In strong contrast to the Transform.Rotate method, the Transform.{rotation, localRotation,

eulerAngles, localEulerAngles} properties set the absolute orientation of a Transform (i.e., will

override and ignore its current orientation) and do this in ways that offer many possibilities for

you to do the wrong thing. Beware: None of the elements of Transform.{rotation, localRotation}

is an angle (they are the components of a quaternion) and none of the angles of

Transform.{eulerAngles, localEulerAngles} should be set individually or incremented! Please

read the preceding sentence over again!

Play mode. While Play Mode provides a very useful way of debugging your app, it is not a

reliable indicator of how it will run on your mobile device. Make sure you test directly on your

device whenever you introduce a new imported asset. While debugging, you will want to include

secondary controls guaranteed to work on your desktop or laptop in Play Mode, such as

Input.GetMouseButton(). Since these controls may affect performance slightly, you will want to

disable them when running on your mobile device. (Or if you feel comfortable with your app’s

performance on your device, you can choose to support both modes.)

Unity Remote. Unity Remote makes it possible to run an application in Play Mode on your

laptop or desktop, while having its output and input appear on and be obtained from your mobile

device, all without any need to deploy to that device. This can make debugging far more

pleasant and less time consuming than it would be if you had to deploy every time you changed

anything! However, it is important to note that Unity Remote will not provide a reliable indicator

of how the application will run on your mobile device and is known for having “issues.” This is

especially true regarding rendering and timing, since Unity Remote renders everything on the

computer on which the editor is running and sends the rendered content as compressed images

through the cable to your mobile device. As with Play mode, make sure you test directly on your

device whenever you introduce a new imported asset. Note also that Unity Remote provides the

ability to change the compression and resolution of the generated graphics, improving

appearance at the expense of computational overhead. We strongly encourage you to use Unity

Remote, provided you deploy frequently when you make changes to test the ‘real’ app.

How to submit

Please turn in a compressed/zipped file containing your entire project, remembering to include

any needed data files. You can do this by navigating to the directory where your Unity projects

are stored and compressing it there. This file will contain:

1. Your Unity project in its entirety.

1. Do not include the app executable (or the XCode project for iOS).

2. Your well-commented code.

3. Your readme.txt file that includes

11

COMS W4172: 3D User Interfaces and Augmented Reality

Assignment 1—Spring 2025

1. Your name

2. UNI

3. Computer platform (Computer OS & OS Version)

4. Unity version

5. Mobile platform, OS version, and device name

6. Description of your project, what you did, and how you accomplished it. Please

also mention mandatory functionalities you were not able to implement, if any.

7. About one page on how you applied the Nielsen usability heuristics.

8. Any problems you overcame (both coding and technical)

9. A list of the free assets you used.

4. Finally, the URL of a brief video, five minutes maximum, demonstrating your application’s

features with you narrating it. You won’t get graded on video content shown after the

five-minute mark. While we are not expecting a painstakingly scripted production, please

practice before recording it and do some simple editing to remove unnecessary pauses.

Submit this as a link in your README file and the CourseWorks File Upload comment to

an unlisted video on YouTube or Google Drive. The upload time of your video on one of

these two sites will be the time at which we will consider it to have been submitted.

Please follow the naming convention “YOURUNI_Assignment1.zip” for your submission. Name

your video “YOURUNI_Assignment1,” upload it as an unlisted video on YouTube, and include

the URL in your submission, as described below. Submission should be done through

CourseWorks, following these steps:

1. Log into CourseWorks.

2. Select Assignments from the navigation pane on the left.

3. Click the Submit Assignment button in the top right corner.

4. The Submit Assignments page will load. Choose your zipped project using the browse

dialog window that appears after pressing “Choose File.”

5. After choosing your project, copy the URL of your unlisted video upload into the

Comments field beneath the File Upload section.

6. Press “Submit.”

Please submit well before the deadline since CourseWorks can sometimes become busy and

slow. You can resubmit multiple times. (Note: CourseWorks will save your previous comments,

so you don’t need to re-enter your URL if it has not changed, but CourseWorks will clear your

previous upload from the File Upload section.) You can add a file you previously uploaded by

clicking “Click here to find a file you've already uploaded,” expanding the Unfiled folder and

selecting your file, then pressing “Submit.”

Immediately after uploading your submission to CourseWorks, please check it by

downloading it, creating a new project with which to test it, and reading through its

README.txt file. We will not accept as an excuse that you accidentally uploaded the

wrong file. We also regret that we cannot accept files that are on your computer or flash

drive, even if they appear to have the correct date.

12

COMS W4172: 3D User Interfaces and Augmented Reality

Assignment 1—Spring 2025

Important: Unity projects tend to be large, which means uploading them to CourseWorks can

take longer than expected. Do not wait until the last few minutes to submit your project. To

avoid any last-minute technical issues, give yourself at least an hour of buffer time to ensure

your submission is uploaded successfully and on time.

Remember, you can use only a single late day on this assignment, so start early! And have fun!

Grading Rubric

We will provide a grading rubric shortly.

13


相关文章

【上一篇】:到头了
【下一篇】:没有了

版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp