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
<html> | |
<head> | |
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" /> | |
<script defer src="https://pyscript.net/alpha/pyscript.js"></script> | |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"> | |
</head> | |
<body> | |
<div id="pi" class="alert alert-primary"> | |
<b>Today is <u><label id='today'></label></u></b> |
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
<html> | |
<head> | |
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" /> | |
<script defer src="https://pyscript.net/alpha/pyscript.js"></script> | |
</head> | |
<body> <py-script> print('Hello, World! python here') </py-script> </body> | |
</html> |
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
//adding listener to ARfragment | |
arFragment.getArSceneView().getScene().addOnUpdateListener(this::onUpdateFrame); | |
private void onUpdateFrame(FrameTime frameTime){ | |
Frame frame = arFragment.getArSceneView().getArFrame(); | |
Collection<AugmentedImage> augmentedImages = frame.getUpdatedTrackables(AugmentedImage.class); | |
for (AugmentedImage augmentedImage : augmentedImages){ | |
if (augmentedImage.getTrackingState() == TrackingState.TRACKING){ |
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
//config can be intiated using new Config(session) where session is arfragment scene session | |
private boolean setupAugmentedImageDb(Config config) { | |
AugmentedImageDatabase augmentedImageDatabase; | |
Bitmap augmentedImageBitmap = loadAugmentedImage(); | |
if (augmentedImageBitmap == null) { | |
return false; | |
} | |
augmentedImageDatabase = new AugmentedImageDatabase(mSession); | |
augmentedImageDatabase.addImage("car", augmentedImageBitmap); | |
config.setAugmentedImageDatabase(augmentedImageDatabase); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<fragment android:name="com.google.ar.sceneform.ux.ArFragment" | |
android:id="@+id/ar_fragment" | |
android:layout_width="match_parent" |
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
public class MyApplication extends Application implements LifecycleObserver | |
{ | |
private static Context appContext; | |
public static boolean wasInBackground; | |
@Override | |
public void onCreate() | |
{ | |
super.onCreate(); | |
appContext=this; |