FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose...

61
FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY A Project work (A 80088) Submitted in partial fulfillment of the requirements for the award of the degree of Bachelor of Technology in Computer Science and Engineering by Mr. G. PRANEETH REDDY (15261A05D4) Mr. M. DHANA PRASAD (15261A05E9) Under the Guidance of Mr. Y. VENKATESWARLU (Asst. Professor) Ms. D. DEEPIKA (Asst. Professor) Dept. of Computer Science and Engineering MAHATMA GANDHI INSTITUTE OF TECHNOLOGY GANDIPET, HYDERABAD 500 075, INDIA APRIL 2019

Transcript of FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose...

Page 1: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

FURNITURE LAYOUT APPLICATION USING

AUGMENTED REALITY

A Project work (A 80088)

Submitted

in partial fulfillment of the requirements for

the award of the degree of

Bachelor of Technology

in

Computer Science and Engineering

by

Mr. G. PRANEETH REDDY (15261A05D4)

Mr. M. DHANA PRASAD (15261A05E9)

Under the Guidance of

Mr. Y. VENKATESWARLU

(Asst. Professor)

Ms. D. DEEPIKA

(Asst. Professor)

Dept. of Computer Science and Engineering

MAHATMA GANDHI INSTITUTE OF TECHNOLOGY

GANDIPET, HYDERABAD – 500 075, INDIA

APRIL 2019

Page 2: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

i

MAHATMA GANDHI INSTITUTE OF TECHNOLOGY

(Affiliated to Jawaharlal Nehru Technological University Hyderabad)

GANDIPET, HYDERABAD – 500 075. Telangana

CERTIFICATE

This is to certify that the thesis entitled Furniture Layout Application Using

Augmented Reality is being submitted by G. Praneeth Reddy and M. Dhana Prasad in partial

fulfillment for the award of B.Tech in Computer Science and Engineering to Jawaharlal

Nehru Technological University Hyderabad is a record of bonafide work carried out by them

under our guidance and supervision.

The results embodied in this project have not been submitted to any other University or

Institute for the award of any degree or diploma.

Supervisor Supervisor Head of the Department

Mr. Y. Venkateswarlu Ms. D. Deepika Dr.C.R.K. Reddy

Asst. Professor Asst. Professor Professor

External Examiner

Page 3: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

ii

DECLARATION

This is to certify that the work reported in this project titled “FURNITURE LAYOUT

APPLICATION USING AUGMENTED REALITY” is a record of work done by us in the

Department of Computer Science and Engineering, Mahatma Gandhi Institute of Technology,

Hyderabad.

No part of the work is copied from books/journals/internet and wherever the portion is

taken, the same has been duly referred in the text. The report is based on the work done entirely

by us and not copied from any other source.

G. PRANEETH REDDY (15261A05D4)

M. DHANA PRASAD (15261A05E9)

Page 4: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

iii

ACKNOWLEDGEMENT

We would like to express our sincere thanks to Dr. K Jaya Sankar, Principal MGIT, for

providing the working facilities in college.

We wish to express our sincere thanks and gratitude to Dr. C R K Reddy, Professor and HOD,

Department of CSE, MGIT, for all the timely support and valuable suggestions during the period

of project.

We are extremely thankful to Dr. M Rama Bai, Professor, Dr. K Sreekala, Assistant

Professor, Mrs. J Sreedevi, Assistant Professor, Department of CSE, MGIT, major project

coordinators for their encouragement and support throughout the project.

We are extremely thankful and indebted to my internal guide Mr. Y. Venkateswarlu, Assistant

Professor and Ms. D. Deepika, Assistant Professor, Department of CSE, for their constant

guidance, encouragement and moral support throughout the project.

Finally, we would also like to thank all the faculty and staff of CSE Department who helped us

directly or indirectly, for completing this project.

G. PRANEETH REDDY (15261A05D4)

M. DHANA PRASAD (15261A05E9)

Page 5: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

iv

TABLE OF CONTENTS

Certificate i

Declaration ii

Acknowledgement iii

List of Figures vi

List of Tables viii

Abstract

ix

1. Introduction

1.1 Problem Definition

1.2 Existing System

1.3 Proposed System

1.4 Requirements Specification

1.4.1 Software Requirements

1.4.2 Hardware Requirements

1.4.3 Software Specifications

1

1

2

2

4

4

4

4

2. Literature Survey 13

3. Methodology in Augmented Reality for Furniture Industry

3.1 Architecture

3.2 Modules

3.2.1 Creating Augmented Reality Objects

3.2.2 Developing Scenes for User Interface

3.2.3 Place the Virtual Object on the Surface Area

3.2.4 Verification of placed objects

3.3 UML Diagrams

16

16

17

17

18

19

19

20

Page 6: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

v

3.3.1 Use case Diagram

3.3.2 Class Diagram

3.3.3 Sequence Diagram

3.3.4 Activity Diagram

20

21

22

23

4. Testing and Results

4.1 Test Cases

4.2 Output Screens

4.2.1 Home page

4.2.2 Scanning page

4.2.3 Placing the object scene

4.2.4 Rotate and adjust object

4.2.5 Information page

4.2.6 Online store

4.2.7 Colour options

24

24

26

26

27

28

29

30

31

33

5. Conclusion and Future Scope

5.1 Conclusion

5.2 Future Scope

34

34

34

Bibliography 35

Appendix 36

Page 7: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

vi

LIST OF FIGURES

Figure 1.1 Unity software interface 5

Figure 1.2 Interface options 5

Figure 1.3 Project window 6

Figure 1.4 Scene view window 6

Figure 1.5 Hierarchy window 7

Figure 1.6 Inspector window 8

Figure 1.7 Toolbar window 8

Figure 1.8 Autodesk Maya platform 9

Figure 1.9 Texturing the model 11

Figure 3.1 System Architecture of Application 16

Figure 3.2 Developing Augmented Reality objects 17

Figure 3.3 Unity 3D scene of the chair model 18

Figure 3.4 Use case diagram 20

Figure 3.5 Class diagram 21

Figure 3.6 Sequence diagram 22

Figure 3.7 Activity diagram 23

Figure 4.1 Home page 26

Figure 4.2 Scanning page 27

Figure 4.3 Furniture object placed 28

Figure 4.4 Rotated object 29

Figure 4.5 Information page 30

Figure 4.6 Selecting the store 31

Figure 4.7 Online store 32

Page 8: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

vii

Figure 4.8 Colour options 33

Page 9: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

viii

LIST OF TABLES

Table 2.1 Literature survey for the application 14

Table 4.1 Unit Testing 24

Table 4.2 Specification Testing 24

Table 4.3 Code Testing 25

Table 4.4 Integration Testing 25

Table 4.5 Validation Testing 25

Page 10: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

ix

ABSTRACT

Now-a-days information and communication technology support the development of human

interaction with physical, computer and virtual environment such as science, commercial,

banking, education, etc. Augmented reality is a field of computer research which deals

combination of reality with computer related data.

In early days if we users wanted to buy a furniture objects without visiting the shops it was

possible but it was not possible to check how the object actually looks in home structure. Now

in our proposed system, it is possible for user to buy the furniture objects sitting in the home

without visiting the shops. The main purpose of the “Furniture Layout Application Using

Augmented Reality” is to develop an android application for trying different furniture in virtual

way using a mobile which supports AR camera. The application will eliminate the human efforts

by physically visiting the furniture store which is very time-consuming activity. Besides, this it

might be easier to use this technique in Online shopping as an option for user to try out the

furniture items in their room they are thinking to buy and allow user to visualize the room how

it will look after placing furniture in it. User can try out multiple combinations virtually, without

physical movement of furniture items. Our motivation here is to increase the time efficiency and

improve the accessibility of furniture try on by creating furniture augmented reality application.

This system will help the customer to view the furniture object virtually in real environment

before buying the object. Due to this system customer will come to know how his home structure

would look after buying the furniture object. This system would let the user to try multiple

combination of object virtually without physical movement of furniture objects. These will help

the buyer to determine how to setup furniture in home structure.

Keywords: Augmented Reality, Marker Detection, Rendering

Page 11: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

1

1. INTRODUCTION

Augmented reality[1] has been a hot topic in software development circles for a number of

years, but it’s getting renewed focus and attention with the release of products like Google Glass.

Augmented reality is a technology that works on computer vision-based recognition algorithms

to augment sound, video, graphics and other sensor-based inputs on real world objects using the

camera of your device. It is a good way to render real world information and present it in an

interactive way so that virtual elements become part of the real world. Augmented reality

displays superimpose information in your field of view and can take you into a new world

where the real and virtual worlds are tightly coupled. It is not just limited to desktop or

mobile devices.

A simple augmented reality use case is: a user captures the image of a real -world object,

and the underlying platform detects a marker, which triggers it to add a virtual object on

top of the real-world image and displays on your camera screen.

1.1 Problem Definition

As the customer purchases various types of furniture through online, but in online it shows only

photo and cannot be determined size in room. Even though there are certain applications present

which are based on augmented reality they are not suitable for live processing and takes more

time to process the area and some are fixed to a particular image plane. So, to overcome that he

can use this application to check whether the furniture is adjustable or not which can be placed

in the customer living area like home or office using augmented reality images.

Our application is a step in this direction, allowing users to view a 3D rendered model - a virtual

resemblance of the physical furniture without any interruption of the markers - which can be

viewed and configured in real time using our Augmented reality application.

This study proposes a new method for applying Augmented Reality [1] technology to furniture,

where a user can view virtual furniture and communicate with 3D virtual furniture data using a

dynamic and flexible user interface.

Page 12: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

2

1.2 Existing System

Traditional methods of designing include advising and assisting customers who have relied upon

a combination of verbal explanations and 2D drawings through online shopping application.

However, this medium of approach clearly restricted to the limit of explanations provided to

customer for the particular placement of a furniture and makes him less efficient and confused

to buy the furniture.

The main drawbacks in the mediums of existing system are:

• Static view of design which is unable to convey

• Cannot determine the furniture will fix to our needs.

• Information like height and breadth can’t be known.

1.3 Proposed System

With the approach of augmented reality application, this can be easily achieved. Interior

designing is a field where augmented reality has not been able to get its grip to it fullest. People

today are well versed with the technology and are operating smartphones which support AR.

Thus, the concept of creating a furniture layout-based application brings the designer step closer

to being technologically advanced.

With the recent emergence of better cameras and more accurate sensors in soon-to-be

mainstream devices. In our current implementations of application, we use Google AR Core[7]

to accurately detect the real- world environment, such as the locations of walls and points of

intersection, allowing users to place virtual objects into a real context.

The proposed system uses Marker-less Augmented Reality as a basis for enhancing user

experience and for a better perception of things. Marker less tracking is a method of positional

tracking – the determination of position and orientation of an object within its environment. This

is a very important feature in augmented reality (AR), making it possible to know the field-of-

view and perspective of the user - allowing for the environment to react accordingly or the

placement of augmented reality content in accordance with real world. While marker-based

methods of motion tracking use specific optical markers, marker-less positional tracking does

not require them, making it a more flexible method. It also avoids the need for a prepared

environment in which fiducial markers are placed.

Page 13: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

3

The basic premise of the proposed system is to overlay digital 3D models on top of real things

using a camera.

• This Application will use AR supported mobile phone to scan the living area and display

the augmented furniture object to check whether it adjusts or not and that helps in better

choosing of the right furniture for our need.

• Augmented objects are the virtual objects (3D Model) which are similar to furniture tool

developed using Auto desk Maya[8] and Substance painter.

• Autodesk Maya is a software which offers a comprehensive creative feature set for 3D

computer animation, modelling , simulation, rendering, and compositing.

• The next step involves setting up light, shadow, and camera positioning of these models

using various components of Unity 3D.

• Next, the furniture model is selected and the selected model is rendered and processed

to be loaded on the scanned surface by Google AR Core.

• Mapping of 3D model onto the smartphone screen takes place which decides the

dimensions of the model which is then rendered and displayed onto the screen.

Page 14: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

4

1.4 Requirements Specification

1.4.1 Software Requirements

Language : C#

Operating system : Android 8.0 or more

Tools

• Unity 3D

• Autodesk Maya

• Vuforia

• Substance Painter

1.4.2 Hardware Requirements

• RAM Capacity : 4GB

• Memory : 120 MB

• Graphics Card : 1 GB

• Accessories : Smart phone with AR support

1.4.3 Software Specifications

1.4.3.1 Unity

Unity3D is a “game development ecosystem”, it includes an environment for the development

of interactive 2D and 3D content including a rendering and physics engine, a scripting interface

to program interactive content, a content exporter for many platforms (desktop, web, mobile)

and a growing knowledge sharing community [6].

As shown in below figure 1.1 Unity 2018.1 introduces new tools that help artists & designers

tell better visual stories, new ways for teams to collaborate more productively, and more

features than ever to help you succeed in the gaming industry.

Page 15: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

5

Figure 1.1: Unity software interface

Figure 1.2: Interface options

As shown in above figure 1.2, the main editor window is made up of tabbed windows which

can be rearranged, grouped, detached and docked. This means the look of the editor can be

different from one project to the next, and one developer to the next, depending on personal

preference and what type of work you are doing. The default arrangement of windows gives

you practical access to the most common windows. If you are not yet familiar with the different

windows in Unity, you can identify them by the name in the tab.

Page 16: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

6

Figure 1.3: Project window

As shown in above figure 1.3, the Project window displays your library of assets that are

available to use in your project. When you import assets into your project, they appear here.

Figure 1.4: Scene view window

Page 17: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

7

As shown in the above figure 1.4 allows you to visually navigate and edit your scene. The scene

view can show a 3D or 2D perspective, depending on the type of project you are working on.

Figure 1.5: Hierarchy window

As shown in above figure 1.5, the Hierarchy window is a hierarchical text representation of

every object in the scene. Each item in the scene has an entry in the hierarchy, so the two

windows are inherently linked. The hierarchy reveals the structure of how objects are attached

to one another.

Page 18: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

8

Figure 1.6: Inspector window

As shown in above figure 1.6, the Inspector window allows you to view and edit all the

properties of the currently selected object. Because different types of objects have different sets

of properties, the layout and contents of the inspector window will vary.

Figure 1.7: Toolbar window

As shown in above figure 1.7, the Toolbar window provides access to the most essential

working features. On the left it contains the basic tools for manipulating the scene view and

the objects within it. In the centre are the play, pause and step controls. The buttons to the right

give you access to your Unity Cloud Services and your Unity Account, followed by a layer

visibility menu, and finally the editor layout menu.

Page 19: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

9

1.4.3.2 Maya

Maya is a program, created by Autodesk, used to model, animate, and render 3D scenes. 3D

scenes created with Maya have appeared in movies, television, advertisements, games,

product visualizations, and on the Web. With Maya, you can create and animate your own 3D

scenes and render them as still images or as animation sequences as shown in below figure

1.8.

Figure 1.8: Autodesk Maya platform

• Several versions of Maya exist and the difference between them lies in the features that

are included in each. The commercial version of Maya includes everything you need

to create and render 3D scenes and animations. An advanced version of Maya also

includes the Fluid Effects, Cloth, Hair and Fur features. A freely available version of

Maya called the Personal Learning Edition is also available. The Personal Learning

Edition is identical to Maya Complete, except that all renderings include a watermark,

making it a great place to start if you want to learn Maya.

Page 20: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

10

• At first glance, the Maya interface can be a little daunting, with buttons, controls, and

parameters everywhere, but if you look closer you’ll realize that all of the controls are

grouped into logical sets. Becoming familiar with these various sets of controls makes

the interface much easier to work with.

• Along the top edge of the interface are the menus and a toolbar of buttons called the

Status Line. The menus will change depending on the mode that you’re working in.

Below the Status Line is a tabbed row of buttons. This row of buttons is called the Shelf,

and it offers a convenient way to group sets of commands together. To the right of the

interface is a panel of parameters called the Channel Box. These parameters, known as

attributes, will change as different objects are selected. Under the Channel Box is the

Layer Editor.

• Along the bottom of the interface are the Time Slider, the Range Slider, and the

animation controls, which are used to specify and move between the different frames

of an animation sequence; also at the bottom are the Command Line, for entering

textual commands, and the Helpline. Finally, the horizontal column of buttons to the

left of the interface is known as the Toolbox and the Quick Layout buttons. These

buttons are used to select and transform scene objects and to change the interface

layout.

➢ A key concept that you need to understand as you begin to work with the

interface is that there are several ways to access the same command. For

example, you can create a sphere using the Create, Polygon Primitives, Sphere

menu command or by using the Polygon Sphere button in the Polygons shelf.

This design is intentional, allowing beginners an intuitive method for accessing

a command, and giving advanced users an access method that lets them work

quicker as they learn the shortcuts.

➢ One of the quickest ways to access advanced-user commands is with the Secret

menus. These context-specific pop-up menus appear when you right-click in the

interface. Another quick way to access commands is with keyboard shortcuts,

known as hotkeys.

Page 21: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

11

• Maya gives users the option to customize the interface. Using the customization

features, you can create a custom set of command icons, define keyboard shortcuts,

and even alter menus. Many of the customization options are included in the Window,

Settings/Preferences

1.4.3.3 Substance Painter

Substance Painter is a 3D painting software allowing you to texture and render your 3D

meshes. It is used for assets that have a specific UV layout. Substance Designer is used more

for creating tile able, dynamic and modular textures. It’s often used to create a base material

library where materials can be used in other applications such as Substance Painter.

Figure 1.9: Texturing the model

As shown in the above figure 1.9 it describes how the texturing is made on furniture model to

make it look like realistic.

Page 22: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

12

1.4.3.4 Vuforia

Vuforia is an augmented reality software development kit for mobile devices that enables the

creation of augmented reality applications. It uses computer vision technology to recognize and

track planar images and simple 3D objects, such as boxes, in real time. This image registration

capability enables developers to position and orient virtual objects, such as 3D models and

other media, in relation to real world images when they are viewed through the camera of a

mobile device. The virtual object then tracks the position and orientation of the image in real-

time so that the viewer's perspective on the object corresponds with the perspective on the

Image Target. It thus appears that the virtual object is a part of the real-world scene.

The Vuforia SDK supports a variety of 2D and 3D target types including ‘markerless’ Image

Targets, 3D Multi-Target configurations, and a form of addressable Fiducial Marker, known

as a VuMark. Additional features of the SDK include localized Occlusion Detection using

‘Virtual Buttons’, runtime image target selection, and the ability to create and reconfigure

target sets programmatically at runtime.

Page 23: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

13

2. LITERATURE SURVEY

The research for augmented reality technology has brought up development of various

applications in the field of computer science. In this literature review, it shows how the

implementation of augmented reality in various fields using unity 3D.

Santosh Sharma, Yash Kaikini, Parth Bhodia, Sonali Vaidya has proposed technique

named “Marker less Augmented Reality based Interior Designing system”, which uses Marker-

less Augmented Reality as a basis for enhancing user experience and for a better perception of

things. It has advantage of no need of markers in the surface area and disadvantage is Object is

aligned with camera so that it moves as we move a camera.

Snehal Mangale, Nabil Phansopkar, Safwaan Mujawar, Neeraj Singh has proposed

technique named “Virtual Furniture Using Augmented Reality”[2] which is a web based

application where user, have to place the marker in a room where they want to try out furniture

items. The user’s webcam will be on and through the webcam they will capture the live feed

of the room. Application captures the image and passes through predefined marker detection

algorithm. Algorithm is based on image processing techniques using color and other properties

as the input to detect the marker. User initially selects the furniture to be placed from the given

database. The application superimposes furniture on the original image with the center

coinciding with the markers center in both directions. Furniture objects are overlaid on to the

two dimensional image frame acquire from webcam. This will appear as if it is actually placed

in the real world. And finally the user can view how the area looks with the furniture present.

Khushal Khairnar, Kamleshwar Khairnar, Sanket kumar Mane, Rahul Chaudhari has

proposed a technique named “Furniture Layout Application Based on Marker Detection and

Using Augmented Reality” to develop an application where user have to place the marker in a

room where he want to try out furniture items. The user’s webcam will be on and through the

webcam he will capture the live feed of the room. Then application search the marker using

fiducial marker detection algorithm. To identify the position of marker using direct linear

transformation algorithm. Whichever furniture object the user want to try out he will select that

object from the database. Then the application will superimpose 3D object. In three

dimensional objects are overlaid on to the two dimensional image frame acquire from webcam.

Page 24: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

14

This will appear as it is actually placed in the real world. And finally the user can view the

room and object from different angles.

Table 2.1: Literature survey for the application

S.No Year Author Title Techniques Advantages Disadvantages

1. 2018 Santosh

Sharma, Yash

Kaikini, Parth

Bhodia, Sonali

Vaidya

Marker less

Augmented

Reality based

Interior

Designing

System

It uses Marker-less

Augmented

Reality as a basis

for enhancing user

experience and for

a better perception

of things

No need of

markers in the

surface area.

Object is aligned

with camera so

that it moves as

we move a

camera.

2. 2016 Snehal Magale,

Nabil

Phansopkar,

Safwaan

Mujawar,

Neeraj Singh

Virtual

Furniture

Using

Augmented

Reality

A web-based

application where

user have to place

the marker in a

room where they

want to try out

furniture items.

It is faster in

image

capturing and

provide high

resolution for

furniture 3D

model

It is based on

personal

computer

webcam and

every time the

captured image is

to be loaded into

web application

for processing

3. 2016 Mami Mori,

Jason Orlosky,

Kiyoshi

Kiyokawa,

Haruo

Takemura

A

Transitional

AR Furniture

Arrangement

System with

Automatic

View

Recommend

ation

Subjects were first

asked to memorize

a furniture layout

presented on a

desktop monitor.

They were allowed

to examine and

manipulate the 3D

model using a

mouse for as long

as they wished.

Once satisfied,

they wore the

a transitional

AR furniture

arrangement

system that

recommends a

secondary

view that can

improve a

user’s

understanding

of a room

layout and

It is desktop-

based application

ands

needs stereo

camera and

should be placed

at minimal

and marker

based.

Page 25: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

15

video see-through

headset and used a

game pad to place

the furniture

objects based on

their memory of

the scene

contains two

scenes

high occlusion

and low

occlusion.

4. 2015 Jiang Hui Approach to

The Interior

Design using

Augmented

Reality

Technology

to design the

structure and

function of the

space, and to

decorate the

interior space

based on the

customers

interior design

can reduce the

cost and

provide the

multimedia

augmentation

of high vivid

simulations for

user in real

time

Requires huge

amount of

information and

quality of object

is low.

5. 2015 Elizabeth

Carvalho,

Gustaava

Macaes, Isabel

Varajao,

Nuno Sousa,

Paulo Brito

Use of

Augmented

Reality in

furniture

industry

Template matching

technique to

reference image to

rigid object

Use

Simultaneous

Localization

and Mapping

(SLAM) that

helps in fixing

to rigid body

Marker based and

can be placed

only on the

predefined

images.

Page 26: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

16

3. METHODOLOGY IN AUGMENTED REALITY FOR

FURNITURE INDUSTRY

3.1 Architecture

The system basically uses mobile phone built-in camera which supports Augmented reality to

collect view as the real scene view observed by human eye and stacks the 3D furniture models

on the screen displayed. First of all, we need to setup the scenes in Unity 3D[6] for User

Interface of application like buttons, text areas, background image and virtual object selection.

Later we build 3D furniture models by Autodesk Maya and import the models into Unity 3D.

Through identifying and tracing the surface area, the camera obtains pointers using Google AR

Core and establishes projection models, at last stacks the imported 3D virtual model in the

Real-world view. Because Android smart phone has touch-screen interface function, we can

place the furniture by sliding screen.

Figure 3.1: System Architecture of Application

As shown from the above figure 3.1, it describes the architecture of the application that take

the real view as input with the help of AR camera then process it with virtual object to get the

resultant output as augmented display.

Page 27: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

17

3.2 Modules

The application implementation consists of four modules.

• Creating Augmented Reality Objects.

• Developing Scenes for User Interface.

• Place the Object on the Surface Area.

• Verification of placed objects.

3.2.1 Creating Augmented Reality Objects

First, we should establish virtual models with the help of Autodesk Maya[8] software to create

3D furniture models, the models mainly use Polygon and NURBS modeling methods, the

animation mainly uses key frame and expression animation technology. After establishing

models in Autodesk Maya, four important information of the model will be stored in the file of

each model, they are the model’s vertex coordinate, texture coordinate, normal coordinate and

the total number of polygons, these data are the main data when rendering model. Application

will store them in memory and read them to render models when calling rendering function.

The data quantity of the model is very huge, so we need a loading module of the model to make

it loaded into program conveniently. Later we export the model data, the file exported by

Autodesk Maya is .obj file, which stores above information, next convert the information to

file which is available in program by model loader and obtain the model data by calling head

file. After loading model data, we can render and display it in the scene through Unity 3D[6].

Figure 3.2: Developing Augmented Reality objects

Page 28: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

18

As shown from the above figure 3.2 it shows how the 3D objects are developed for this

application using the Autodesk Maya. In the figure it shows the front view, side view, top view,

3D view of the object that is been created.

3.2.2 Developing Scenes for User Interface

In this module we create scenes for every slide of application using Unity 3D. The main

interface interacts by sliding browsing and selecting the key. The main interface contains

furniture model, buttons that helps to move to next model, to scan the surface area of living

room, description of model such as length, width, height and for buying the model in online

store. The furniture column stores the key of all furniture, display one furniture at a time and

which also supports sliding browsing. In order to implement these functions, we make the scene

display to ratio of Android display and add the buttons to the scene that helps in moving to next

scene. Later we import the 3D model developed using Autodesk Maya[8] and functionalities

like rotating the chair while displayed using C# code for that object and add functionalities to

move to next scene.

Figure 3.3: Unity 3D scene of the chair model

As shown in the above figure 3.3, it shows the Unity 3D platform that is used to create scene

for the chair model that is used as furniture which is imported from Autodesk Maya. For every

model of the furniture we will create an individual scenes and at final we combine all scenes.

Page 29: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

19

3.2.3 Place the Virtual Object on the Surface Area

In this scenario, we use the help of Google AR core[7] package which will be imported in Unity

3D and modify the package that will help us to scan the surface of living area where we need

to place the virtual object in in the real world. Once the modifications to Google AR core has

done, we will create scene such that after the surface area is scanned and when the user tap on

the touch screen then the virtual 3D model will be rendered or integrated with the living area

so that user can verify the object furniture model suits to our needs. The user can drag-and-

drop virtual furniture model according to his desired in the real scene via user interface

provided at this stage.

3.2.4 Verification of placed objects

Once the user thinks that the object is well suited to his need, he can check the description by

selecting the information button that helps in describing the width, height and length of object.

In order to view this description, we create another scene that helps in displaying all the

required information. We add another button that helps in redirecting to online store where the

furniture is available to purchase. We add one more button that helps in rotating object by an

angle of 30°. For this rotation and link redirection we use two classes which are programmed

with C#.

Page 30: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

20

3.3 UML Diagrams

3.3.1 Use case Diagram

Figure 3.4: Use case diagram

As shown from the above figure 3.4, it describes the use case diagram of the application where

the user interacts with application using Android device that supports AR camera. Initial we

select the model in which we are interested then scan the surroundings using camera of device

and place the model to verify whether it fulfill our needs, if satisfied we can move to online

store. The actor here is the user and uses cases select 3D furniture, scan the surface, place the

3D furniture, view the information and redirect to online store if satisfied.

Page 31: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

21

3.3.2 Class Diagram

Figure 3.5: Class diagram

As shown from the above figure 3.5, it describes the class diagram of the application where the

main classes include AR Camera, Model Target, Object, Lean touch, Canvas. AR Camera

consists of the main configuration to be set to get the 3D model when model target is given by

user. Canvas class consists of the buttons and texts that are used in the application interface.

Object is the 3D model and consists of the information of scaling, transform. Lean touch class

consists of how to rotate application i.e. portrait or landscape and all user interactions with the

device using lean touch scripts.

Page 32: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

22

3.3.3 Sequence Diagram

Figure 3.6: Sequence diagram

As shown in the above figure 3.6, it describes the sequence diagram of the application, i.e. how

the application is started and to the end of the resultant augmented display in a sequence of

interactions. User, application, AR Camera, image position, 3D object, Online store are the

main objects of this diagram. First user starts the application and holds the living area by

scanning surface. As soon as the area is scanned the 3D model selected is placed over the area.

After that if user satisfy then he can move to online store else return to home page of this

application.

Page 33: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

23

3.3.4 Activity Diagram

Figure 3.7: Activity diagram

As shown from the above figure 3.7, it describes the activity diagram of the application that

consists of flow of the application which has the actions Dashboard view for selecting the

model i.e. home page. Next scan the surface, place 3D model and finally if satisfied move to

online store.

Page 34: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

24

4. TESTING AND RESULTS

4.1 Test Cases

Testing is debugging program which is one of the critical aspects of the computer programming

triggers. It is process of evaluating a system or its component(s) with the intent to find that

whether it satisfies the specified requirements or not. It is executing a system in order to identify

any gaps, errors or missing requirements in country to the actual desire or requirements.

Table 4.1: Unit Testing

ACTION RESULT REMARKS

Add image target in the

Hierarchy

Camera not set to AR camera Added AR camera in the

hierarchy window

Press play button to see the

animation

Animation cannot be added to

the game object as the animator

is not set to the inspector

window

Added animator scene in the

inspector window

Table 4.2: Specification Testing

ACTION RESULT REMARKS

Opening software to make a

new AR scene

Launch error Download patch file from

online and executed to launch

software and clear previous

error

Changing scene from one level

to another level

Missing Scene Manager

Package

Added Scene Manager package

in the scene changing script

Press the button to play the

object

AR object is missing in play

scene mode

Import the 3D model from Auto

desk Maya

Page 35: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

25

Table 4.3: Code Testing

ACTION RESULT REMARKS

Tap to place the 3D object 3D object is not placed Add Google AR package to 3D

model and modify package.

Rotating the 3D object in clock

wise direction

3D object doesn’t rotate Added transformation.position

class in the script

Touch the screen to adjust the

3D object

Touch doesn’t work when

focused on the image target

Added Lean touch script to the

3D object

Changing the scene from one

mode to another mode

UI button doesn’t work as the

function to go forward to

another mode

Added function to UI button

Table 4.4: Integration Testing

ACTION RESULT REMARKS

Building app Failed to build Add Android SDK in the

builds

Application failed to open Google AR core is missing Download Google AR core

from play store

Table 4.5: Validation Testing

ACTION RESULT REMARKS

Open the application and

target the 3D model

3D object is projected in real

world environment using the

image target

Application runs

successfully

Page 36: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

26

4.2 Output Screens

4.2.1 Home page

When the application is launched the home page appears where we can able to select the

furniture model that is needed to buy and verify whether it suits our living area.

Figure 4.1: Home page

As shown in the above figure 4.1 it shows the home page that displays the chair object, if we

need to choose another object we can move to other object by pressing arrow buttons.

Page 37: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

27

4.2.2 Scanning page

After the furniture objected is selected by tapping on the object that we choose. Next we move

to the scanning scene where we need to scan the plane where the furniture object is to be placed.

Scanning the surface will create the points on the floor using Google AR core.

Figure 4.2: Scanning page

As shown in the above figure 4.2 , it shows how the living area is scanned to find the plane in

order to place the selected object.

Page 38: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

28

4.2.3 Placing the object scene

Once the surface plan is scanned and obtained the points of the place we can tap on the screen

to place the furniture object where ever we need over the plane. Along with the object placed,

we get UI buttons that helps in moving to Home page, Information page, Online store, rotating

the object.

Figure 4.3: Furniture object placed

As shown in the above figure 4.3, it shows the furniture virtual 3D object that has been placed

in the real world i.e, augmented display.

Page 39: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

29

4.2.4 Rotate and adjust object

After the furniture object is placed we can adjust the object by making use of rotation UI button

which hellps in rotating the object by an angle of 30° per click.

Figure 4.4: Rotated object

As shown in the above figure 4.4, it shows the object rotated after it has been placed using

rotate button provided at the top left corner of the application.

Page 40: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

30

4.2.5 Information page

Once the object is adjusted and satisfied to our living area, we can view the description of the

furniture object like name, height, width using the information button provided at the bottom

left corner of the application.

Figure 4.5: Information page

As shown in the above figure 4.5, it shows the description of the furniture object like product

dimensions, material, colour, style, warranty. We can go back using back button.

Page 41: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

31

4.2.6 Online store

Once the user thinks that furniture is satisfactory to his needs he can move to online the store

to buy the furniture using the buy button provided at the bottom right corner of the application.

Once user clicks this button, it redirects to open the online store to where the object can be

bought or displays a page if it is available in two different online stores.

Figure 4.6: Selecting the store

As shown in the above figure 4.6, it shows that we need to choose where to buy the furniture

whether it can be flipkart or amazon. Later on selecting a particular store it redirects to online

store.

Page 42: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

32

Figure 4.7: Online store

As shown in the above figure 4.7, it shows the online store application Amazon where the user

can proceed for buying the furniture.

Page 43: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

33

4.2.7 Colour change

Once the user thinks that furniture is not satisfactory to his needs he can change the colour

options at bottom left corner of the application then he can access store to buy the furniture

using the buy button provided at the bottom right corner of the application. Once user clicks

this button, it redirects to open the online store to where the object can be bought.

Figure 4.8: Colour options

As shown in the above figure 4.8, it shows the Colour options application where the user can

select the right colours for buying the furniture.

Page 44: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

34

5. CONCLUSION AND FUTURE SCOPE

5.1 Conclusion

The main objective of this “Furniture Layout Application Using Augmented Reality” is to

analyse the use of augmented reality to render the furniture model in real world. Augmented

reality [5] technology that allows the customers to decide and interact the furniture with the

real world, offering new possibilities for furniture online shopping. It helps the customer to

view and understand the furniture for his requirements. Due to this customer will come to know

how their home structure would look after purchasing and placing the furniture object with

multi-colour option. These helps the buyer in determining how to setup the furniture in their

home structure. Augmented reality support for furniture help in creating many new

opportunities for future research to anticipate new ideas in the field of online shopping as

customer will get benefit with these types of applications and gives a better understanding and

decision making for purchasing a furniture in an efficient way. Augmented reality is new

evolving technology in the field of computer science and will make us much more helpful than

the traditional technologies [5].

5.2 Future Scope

In future our “Furniture Layout Application Using Augmented Reality” dataset and scope will

be scalable. The user might not only be able to try out different furniture objects but they can

also try out this application by trying on garments, goggles, watches, hair styles etc. It can also

be used for various applications in shopping malls, interior designing, Medical Science etc.

New technology may come into existence in future that will help in developing 3D models

automatically.

Page 45: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

35

BIBLIOGRAPHY

[1] Mami Mori, Jason Orlosky, Kiyoshi Kiyokawa, Haruo Takemura. (2016, Sep.). A

Transitional AR Furniture Arrangement System with Automatic View Recommendation.

IEEE Adjunct. [Online]. 21(3).pp.21-24. ISBN: 978-1-5090-3740-7. Available:

https://ieeexplore.ieee.org/document/7836488

[2] Snehal Mangale, Nabil Phansopkar, Safwaan Mujawar, Neeraj Singh. (2016, May). Virtual

Furniture Using Augmented Reality. IOSR Journal of Computer Engineering. [Online]. e-

ISSN: 2278-0661, p-ISSN: 2278-8727, pp.42-46. Available: http://www.iosrjournals.org/iosr-

jce/papers/Conf.16051/Volume-1/9.%2042-46.pdf?id=7557

[3] Elizabeth Carvalho, Gustavo Maçães, Isabel Varajão, Nuno Sousa and Paulo Brito. (2011,

Nov.). Use of Augmented Reality in the furniture industry. Presented at Center for Computer

Graphics. [Online]. Available:

https://www.researchgate.net/publication/236863499_Use_of_Augmented_Reality_in_the_fu

rniture_industry

[4] Khushal Khairnar, Kamleshwar Khairnar, Sanket kumar Mane, Rahul Chaudhari. (2015,

Oct.). Furniture Layout Application Based on Marker Detection. International Research

Journal of Engineering and Technology. [Online]. 02(07). p-ISSN: 2395-0072, e-ISSN: 2395-

0056. Available: https://www.irjet.net/archives/V2/i7/IRJET-V2I780.pdf

[5] Billinghurst, M. (2002) “Augmented reality in education” in New Horizons for Learning,

2nd ed., vol.3, New York: McGraw-Hill, 2010, pp. 123-135.

Page 46: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

36

APPENDIX

/* Load Application scenes - MenuStart.cs */

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class MenuStart : MonoBehaviour {

public void changemenuscene(string scenename)

{

Application.LoadLevel(scenename);

}

}

/* Rotate.cs */

using UnityEngine;

using System.Collections;

public class Rotate : MonoBehaviour

{

public float speed = 10f;

void Update()

{

transform.Rotate(Vector3.up, speed * Time.deltaTime);

}

}

Page 47: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

37

/* Google AR core package modification – HelloARController.cs */

//-----------------------------------------------------------------------

// <copyright file="HelloARController.cs" company="Google">

//

// Copyright 2017 Google Inc. All Rights Reserved.

//

// Licensed under the Apache License, Version 2.0 (the "License");

// you may not use this file except in compliance with the License.

// You may obtain a copy of the License at

//

// http://www.apache.org/licenses/LICENSE-2.0

//

// Unless required by applicable law or agreed to in writing, software

// distributed under the License is distributed on an "AS IS" BASIS,

// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

// See the License for the specific language governing permissions and

// limitations under the License.

//

// </copyright>

//-----------------------------------------------------------------------

namespace GoogleARCore.Examples.HelloAR

{

using System.Collections.Generic;

using GoogleARCore;

using GoogleARCore.Examples.Common;

using UnityEngine;

using UnityEngine.UI;

#if UNITY_EDITOR

// Set up touch input propagation while using Instant Preview in the editor.

using Input = InstantPreviewInput;

#endif

/// <summary>

Page 48: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

38

/// Controls the HelloAR example.

/// </summary>

public class HelloARController : MonoBehaviour

{

/// <summary>

/// The first-

person camera being used to render the passthrough camera image (i.e. AR background).

/// </summary>

public Camera FirstPersonCamera;

/// <summary>

/// A prefab for tracking and visualizing detected planes.

/// </summary>

public GameObject DetectedPlanePrefab;

/// <summary>

/// A model to place when a raycast from a user touch hits a plane.

/// </summary>

public GameObject AndyAndroidPrefab;

/// <summary>

/// A gameobject parenting UI for displaying the "searching for planes" snackbar.

/// </summary>

public GameObject SearchingForPlaneUI;

/// <summary>

/// The rotation in degrees need to apply to model when the Andy model is placed.

/// </summary>

private const float k_ModelRotation = 180.0f;

/// <summary>

/// A list to hold all planes ARCore is tracking in the current frame. This object is used a

cross

/// the application to avoid per-frame allocations.

/// </summary>

Page 49: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

39

private List<DetectedPlane> m_AllPlanes = new List<DetectedPlane>();

/// <summary>

/// True if the app is in the process of quitting due to an ARCore connection error, other

wise false.

/// </summary>

private bool m_IsQuitting = false;

/// To check the instance has been placed once

public bool is_placed = false;

//public Text display_dist;

private GameObject andyObject;

public GameObject button1;

public GameObject button2;

public GameObject button3;

public GameObject button4;

public GameObject button5;

public GameObject button6;

public GameObject shw_text;

private bool display_text = false;

private bool display_btn=false;

/// <summary>

/// The Unity Update() method.

/// </summary>

///

// Use this for initialization

Page 50: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

40

public void Update()

{

_UpdateApplicationLifecycle();

// Hide snackbar when currently tracking at least one plane.

Session.GetTrackables<DetectedPlane>(m_AllPlanes);

bool showSearchingUI = true;

for (int i = 0; i < m_AllPlanes.Count; i++)

{

if (m_AllPlanes[i].TrackingState == TrackingState.Tracking)

{

showSearchingUI = false;

if(is_placed == false)

{

display_text = true;

}

break;

}

}

shw_text.SetActive(display_text);

SearchingForPlaneUI.SetActive(showSearchingUI);

// If the player has not touched the screen, we are done with this update.

Touch touch;

if (Input.touchCount < 1 || (touch = Input.GetTouch(0)).phase != TouchPhase.Began)

{

return;

}

// Raycast against the location the player touched to search for planes.

TrackableHit hit;

TrackableHitFlags raycastFilter = TrackableHitFlags.PlaneWithinPolygon |

Page 51: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

41

TrackableHitFlags.FeaturePointWithSurfaceNormal;

if ((Frame.Raycast(touch.position.x, touch.position.y, raycastFilter, out hit)))

{

// Use hit pose and camera pose to check if hittest is from the

// back of the plane, if it is, no need to create the anchor.

if ((hit.Trackable is DetectedPlane) &&

Vector3.Dot(FirstPersonCamera.transform.position - hit.Pose.position,

hit.Pose.rotation * Vector3.up) < 0)

{

Debug.Log("Hit at back of the current DetectedPlane");

}

else if(is_placed == false)

{

/// It wont come to this method again.

is_placed = true;

// Vector3 a = FirstPersonCamera.transform.position - hit.Pose.position;

//TextAlignment.text = a.x + " " + a.y + " " + a.z;

// Instantiate Andy model at the hit pose.

andyObject = Instantiate(AndyAndroidPrefab, hit.Pose.position, hit.Pose.rotation);

display_text = false;

shw_text.SetActive(display_text);

//display_dist.text = "Display : "+a.x + " " + a.y + " " + a.z;

// Compensate for the hitPose rotation facing away from the raycast (i.e. camera)

.

andyObject.transform.Rotate(0, k_ModelRotation, 0, Space.Self);

// Create an anchor to allow ARCore to track the hitpoint as understanding of the

physical

// world evolves.

Page 52: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

42

var anchor = hit.Trackable.CreateAnchor(hit.Pose);

// Make Andy model a child of the anchor.

andyObject.transform.parent = anchor.transform;

display_btn = true;

}

button1.SetActive(display_btn);

button2.SetActive(display_btn);

button3.SetActive(display_btn);

button4.SetActive(display_btn);

button5.SetActive(display_btn);

button6.SetActive(display_btn);

}

}

public void Button_Click()

{

//if (Input.GetKey(KeyCode.RightArrow))

//transform.Rotate(Vector3.up, rotSpeed * Time.deltaTime);

andyObject.transform.Rotate(0, 30, 0, Space.Self);

}

/// <summary>

/// Check and update the application lifecycle.

/// </summary>

private void _UpdateApplicationLifecycle()

{

// Exit the app when the 'back' button is pressed.

if (Input.GetKey(KeyCode.Escape))

{

Application.Quit();

}

// Only allow the screen to sleep when not tracking.

Page 53: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

43

if (Session.Status != SessionStatus.Tracking)

{

const int lostTrackingSleepTimeout = 15;

Screen.sleepTimeout = lostTrackingSleepTimeout;

}

else

{

Screen.sleepTimeout = SleepTimeout.NeverSleep;

}

if (m_IsQuitting)

{

return;

}

// Quit if ARCore was unable to connect and give Unity some time for the toast to app ear.

if (Session.Status == SessionStatus.ErrorPermissionNotGranted)

{

_ShowAndroidToastMessage("Camera permission is needed to run this application.");

m_IsQuitting = true;

Invoke("_DoQuit", 0.5f);

}

else if (Session.Status.IsError())

{

_ShowAndroidToastMessage("ARCore encountered a problem connecting. Please

start the app again.");

m_IsQuitting = true;

Invoke("_DoQuit", 0.5f);

}

}

/// <summary>

/// Actually quit the application.

/// </summary>

private void _DoQuit()

{

Page 54: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

44

Application.Quit();

}

/// <summary>

/// Show an Android toast message.

/// </summary>

/// <param name="message">Message string to show in the toast.</param>

private void _ShowAndroidToastMessage(string message)

{

AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPl

ayer");

AndroidJavaObject unityActivity = unityPlayer.GetStatic<AndroidJavaObject>("curr

entActivity");

if (unityActivity != null)

{

AndroidJavaClass toastClass = new AndroidJavaClass("android.widget.Toast");

unityActivity.Call("runOnUiThread", new AndroidJavaRunnable(() =>

{

AndroidJavaObject toastObject = toastClass.CallStatic<AndroidJavaObject>("m

akeText", unityActivity,

message, 0);

toastObject.Call("show");

}));

}

}

}

}

Page 55: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

45

/* Redirection to online shopping application – buy.cs */

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class buy : MonoBehaviour

{

// Start is called before the first frame update

public void buybed()

{

Application.OpenURL("https://www.amazon.in/Spacewood-Queen-Woodpore-Finish-

Natural/dp/B076D7QK9B/ref=sr_1_7?s=kitchen&ie=UTF8&qid=1551717939&sr=1-7");

}

public void buysofa()

{

Application.OpenURL("https://www.amazon.in/Uberlyfe-Premium-Centerville-Pillows-

SCB-001735-HDRL-LTBR/dp/B07NTM6X28/ref=pd_sbs_196_1/258-4899201-

3823227?_encoding=UTF8&pd_rd_i=B07NTM6X28&pd_rd_r=61e0ad63-3e9e-11e9-9b9f-

e50f1baa143f&pd_rd_w=YpSQp&pd_rd_wg=2bu9P&pf_rd_p=87667aae-831c-4952-ab47-

0ae2a4d747da&pf_rd_r=MGHJQEB10WFEK0P83726&psc=1&refRID=MGHJQEB10WFE

K0P83726");

}

public void buychair()

{

Application.OpenURL("https://www.amazon.in/RK-Furniture-Sheesham-Cushion-

Chestnut/dp/B07PBJN5ZL/ref=sr_1_1?s=kitchen&ie=UTF8&qid=1551718137&sr=1-1");

}

public void buydesk()

{

Application.OpenURL("https://www.amazon.in/Forzza-Odessa-Rack-Wheels-

Wenge/dp/B074ZFMRZW/ref=sr_1_61?s=kitchen&ie=UTF8&qid=1551718899&sr=1-61");

}

public void buydinning()

{

Application.OpenURL("https://www.flipkart.com/cello-proline-plastic-4-seater-dining-

Page 56: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

46

table/p/itmf46hymz7wngge?pid=DNTF46HYYRBZYMZU&lid=LSTDNTF46HYYRBZYM

ZU6SUW4P&marketplace=FLIPKART&srno=b_1_1&otracker=CLP_lhs&fm=neo%2Fmerc

handising&iid=355f785f-9ee6-408e-8f2b-

96d4ca1d97f8.DNTF46HYYRBZYMZU.SEARCH&ppt=StoreBrowse&ppn=Store&ssid=ms

1t7fcz1s0000001555843378315");

}

public void buytvtable()

{

Application.OpenURL("https://www.flipkart.com/home-full-engineered-wood-tv-

entertainment-

unit/p/itmf73xgxpmvs8qm?pid=TVUF72XZPR9VJAZD&lid=LSTTVUF72XZPR9VJAZDG

ZSTNL&marketplace=FLIPKART&srno=b_1_9&otracker=nmenu_sub_Home%20%26%20

Furniture_0_TV%20Units%20%26%20Cabinets&fm=neo%2Fmerchandising&iid=50f8bc0e

-94ab-4c27-ad0b-

f8ea80ced0e6.TVUF72XZPR9VJAZD.SEARCH&ppt=StoreBrowse&ppn=Store&ssid=ssut

wci45s0000001555843608601");

}

public void shoestand()

{

Application.OpenURL("https://www.flipkart.com/bonita-metal-shoe-

stand/p/itmezb4urgbtnzs4?pid=SHKEZB3PFFKWU9FZ&lid=LSTSHKEZB3PFFKWU9FZ

XXUSBY&marketplace=FLIPKART&srno=b_1_3&otracker=clp_banner_1_6.bannerX3.BA

NNER_shoerackclp-store_1J583U13QF&fm=neo%2Fmerchandising&iid=e654c60c-3c49-

4a11-8881-

0b01ee7186cf.SHKEZB3PFFKWU9FZ.SEARCH&ppt=StoreBrowse&ppn=Store&ssid=jm

mflqvi1s0000001555843824841");

}

public void buydesk()

{

Application.OpenURL("https://www.amazon.in/Forzza-Odessa-Rack-Wheels-

Wenge/dp/B074ZFMRZW/ref=sr_1_61?s=kitchen&ie=UTF8&qid=1551718899&sr=1-61");

}

Page 57: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

47

public void buychair3()

{

Application.OpenURL("https://www.amazon.com/Great-Deal-Furniture-295398-

Clarice/dp/B00P2ZPKKS?ref_=fsclp_pl_dp_1");

}

public void buyBed24()

{

Application.OpenURL("https://www.snapdeal.com/Heritage-Mandos-Rack-Wheels-

Wenge/dp/MF5GJGJIRY94/ref=sr_1_61?s=kitchen&ie=UTF8&qid=1551718899&sr=1-

61");

}

public void buydesk5()

{

Application.OpenURL("https://www.amazon.in/Forzza-Odessa-Rack-Wheels-

Wenge/dp/BDKFUNF696/ref=sr_1_65?s=kitchen&ie=UTF8&qid=1551718899&sr=1-61");

}

public void buydesk6()

{

Application.OpenURL("https://www.amazon.in/Forzza-Odessa-Rack-Wheels-

Wenge/dp/B07KDFBUEF/ref=sr_1_68?s=kitchen&ie=UTF8&qid=1551718899&sr=1-61");

}

public void buydes7k()

{

Application.OpenURL("https://www.amazon.in/Heritage-Mandos-Rack-Wheels-

Wenge/dp/B074ZFMRZW/ref=sr_1_69?s=kitchen&ie=UTF8&qid=1551718899&sr=1-61");

}

Page 58: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

48

public void buychair2()

{

Application.OpenURL("https://www.flipkart.com/hometown-stella-solid-wood-dining-

chair/p/itmer6ynawjzqpgy?pid=DNCER6YFCCYHESTC&lid=LSTDNCER6YFCCYHEST

CCTSEFP&marketplace=FLIPKART&srno=b_1_24&otracker=nmenu_sub_Home%20%26

%20Furniture_0_Chairs&fm=neo%2Fmerchandising&iid=en_63tuYXJjuRRc4uunrPb5PAca

j69J5CQLSffQykuC4JtDidde7eIl76St5J%2FyM8TFmSFp%2BWWQYx08MBHlgDhr7g%3

D%3D&ppt=StoreBrowse&ppn=Store&ssid=zxruks9r7k0000001555843983627");

}

public void buytable()

{

Application.OpenURL("https://www.amazon.in/Bluewud-Osnale-Coffee-Table-

Rectangular/dp/B07D7W1RQX/ref=sr_1_13?s=kitchen&ie=UTF8&qid=1551718331&sr=1-

13");

}

// Update is called once per frame

void Update () {

}

}

Page 59: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

49

/* Colour picker for changing colour of furniture – colorpicker,cs */

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class colorpicker : MonoBehaviour

{

public Material[] material;

public Renderer[] rend;

// Use this for initialization

void Start () {

for (int i = 0; i < rend.Length; i++)

{

rend[i].enabled = true;

rend[i].sharedMaterial = material[0];

}

}

public void OnButtonPressed()

{

//Debug.Log("Hello");

for (int i = 0; i < rend.Length; i++)

{

rend[i].sharedMaterial = material[1];

}

}

Page 60: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

50

public void OnButtonReleased()

{

//Debug.Log("button not pressed");

for (int i = 0; i < rend.Length; i++)

{

rend[i].sharedMaterial = material[0];

}

}

// Update is called once per frame

void Update () {

}

}

Page 61: FURNITURE LAYOUT APPLICATION USING AUGMENTED REALITY · Augmented reality displays superimpose information in your field of view and can take you into a new world where the real and

51

/* rotatescript.cs */

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class rotatescript : MonoBehaviour {

public float rotSpeed = 20f;

// Use this for initialization

public void Button_Click()

{

//if (Input.GetKey(KeyCode.RightArrow))

//transform.Rotate(Vector3.up, rotSpeed * Time.deltaTime);

transform.Rotate(0, 45, 0);

}

// Update is called once per frame

void Update () {

}

}