Getting to know Floor Plan

In this tutorial, you will learn how to paint walls using the Remodel-AR framework's Floor plan approach.

Before starting this tutorial, make sure you've completed Setting up Remodel-AR in Android.

Step 1:

You shall wait for callbacks from the configure() method, Once you get callback in onPassioSDKReady()

Step 2:

First let us supply the color and/or texture that we want to paint the wall with, you can pass any color hex in this format #RRGGBB, metadata can also be supplied with it using below code:

var metaData = HashMap<String,String>()
metaData.put("aMetaData", "Testing")
metaData.put("aMetaData2", "Testin2")

var path = externalCacheDir?.absolutePath + "/internal-transfer/texturex.jpg"

changeColor("#ff0000", texturePath, metaData)

It is also possible to set color/texture individually using this methods:

//apply texture
pickTexture(mBitmap)
//apply color
pickColor("#1FCCDE")

with pickTexture() you can directly pass bitmap as texture.

Step 3:

To start Floor plan approach approach, you can simply call startFloorPlanApproach(), it will do necessory initialization for using Floor plan approach

Step 4:

Let us take a button and on click of it call below code

placeGrid(null)

Get callbacks for first and last point selection by user like this


override fun onFirstPointSelected(){
}

override fun onLastPointSelected(){
}

Once the button is clicked, it will start scanning the floor, Once floor is detected, it will put grid on the floor.

you can can now tap anywhere and select points on grid to form the floor shape, For the first point selected onFirstPointSelected() callback is triggered and when last point is selected at that time onLastPointSelected() callback is triggered.

Step 5: To complete the shape one has to put the first and last points together or simply call finishShape().

Step 6:

Once shape is formed It will generate outlines of all the surfaces including floor, ceiling and walls, user can drag on screen to select the height of the shape, Once user is done selecting the height, To move forward call finishSettingHeight()

Step 7:

Once height is set all the wall,ceiling and floor surfaces will get generated, One can tap on any surface to make it active and set color and/or texture using same way as shown in step 2

If at any point you need help from the Passio team, please reach out to us at support@passiolife.com

Last updated