This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Add this AndroidManifest.xml file at ViroSample/android/app/src/ovr/ only | |
if you are building a VR app for Samsung GearVR--> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | |
<application> | |
<meta-data | |
android:name="com.samsung.android.vr.application.mode" | |
android:value="vr_only"/> | |
</application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onAnchorFound(ARAnchor arAnchor, ARNode arNode) { | |
// Spawn a visual plane if a PlaneAnchor was found | |
if (arAnchor.getType() == ARAnchor.Type.PLANE){ | |
ARPlaneAnchor planeAnchor = (ARPlaneAnchor)arAnchor; | |
// Create the visual geometry representing this plane | |
Vector dimensions = planeAnchor.getExtent(); | |
Surface plane = new Surface(1,1); | |
plane.setWidth(dimensions.x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Load a 3D android model and add it to the given position | |
*/ | |
private void createDroidAtPosition(Vector position){ | |
// Create a droid on the surface | |
final Bitmap bot = ViroHelper.getBitmapFromAsset(this, "andy.png"); | |
final Object3D object3D = new Object3D(); | |
object3D.setPosition(position); | |
mScene.getRootNode().addChildNode(object3D); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create an AR scene that tracks planes. Clicking on a plane places a 3D Object on that spot. | |
*/ | |
@Override | |
public void onRendererStart() { | |
// Create the 3d ar scene, and display the point clouds. | |
mScene = new ARScene(); | |
mScene.displayPointCloud(true); | |
// Create an TrackedPlanesController to visually display tracked planes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
ViroScene, | |
Viro360Image, | |
} from 'react-viro'; | |
var RealEstateTour = React.createClass({ | |
render: function() { | |
return ( | |
<ViroScene> |