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
// SpawnManager.cs | |
// https://github.com/shibuiwilliam/ARWithWord/blob/main/ARWithWord/Assets/Scripts/SpawnManager.cs | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using UnityEngine; |
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
private fun initDistanceTable(){ | |
for (i in 0 until Constants.maxNumMultiplePoints+1){ | |
val tableRow = TableRow(this) | |
multipleDistanceTableLayout.addView(tableRow, | |
multipleDistanceTableLayout.width, | |
Constants.multipleDistanceTableHeight / (Constants.maxNumMultiplePoints + 1)) | |
for (j in 0 until Constants.maxNumMultiplePoints+1){ | |
val textView = TextView(this) | |
textView.setTextColor(Color.WHITE) | |
if (i==0){ |
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
private fun tapDistanceOfMultiplePoints(hitResult: HitResult){ | |
if (placedAnchorNodes.size >= Constants.maxNumMultiplePoints){ | |
clearAllAnchors() | |
} | |
ViewRenderable | |
.builder() | |
.setView(this, R.layout.point_text_layout) | |
.build() | |
.thenAccept{ | |
it.isShadowReceiver = false |
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
private fun tapDistanceOf2Points(hitResult: HitResult){ | |
if (placedAnchorNodes.size == 0){ | |
placeAnchor(hitResult, cubeRenderable!!) | |
} | |
else if (placedAnchorNodes.size == 1){ | |
placeAnchor(hitResult, cubeRenderable!!) | |
val midPosition = floatArrayOf( | |
(placedAnchorNodes[0].worldPosition.x + placedAnchorNodes[1].worldPosition.x) / 2, | |
(placedAnchorNodes[0].worldPosition.y + placedAnchorNodes[1].worldPosition.y) / 2, |
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
private fun measureDistanceFromCamera(){ | |
val frame = arFragment!!.arSceneView.arFrame | |
if (placedAnchorNodes.size >= 1) { | |
val distanceMeter = calculateDistance( | |
placedAnchorNodes[0].worldPosition, | |
frame!!.camera.pose) | |
measureDistanceOf2Points(distanceMeter) | |
} | |
} |
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
private fun placeAnchor(hitResult: HitResult, | |
renderable: Renderable){ | |
val anchor = hitResult.createAnchor() | |
placedAnchors.add(anchor) | |
val anchorNode = AnchorNode(anchor).apply { | |
isSmoothed = true | |
setParent(arFragment!!.arSceneView.scene) | |
} | |
placedAnchorNodes.add(anchorNode) |
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
FROM ubuntu | |
MAINTAINER cvusk | |
# insert hostname on environmental variable | |
ENV HOSTNAME tensorflow.spark | |
# install prerequisites | |
RUN apt-get -y update | |
RUN apt-get -y upgrade | |
RUN apt-get -y install apt-utils |
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 numpy as np | |
from keras.models import Sequential | |
from keras.layers import Dense | |
from keras.utils import np_utils | |
from keras.layers import Dense | |
from keras.models import Model | |
# create training data | |
def binary_encode(i, num_digits): |