├── CONTRIBUTING.md ├── Completed ├── .gitignore ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ ├── sampledata │ │ └── models │ │ │ ├── Cabin Texture.png │ │ │ ├── Cabin.mtl │ │ │ ├── Cabin.obj │ │ │ ├── Cabin.sfa │ │ │ ├── House.mtl │ │ │ ├── House.obj │ │ │ ├── House.sfa │ │ │ ├── andy.mtl │ │ │ ├── andy.obj │ │ │ ├── andy.png │ │ │ ├── andy.sfa │ │ │ ├── andy_dance.fbx │ │ │ ├── andy_dance.sfa │ │ │ ├── igloo.mtl │ │ │ ├── igloo.obj │ │ │ └── igloo.sfa │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── google │ │ │ └── devrel │ │ │ └── ar │ │ │ └── codelab │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ │ ├── Cabin.sfb │ │ │ ├── House.sfb │ │ │ ├── andy.sfb │ │ │ ├── andy_dance.sfb │ │ │ └── igloo.sfb │ │ ├── java │ │ │ └── com │ │ │ │ └── google │ │ │ │ └── devrel │ │ │ │ └── ar │ │ │ │ └── codelab │ │ │ │ ├── MainActivity.java │ │ │ │ ├── ModelLoader.java │ │ │ │ ├── PointerDrawable.java │ │ │ │ └── WritingArFragment.java │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ ├── cabin_thumb.png │ │ │ ├── droid_thumb.png │ │ │ ├── house_thumb.png │ │ │ ├── ic_launcher_background.xml │ │ │ └── igloo_thumb.png │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ └── content_main.xml │ │ │ ├── menu │ │ │ └── menu_main.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ │ └── xml │ │ │ └── paths.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── google │ │ └── devrel │ │ └── ar │ │ └── codelab │ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── LICENSE ├── README.md ├── sampledata.zip └── sampledata ├── drawable ├── cabin_thumb.png ├── droid_thumb.png ├── house_thumb.png └── igloo_thumb.png └── models ├── Cabin Texture.png ├── Cabin.mtl ├── Cabin.obj ├── House.mtl ├── House.obj ├── andy.mtl ├── andy.obj ├── andy.png ├── andy_dance.fbx ├── igloo.mtl └── igloo.obj /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to become a contributor and submit your own code 2 | 3 | ## Contributor License Agreements 4 | 5 | We'd love to accept your sample apps and patches! Before we can take them, we 6 | have to jump a couple of legal hurdles. 7 | 8 | Please fill out either the individual or corporate Contributor License Agreement 9 | (CLA). 10 | 11 | * If you are an individual writing original source code and you're sure you 12 | own the intellectual property, then you'll need to sign an [individual CLA] 13 | (https://developers.google.com/open-source/cla/individual). 14 | * If you work for a company that wants to allow you to contribute your work, 15 | then you'll need to sign a [corporate CLA] 16 | (https://developers.google.com/open-source/cla/corporate). 17 | 18 | Follow either of the two links above to access the appropriate CLA and 19 | instructions for how to sign and return it. Once we receive it, we'll be able to 20 | accept your pull requests. 21 | 22 | ## Contributing A Patch 23 | 24 | 1. Submit an issue describing your proposed change to the repo in question. 25 | 1. The repo owner will respond to your issue promptly. 26 | 1. If your proposed change is accepted, and you haven't already done so, sign a 27 | Contributor License Agreement (see details above). 28 | 1. Fork the desired repo, develop and test your code changes. 29 | 1. Ensure that your code adheres to the existing style in the sample to which 30 | you are contributing. Refer to the 31 | [Google Cloud Platform Samples Style Guide] 32 | (https://github.com/GoogleCloudPlatform/Template/wiki/style.html) for the 33 | recommended coding standards for this organization. 34 | 1. Ensure that your code has an appropriate set of unit tests which all pass. 35 | 1. Submit a pull request. 36 | 37 | -------------------------------------------------------------------------------- /Completed/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | -------------------------------------------------------------------------------- /Completed/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /Completed/app/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Google LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | https://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | apply plugin: 'com.android.application' 17 | 18 | android { 19 | compileSdkVersion 27 20 | defaultConfig { 21 | applicationId "com.google.devrel.ar.codelab" 22 | minSdkVersion 24 23 | targetSdkVersion 27 24 | versionCode 1 25 | versionName "1.0" 26 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 27 | } 28 | buildTypes { 29 | release { 30 | minifyEnabled false 31 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 32 | } 33 | } 34 | compileOptions { 35 | sourceCompatibility JavaVersion.VERSION_1_8 36 | targetCompatibility JavaVersion.VERSION_1_8 37 | } 38 | } 39 | 40 | dependencies { 41 | implementation fileTree(dir: 'libs', include: ['*.jar']) 42 | implementation 'com.android.support:appcompat-v7:27.1.1' 43 | implementation 'com.android.support.constraint:constraint-layout:1.1.0' 44 | implementation 'com.android.support:design:27.1.1' 45 | testImplementation 'junit:junit:4.12' 46 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 47 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 48 | implementation "com.google.ar.sceneform.ux:sceneform-ux:1.8.0" 49 | implementation "com.google.ar.sceneform:animation:1.8.0" 50 | } 51 | 52 | apply plugin: 'com.google.ar.sceneform.plugin' 53 | 54 | sceneform.asset('sampledata/models/andy.obj', 55 | 'default', 56 | 'sampledata/models/andy.sfa', 57 | 'src/main/assets/andy') 58 | 59 | sceneform.asset('sampledata/models/Cabin.obj', 60 | 'default', 61 | 'sampledata/models/Cabin.sfa', 62 | 'src/main/assets/Cabin') 63 | 64 | sceneform.asset('sampledata/models/House.obj', 65 | 'default', 66 | 'sampledata/models/House.sfa', 67 | 'src/main/assets/House') 68 | 69 | sceneform.asset('sampledata/models/igloo.obj', 70 | 'default', 71 | 'sampledata/models/igloo.sfa', 72 | 'src/main/assets/igloo') 73 | 74 | 75 | sceneform.asset('sampledata/models/andy_dance.fbx', 76 | 'default', 77 | 'sampledata/models/andy_dance.sfa', 78 | 'src/main/assets/andy_dance', 79 | ['sampledata/models/andy_dance.fbx']) 80 | -------------------------------------------------------------------------------- /Completed/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /Completed/app/sampledata/models/Cabin Texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/sampledata/models/Cabin Texture.png -------------------------------------------------------------------------------- /Completed/app/sampledata/models/Cabin.mtl: -------------------------------------------------------------------------------- 1 | newmtl lambert3SG 2 | illum 4 3 | Kd 0.00 0.00 0.00 4 | Ka 0.00 0.00 0.00 5 | Tf 1.00 1.00 1.00 6 | map_Kd Cabin Texture.png 7 | Ni 1.00 8 | -------------------------------------------------------------------------------- /Completed/app/sampledata/models/Cabin.sfa: -------------------------------------------------------------------------------- 1 | { 2 | materials: [ 3 | { 4 | name: "lambert3SG", 5 | parameters: [ 6 | { 7 | baseColor: "Cabin Texture", 8 | }, 9 | { 10 | baseColorTint: [ 11 | 1, 12 | 1, 13 | 1, 14 | 1, 15 | ], 16 | }, 17 | { 18 | metallic: 0, 19 | }, 20 | { 21 | roughness: 1, 22 | }, 23 | { 24 | opacity: null, 25 | }, 26 | ], 27 | source: "build/sceneform_sdk/default_materials/obj_material.sfm", 28 | }, 29 | ], 30 | model: { 31 | attributes: [ 32 | "Position", 33 | "TexCoord", 34 | "Orientation", 35 | ], 36 | file: "sampledata/models/Cabin.obj", 37 | name: "Cabin", 38 | scale: 0.0005, 39 | suggested_collision: { 40 | center: { 41 | x: 0, 42 | y: 0, 43 | z: 0, 44 | }, 45 | size: { 46 | x: 1, 47 | y: 1, 48 | z: 1, 49 | }, 50 | type: "Box", 51 | }, 52 | }, 53 | samplers: [ 54 | { 55 | file: "sampledata/models/Cabin Texture.png", 56 | name: "Cabin Texture", 57 | pipeline_name: "Cabin Texture.png", 58 | }, 59 | ], 60 | version: "0.51:1", 61 | } 62 | -------------------------------------------------------------------------------- /Completed/app/sampledata/models/House.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'ARDEMO.blend' 2 | # Material Count: 4 3 | 4 | newmtl mat12.002 5 | Ns 96.078431 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 1.000000 0.920000 0.230000 8 | Ks 0.500000 0.500000 0.500000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.000000 11 | d 1.000000 12 | illum 2 13 | 14 | newmtl mat20.002 15 | Ns 96.078431 16 | Ka 1.000000 1.000000 1.000000 17 | Kd 0.470000 0.330000 0.280000 18 | Ks 0.500000 0.500000 0.500000 19 | Ke 0.000000 0.000000 0.000000 20 | Ni 1.000000 21 | d 1.000000 22 | illum 2 23 | 24 | newmtl mat4.002 25 | Ns 96.078431 26 | Ka 1.000000 1.000000 1.000000 27 | Kd 0.000000 0.740000 0.830000 28 | Ks 0.500000 0.500000 0.500000 29 | Ke 0.000000 0.000000 0.000000 30 | Ni 1.000000 31 | d 1.000000 32 | illum 2 33 | 34 | newmtl mat5.002 35 | Ns 96.078431 36 | Ka 1.000000 1.000000 1.000000 37 | Kd 0.010000 0.610000 0.900000 38 | Ks 0.500000 0.500000 0.500000 39 | Ke 0.000000 0.000000 0.000000 40 | Ni 1.000000 41 | d 1.000000 42 | illum 2 43 | -------------------------------------------------------------------------------- /Completed/app/sampledata/models/House.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.78 (sub 0) OBJ File: 'ARDEMO.blend' 2 | # www.blender.org 3 | mtllib House.mtl 4 | o Town.010_mesh1481924206.015 5 | v 0.190842 0.121225 -0.069260 6 | v 0.187457 0.120558 -0.069218 7 | v 0.184740 0.122994 -0.128107 8 | v 0.188164 0.123661 -0.128148 9 | v 0.184725 0.126299 -0.127946 10 | v 0.187343 0.123863 -0.069057 11 | v 0.190725 0.124529 -0.069098 12 | v 0.188146 0.126966 -0.127987 13 | v 0.201111 0.238817 -0.000601 14 | v 0.195783 0.238373 -0.001167 15 | v 0.194687 0.331621 0.012598 16 | v 0.200078 0.332081 0.013158 17 | v 0.194036 0.330711 0.017889 18 | v 0.195184 0.237480 0.004121 19 | v 0.200508 0.237924 0.004688 20 | v 0.199420 0.331168 0.018454 21 | v 0.201727 0.279162 0.052149 22 | v 0.196373 0.278891 0.052658 23 | v 0.194213 0.287799 -0.041113 24 | v 0.199568 0.288071 -0.041623 25 | v 0.194000 0.293146 -0.040499 26 | v 0.196160 0.284237 0.053272 27 | v 0.201515 0.284509 0.052762 28 | v 0.199354 0.293417 -0.041009 29 | v 0.085182 0.336579 0.019364 30 | v 0.086026 0.323364 0.043309 31 | v 0.191674 0.323030 0.039404 32 | v 0.191941 0.336320 0.015347 33 | v 0.086474 0.299939 0.057443 34 | v 0.192122 0.299606 0.053539 35 | v 0.086407 0.272582 0.057982 36 | v 0.192045 0.272249 0.054076 37 | v 0.085844 0.248623 0.044778 38 | v 0.190935 0.248290 0.040873 39 | v 0.084934 0.234481 0.021370 40 | v 0.189894 0.234148 0.017466 41 | v 0.083922 0.233946 -0.005968 42 | v 0.189465 0.233613 -0.009873 43 | v 0.083079 0.247162 -0.029913 44 | v 0.188684 0.246829 -0.033818 45 | v 0.082630 0.270586 -0.044047 46 | v 0.188278 0.270253 -0.047953 47 | v 0.082697 0.297944 -0.044585 48 | v 0.188345 0.297610 -0.048490 49 | v 0.083260 0.321903 -0.031381 50 | v 0.188961 0.321570 -0.035286 51 | v 0.084170 0.336045 -0.007974 52 | v 0.191091 0.335780 -0.011883 53 | v 0.200272 0.156734 -0.178992 54 | v 0.209248 0.498067 0.020517 55 | v -0.181199 0.137745 -0.173727 56 | v 0.205590 0.193620 -0.235537 57 | v -0.184779 0.174631 -0.230272 58 | v 0.209100 0.534196 -0.038132 59 | v -0.184866 0.496675 0.029993 60 | v -0.185282 0.534772 -0.028827 61 | v 0.187215 0.119298 0.133275 62 | v 0.183833 0.118509 0.133510 63 | v 0.188070 0.120213 0.074500 64 | v 0.191463 0.121002 0.074264 65 | v 0.187874 0.123493 0.074658 66 | v 0.183717 0.121788 0.133668 67 | v 0.187097 0.122578 0.133433 68 | v 0.191262 0.124282 0.074422 69 | v -0.177838 0.134791 0.164088 70 | v -0.185693 0.524696 -0.033373 71 | v 0.209789 0.520521 -0.034627 72 | v 0.199670 0.151208 0.161212 73 | v 0.208987 0.548710 0.027847 74 | v -0.187964 0.552215 0.032086 75 | v -0.180229 0.163234 0.225375 76 | v 0.205904 0.179651 0.222499 77 | v -0.193368 0.467947 0.001917 78 | v -0.190617 0.533318 -0.061256 79 | v 0.223878 0.529937 -0.070466 80 | v 0.221940 0.463464 -0.008425 81 | v 0.226578 0.592004 -0.007839 82 | v -0.189719 0.596510 0.000287 83 | v -0.192470 0.531139 0.063459 84 | v 0.224639 0.525530 0.054202 85 | v 0.188961 0.171001 -0.068106 86 | v 0.131582 0.162797 -0.070266 87 | v 0.130919 0.066248 -0.072758 88 | v 0.186710 0.074453 -0.070599 89 | v 0.125919 0.068037 -0.131433 90 | v 0.129428 0.164586 -0.128940 91 | v 0.186614 0.172790 -0.126781 92 | v 0.182179 0.076241 -0.129273 93 | v 0.185645 0.173719 0.133852 94 | v 0.129140 0.163905 0.132733 95 | v 0.127870 0.062583 0.130774 96 | v 0.183108 0.072397 0.131894 97 | v 0.133161 0.063874 0.072061 98 | v 0.132720 0.165196 0.074020 99 | v 0.189402 0.175010 0.075141 100 | v 0.188037 0.073688 0.073182 101 | v 0.197061 0.172563 0.045062 102 | v 0.106686 0.159268 0.047729 103 | v 0.113419 0.005039 0.045098 104 | v 0.197774 0.005039 0.042431 105 | v 0.114263 0.005039 -0.048827 106 | v 0.105928 0.160349 -0.046196 107 | v 0.196778 0.173644 -0.048862 108 | v 0.199219 0.005039 -0.051494 109 | v 0.188317 0.166720 0.130667 110 | v 0.139520 0.159049 0.130013 111 | v 0.136661 0.071914 0.127711 112 | v 0.184711 0.079585 0.128366 113 | v 0.140882 0.073313 0.077338 114 | v 0.142472 0.160449 0.079640 115 | v 0.191377 0.168120 0.080294 116 | v 0.188683 0.080984 0.077993 117 | v 0.101898 0.311738 -0.027537 118 | v 0.101484 0.324560 -0.006872 119 | v 0.196023 0.329395 -0.007958 120 | v 0.195745 0.316512 -0.028621 121 | v 0.101725 0.325349 0.017435 122 | v 0.196130 0.330170 0.016351 123 | v 0.102556 0.313893 0.038875 124 | v 0.196402 0.318666 0.037790 125 | v 0.103753 0.293262 0.051700 126 | v 0.197600 0.298036 0.050615 127 | v 0.104997 0.268984 0.052476 128 | v 0.198842 0.273757 0.051391 129 | v 0.105954 0.247564 0.040993 130 | v 0.199409 0.252338 0.039908 131 | v 0.106365 0.234742 0.020329 132 | v 0.199691 0.239516 0.019245 133 | v 0.106127 0.233953 -0.003979 134 | v 0.199883 0.238727 -0.005064 135 | v 0.105296 0.245409 -0.025418 136 | v 0.199143 0.250183 -0.026503 137 | v 0.104098 0.266041 -0.038244 138 | v 0.197944 0.270814 -0.039329 139 | v 0.102855 0.290318 -0.039019 140 | v 0.196701 0.295092 -0.040104 141 | v 0.189552 0.168646 -0.070708 142 | v 0.136596 0.160793 -0.073098 143 | v 0.135911 0.072029 -0.076212 144 | v 0.187772 0.079883 -0.073821 145 | v 0.131800 0.074233 -0.130189 146 | v 0.134870 0.162997 -0.127075 147 | v 0.187717 0.170850 -0.124685 148 | v 0.184091 0.082086 -0.127798 149 | v 0.209581 0.104676 -0.017752 150 | v 0.186058 0.101377 -0.017300 151 | v 0.186332 0.078117 -0.017492 152 | v 0.209906 0.081416 -0.017944 153 | v 0.181418 0.078243 -0.040981 154 | v 0.181685 0.101503 -0.040788 155 | v 0.205235 0.104803 -0.041240 156 | v 0.204989 0.081543 -0.041433 157 | v 0.180075 0.223272 0.156142 158 | v -0.171597 0.001898 0.145077 159 | v 0.180281 0.001898 0.146037 160 | v -0.181117 0.001898 -0.177136 161 | v 0.172273 0.236253 -0.166071 162 | v 0.170975 0.001898 -0.176176 163 | v -0.160051 0.474726 0.004237 164 | v -0.160287 0.194654 0.157329 165 | v -0.169807 0.207636 -0.164884 166 | v 0.198456 0.489508 0.014571 167 | vt 0.7624 0.8387 168 | vt 0.7629 0.8387 169 | vt 0.7629 0.8480 170 | vt 0.7624 0.8480 171 | vt 0.7641 0.9048 172 | vt 0.7641 0.8956 173 | vt 0.7646 0.8956 174 | vt 0.7646 0.9049 175 | vt 0.9242 0.9101 176 | vt 0.9248 0.9101 177 | vt 0.9248 0.9106 178 | vt 0.9242 0.9106 179 | vt 0.9262 0.6784 180 | vt 0.9267 0.6784 181 | vt 0.9267 0.6790 182 | vt 0.9262 0.6790 183 | vt 0.0577 0.9254 184 | vt 0.0577 0.9346 185 | vt 0.0571 0.9346 186 | vt 0.0571 0.9254 187 | vt 0.0034 0.9435 188 | vt 0.0028 0.9435 189 | vt 0.0028 0.9346 190 | vt 0.0034 0.9346 191 | vt 0.8713 0.9153 192 | vt 0.8721 0.9153 193 | vt 0.8721 0.9299 194 | vt 0.8713 0.9299 195 | vt 0.9332 0.4439 196 | vt 0.9332 0.4293 197 | vt 0.9340 0.4293 198 | vt 0.9340 0.4439 199 | vt 0.7826 0.7503 200 | vt 0.7818 0.7503 201 | vt 0.7818 0.7495 202 | vt 0.7826 0.7495 203 | vt 0.9425 0.6123 204 | vt 0.9425 0.6114 205 | vt 0.9433 0.6114 206 | vt 0.9433 0.6123 207 | vt 0.2553 0.8983 208 | vt 0.2553 0.9131 209 | vt 0.2545 0.9131 210 | vt 0.2545 0.8983 211 | vt 0.0186 0.9242 212 | vt 0.0178 0.9242 213 | vt 0.0178 0.9094 214 | vt 0.0186 0.9094 215 | vt 0.3090 0.8984 216 | vt 0.3098 0.8983 217 | vt 0.3098 0.9130 218 | vt 0.3090 0.9131 219 | vt 0.8391 0.9206 220 | vt 0.8391 0.9059 221 | vt 0.8400 0.9060 222 | vt 0.8400 0.9207 223 | vt 0.7567 0.6360 224 | vt 0.7576 0.6360 225 | vt 0.7576 0.6369 226 | vt 0.7567 0.6369 227 | vt 0.7759 0.7503 228 | vt 0.7759 0.7495 229 | vt 0.7768 0.7495 230 | vt 0.7768 0.7503 231 | vt 0.8561 0.8846 232 | vt 0.8561 0.8994 233 | vt 0.8553 0.8993 234 | vt 0.8553 0.8846 235 | vt 0.2545 0.9181 236 | vt 0.2554 0.9181 237 | vt 0.2554 0.9326 238 | vt 0.2545 0.9326 239 | vt 0.2435 0.7865 240 | vt 0.2434 0.7828 241 | vt 0.2601 0.7828 242 | vt 0.2601 0.7865 243 | vt 0.7859 0.4016 244 | vt 0.7897 0.4014 245 | vt 0.7897 0.4179 246 | vt 0.7859 0.4181 247 | vt 0.7940 0.4014 248 | vt 0.7940 0.4179 249 | vt 0.7977 0.4017 250 | vt 0.7977 0.4182 251 | vt 0.6057 0.7821 252 | vt 0.6095 0.7820 253 | vt 0.6095 0.7986 254 | vt 0.6057 0.7987 255 | vt 0.6138 0.7820 256 | vt 0.6138 0.7986 257 | vt 0.6175 0.7821 258 | vt 0.6175 0.7987 259 | vt 0.7810 0.8018 260 | vt 0.7773 0.8018 261 | vt 0.7773 0.7852 262 | vt 0.7810 0.7852 263 | vt 0.7730 0.8018 264 | vt 0.7730 0.7852 265 | vt 0.7693 0.8018 266 | vt 0.7693 0.7852 267 | vt 0.2434 0.7945 268 | vt 0.2435 0.7908 269 | vt 0.2601 0.7908 270 | vt 0.2601 0.7945 271 | vt 0.6867 0.7853 272 | vt 0.6867 0.7810 273 | vt 0.6889 0.7773 274 | vt 0.6926 0.7751 275 | vt 0.6969 0.7751 276 | vt 0.7006 0.7773 277 | vt 0.7028 0.7810 278 | vt 0.7028 0.7853 279 | vt 0.7006 0.7890 280 | vt 0.6969 0.7912 281 | vt 0.6926 0.7912 282 | vt 0.6889 0.7890 283 | vt 0.2951 0.7912 284 | vt 0.2915 0.7891 285 | vt 0.2893 0.7853 286 | vt 0.2893 0.7810 287 | vt 0.2915 0.7773 288 | vt 0.2951 0.7752 289 | vt 0.2993 0.7752 290 | vt 0.3030 0.7774 291 | vt 0.3051 0.7811 292 | vt 0.3051 0.7854 293 | vt 0.3030 0.7891 294 | vt 0.2993 0.7913 295 | vt 0.4421 0.3946 296 | vt 0.4961 0.4014 297 | vt 0.4424 0.4568 298 | vt 0.4742 0.1728 299 | vt 0.4744 0.1099 300 | vt 0.5292 0.1703 301 | vt 0.7074 0.2563 302 | vt 0.6968 0.2561 303 | vt 0.6968 0.1908 304 | vt 0.7074 0.1910 305 | vt 0.4813 0.7123 306 | vt 0.4813 0.6474 307 | vt 0.4918 0.6471 308 | vt 0.4918 0.7120 309 | vt 0.7186 0.3999 310 | vt 0.7186 0.3371 311 | vt 0.7274 0.3368 312 | vt 0.7274 0.3997 313 | vt 0.7297 0.1296 314 | vt 0.7209 0.1293 315 | vt 0.7209 0.0673 316 | vt 0.7297 0.0676 317 | vt 0.4961 0.4629 318 | vt 0.5292 0.1082 319 | vt 0.6752 0.8937 320 | vt 0.6747 0.8937 321 | vt 0.6747 0.8845 322 | vt 0.6752 0.8844 323 | vt 0.5789 0.9078 324 | vt 0.5789 0.8985 325 | vt 0.5795 0.8985 326 | vt 0.5795 0.9078 327 | vt 0.6637 0.4513 328 | vt 0.6642 0.4513 329 | vt 0.6642 0.4518 330 | vt 0.6637 0.4518 331 | vt 0.9245 0.4288 332 | vt 0.9250 0.4288 333 | vt 0.9250 0.4294 334 | vt 0.9245 0.4294 335 | vt 0.7641 0.9191 336 | vt 0.7641 0.9099 337 | vt 0.7646 0.9099 338 | vt 0.7646 0.9191 339 | vt 0.1358 0.9286 340 | vt 0.1363 0.9287 341 | vt 0.1363 0.9377 342 | vt 0.1358 0.9377 343 | vt 0.4147 0.0031 344 | vt 0.4747 0.0025 345 | vt 0.4747 0.0649 346 | vt 0.4147 0.0654 347 | vt 0.2948 0.4072 348 | vt 0.2948 0.4689 349 | vt 0.2341 0.4711 350 | vt 0.2341 0.4095 351 | vt 0.7001 0.4093 352 | vt 0.7107 0.4092 353 | vt 0.7107 0.4747 354 | vt 0.7001 0.4748 355 | vt 0.7031 0.5772 356 | vt 0.7031 0.5118 357 | vt 0.7134 0.5120 358 | vt 0.7134 0.5775 359 | vt 0.7254 0.4095 360 | vt 0.7254 0.4719 361 | vt 0.7157 0.4716 362 | vt 0.7157 0.4092 363 | vt 0.7222 0.2532 364 | vt 0.7125 0.2536 365 | vt 0.7125 0.1912 366 | vt 0.7222 0.1908 367 | vt 0.7004 0.7001 368 | vt 0.6900 0.6993 369 | vt 0.6898 0.6341 370 | vt 0.7004 0.6347 371 | vt 0.1969 0.2929 372 | vt 0.1970 0.2281 373 | vt 0.2077 0.2262 374 | vt 0.2077 0.2912 375 | vt 0.7186 0.2596 376 | vt 0.7324 0.2591 377 | vt 0.7324 0.2734 378 | vt 0.7186 0.2738 379 | vt 0.7406 0.2729 380 | vt 0.7406 0.2588 381 | vt 0.7542 0.2596 382 | vt 0.7542 0.2737 383 | vt 0.7135 0.2662 384 | vt 0.7135 0.3318 385 | vt 0.7037 0.3314 386 | vt 0.7035 0.2661 387 | vt 0.7037 0.3373 388 | vt 0.7136 0.3368 389 | vt 0.7136 0.4023 390 | vt 0.7035 0.4024 391 | vt 0.8265 0.7585 392 | vt 0.8174 0.7585 393 | vt 0.8174 0.7432 394 | vt 0.8265 0.7431 395 | vt 0.8169 0.0431 396 | vt 0.8169 0.0278 397 | vt 0.8261 0.0278 398 | vt 0.8261 0.0432 399 | vt 0.8572 0.4416 400 | vt 0.8572 0.4323 401 | vt 0.8664 0.4324 402 | vt 0.8664 0.4416 403 | vt 0.3591 0.8641 404 | vt 0.3683 0.8640 405 | vt 0.3683 0.8732 406 | vt 0.3591 0.8733 407 | vt 0.8260 0.0483 408 | vt 0.8260 0.0636 409 | vt 0.8169 0.0634 410 | vt 0.8169 0.0482 411 | vt 0.8184 0.4017 412 | vt 0.8273 0.4014 413 | vt 0.8273 0.4166 414 | vt 0.8184 0.4169 415 | vt 0.8236 0.6715 416 | vt 0.8146 0.6715 417 | vt 0.8146 0.6554 418 | vt 0.8236 0.6553 419 | vt 0.8114 0.7908 420 | vt 0.8114 0.7746 421 | vt 0.8206 0.7746 422 | vt 0.8206 0.7908 423 | vt 0.5272 0.8643 424 | vt 0.5272 0.8735 425 | vt 0.5181 0.8735 426 | vt 0.5181 0.8642 427 | vt 0.4596 0.8643 428 | vt 0.4687 0.8643 429 | vt 0.4687 0.8735 430 | vt 0.4596 0.8736 431 | vt 0.8235 0.7960 432 | vt 0.8235 0.8120 433 | vt 0.8143 0.8118 434 | vt 0.8143 0.7958 435 | vt 0.0914 0.8077 436 | vt 0.1004 0.8073 437 | vt 0.1004 0.8233 438 | vt 0.0914 0.8236 439 | vt 0.5138 0.7608 440 | vt 0.4991 0.7609 441 | vt 0.4991 0.7345 442 | vt 0.5138 0.7344 443 | vt 0.5282 0.7581 444 | vt 0.5282 0.7317 445 | vt 0.5429 0.7317 446 | vt 0.5429 0.7581 447 | vt 0.5447 0.3746 448 | vt 0.5447 0.3894 449 | vt 0.5300 0.3893 450 | vt 0.5300 0.3746 451 | vt 0.5935 0.3859 452 | vt 0.6082 0.3858 453 | vt 0.6082 0.4006 454 | vt 0.5935 0.4006 455 | vt 0.1202 0.7342 456 | vt 0.1202 0.7605 457 | vt 0.1055 0.7604 458 | vt 0.1055 0.7342 459 | vt 0.3312 0.7364 460 | vt 0.3456 0.7361 461 | vt 0.3456 0.7623 462 | vt 0.3312 0.7626 463 | vt 0.3562 0.3224 464 | vt 0.3049 0.2844 465 | vt 0.3605 0.2869 466 | vt 0.2813 0.1272 467 | vt 0.3171 0.1812 468 | vt 0.2814 0.1836 469 | vt 0.3051 0.3640 470 | vt 0.3024 0.3205 471 | vt 0.1555 0.3779 472 | vt 0.1555 0.3424 473 | vt 0.2062 0.3427 474 | vt 0.2062 0.3783 475 | vt 0.2052 0.4195 476 | vt 0.1555 0.4199 477 | vt 0.1555 0.3838 478 | vt 0.2052 0.3833 479 | vt 0.3176 0.1267 480 | vt 0.3579 0.1283 481 | vt 0.3605 0.3664 482 | vt 0.1865 0.3000 483 | vt 0.3579 0.1847 484 | vt 0.1838 0.4615 485 | vt 0.8422 0.6575 486 | vt 0.8500 0.6574 487 | vt 0.8500 0.6713 488 | vt 0.8422 0.6713 489 | vt 0.8475 0.3464 490 | vt 0.8475 0.3603 491 | vt 0.8396 0.3603 492 | vt 0.8396 0.3464 493 | vt 0.8023 0.8925 494 | vt 0.8023 0.8846 495 | vt 0.8101 0.8846 496 | vt 0.8101 0.8925 497 | vt 0.6090 0.8847 498 | vt 0.6169 0.8847 499 | vt 0.6169 0.8926 500 | vt 0.6090 0.8926 501 | vt 0.8403 0.2024 502 | vt 0.8403 0.1886 503 | vt 0.8482 0.1887 504 | vt 0.8482 0.2025 505 | vt 0.8152 0.8372 506 | vt 0.8229 0.8369 507 | vt 0.8229 0.8506 508 | vt 0.8152 0.8509 509 | vt 0.8192 0.0227 510 | vt 0.8159 0.0228 511 | vt 0.8159 0.0080 512 | vt 0.8192 0.0079 513 | vt 0.8121 0.0228 514 | vt 0.8121 0.0080 515 | vt 0.8088 0.0227 516 | vt 0.8088 0.0079 517 | vt 0.8086 0.4565 518 | vt 0.8120 0.4562 519 | vt 0.8120 0.4708 520 | vt 0.8086 0.4711 521 | vt 0.8158 0.4562 522 | vt 0.8158 0.4708 523 | vt 0.8191 0.4565 524 | vt 0.8191 0.4711 525 | vt 0.8200 0.6161 526 | vt 0.8167 0.6161 527 | vt 0.8167 0.6013 528 | vt 0.8200 0.6013 529 | vt 0.8129 0.6161 530 | vt 0.8129 0.6013 531 | vt 0.8095 0.6161 532 | vt 0.8095 0.6013 533 | vt 0.8199 0.2059 534 | vt 0.8167 0.2058 535 | vt 0.8167 0.1911 536 | vt 0.8199 0.1911 537 | vt 0.8128 0.2058 538 | vt 0.8128 0.1911 539 | vt 0.8095 0.2059 540 | vt 0.8095 0.1911 541 | vt 0.1971 0.7957 542 | vt 0.1933 0.7957 543 | vt 0.1900 0.7938 544 | vt 0.1881 0.7904 545 | vt 0.1881 0.7866 546 | vt 0.1900 0.7833 547 | vt 0.1933 0.7814 548 | vt 0.1971 0.7814 549 | vt 0.2004 0.7833 550 | vt 0.2023 0.7866 551 | vt 0.2023 0.7904 552 | vt 0.2004 0.7937 553 | vt 0.2138 0.7906 554 | vt 0.2138 0.7868 555 | vt 0.2157 0.7835 556 | vt 0.2189 0.7815 557 | vt 0.2227 0.7815 558 | vt 0.2259 0.7834 559 | vt 0.2278 0.7867 560 | vt 0.2278 0.7905 561 | vt 0.2259 0.7939 562 | vt 0.2227 0.7958 563 | vt 0.2189 0.7958 564 | vt 0.2157 0.7939 565 | vt 0.8324 0.2499 566 | vt 0.8407 0.2498 567 | vt 0.8407 0.2639 568 | vt 0.8324 0.2640 569 | vt 0.6242 0.8369 570 | vt 0.6242 0.8228 571 | vt 0.6327 0.8228 572 | vt 0.6327 0.8369 573 | vt 0.2604 0.8890 574 | vt 0.2604 0.8805 575 | vt 0.2688 0.8806 576 | vt 0.2688 0.8890 577 | vt 0.5348 0.8806 578 | vt 0.5433 0.8805 579 | vt 0.5433 0.8890 580 | vt 0.5348 0.8891 581 | vt 0.8287 0.6714 582 | vt 0.8287 0.6574 583 | vt 0.8371 0.6575 584 | vt 0.8371 0.6715 585 | vt 0.8349 0.5931 586 | vt 0.8431 0.5927 587 | vt 0.8431 0.6067 588 | vt 0.8349 0.6070 589 | vt 0.1309 0.9514 590 | vt 0.1272 0.9514 591 | vt 0.1272 0.9477 592 | vt 0.1309 0.9477 593 | vt 0.4014 0.1897 594 | vt 0.4014 0.1934 595 | vt 0.3977 0.1934 596 | vt 0.3977 0.1897 597 | vt 0.8214 0.3485 598 | vt 0.8214 0.3522 599 | vt 0.8178 0.3522 600 | vt 0.8178 0.3485 601 | vt 0.4499 0.9477 602 | vt 0.4535 0.9476 603 | vt 0.4535 0.9513 604 | vt 0.4499 0.9514 605 | vt 0.9356 0.2980 606 | vt 0.9393 0.2979 607 | vt 0.9393 0.3016 608 | vt 0.9356 0.3016 609 | vt 0.1143 0.9477 610 | vt 0.1179 0.9476 611 | vt 0.1179 0.9512 612 | vt 0.1143 0.9513 613 | vn 0.1913 -0.9803 -0.0493 614 | vn -0.1914 0.9803 0.0490 615 | vn -0.0214 0.0487 -0.9986 616 | vn 0.0216 -0.0480 0.9986 617 | vn 0.9988 0.0225 -0.0437 618 | vn -0.9988 -0.0217 0.0444 619 | vn 0.0912 0.1464 -0.9850 620 | vn -0.0918 -0.1465 0.9849 621 | vn -0.0999 0.9826 0.1568 622 | vn 0.0984 -0.9830 -0.1548 623 | vn 0.9931 -0.0060 0.1173 624 | vn -0.9932 0.0053 -0.1165 625 | vn 0.0414 -0.9946 -0.0954 626 | vn -0.0414 0.9946 0.0954 627 | vn -0.0997 0.1095 -0.9890 628 | vn 0.0997 -0.1094 0.9890 629 | vn 0.9989 0.0420 -0.0190 630 | vn -0.9989 -0.0420 0.0190 631 | vn 0.0205 0.8753 0.4831 632 | vn 0.0332 0.5168 0.8554 633 | vn 0.0370 0.0195 0.9991 634 | vn 0.0309 -0.4832 0.8749 635 | vn 0.0165 -0.8561 0.5165 636 | vn -0.0024 -0.9998 0.0196 637 | vn -0.0206 -0.8756 -0.4826 638 | vn -0.0333 -0.5168 -0.8555 639 | vn -0.0370 -0.0195 -0.9991 640 | vn -0.0308 0.4830 -0.8751 641 | vn -0.0166 0.8557 -0.5172 642 | vn 0.0017 0.9998 -0.0198 643 | vn 0.9993 -0.0142 -0.0348 644 | vn -0.9993 0.0032 0.0369 645 | vn 0.0370 -0.5050 0.8623 646 | vn -0.0361 0.5014 -0.8644 647 | vn 0.9992 -0.0324 0.0243 648 | vn -0.9996 -0.0185 0.0226 649 | vn 0.0338 -0.8373 -0.5457 650 | vn 0.0118 0.8453 0.5341 651 | vn 0.0227 -0.4933 0.8696 652 | vn -0.0199 0.4881 -0.8726 653 | vn 0.2262 -0.9740 -0.0119 654 | vn -0.2264 0.9740 0.0122 655 | vn -0.0794 0.0431 -0.9959 656 | vn 0.0798 -0.0450 0.9958 657 | vn 0.9964 0.0450 0.0723 658 | vn -0.9964 -0.0440 -0.0721 659 | vn 0.0025 -0.4600 -0.8879 660 | vn 0.0006 0.4556 0.8902 661 | vn 0.9990 -0.0331 -0.0287 662 | vn -0.9992 -0.0315 -0.0229 663 | vn 0.0421 -0.9068 0.4195 664 | vn 0.0061 0.9169 -0.3991 665 | vn -0.0236 -0.6880 -0.7253 666 | vn 0.0235 0.6880 0.7253 667 | vn 0.9993 -0.0360 -0.0074 668 | vn -0.9995 0.0282 -0.0144 669 | vn 0.0082 -0.7041 0.7100 670 | vn -0.0081 0.7041 -0.7100 671 | vn -0.0345 -0.0253 0.9991 672 | vn 0.0345 0.0244 -0.9991 673 | vn 0.1463 -0.9883 -0.0420 674 | vn -0.1430 0.9891 0.0356 675 | vn 0.9977 -0.0330 -0.0595 676 | vn -0.9979 0.0200 0.0614 677 | vn -0.0167 -0.0190 0.9997 678 | vn 0.0167 0.0192 -0.9997 679 | vn 0.1756 -0.9844 -0.0064 680 | vn -0.1711 0.9852 0.0110 681 | vn 0.9971 -0.0206 0.0733 682 | vn -0.9972 0.0055 -0.0752 683 | vn 0.0317 -0.0156 0.9994 684 | vn -0.0315 0.0152 -0.9994 685 | vn 0.0000 -1.0000 0.0000 686 | vn -0.1448 0.9894 0.0122 687 | vn 0.9999 0.0093 0.0062 688 | vn -0.9988 -0.0486 -0.0007 689 | vn -0.0027 -0.0456 0.9990 690 | vn 0.0027 0.0431 -0.9991 691 | vn -0.0372 0.4793 0.8768 692 | vn 0.9996 -0.0012 -0.0266 693 | vn -0.9980 0.0548 0.0306 694 | vn -0.0477 0.5356 -0.8431 695 | vn -0.0448 0.4714 0.8808 696 | vn 0.9961 -0.0834 -0.0275 697 | vn -0.0005 0.5807 -0.8141 698 | vn -0.9994 0.0174 0.0302 699 | vn 0.0089 -0.0639 0.9979 700 | vn -0.0085 0.0599 -0.9982 701 | vn -0.0094 -0.0260 0.9996 702 | vn 0.0094 0.0262 -0.9996 703 | vn 0.1582 -0.9873 -0.0146 704 | vn -0.1553 0.9877 0.0182 705 | vn 0.9969 -0.0379 0.0685 706 | vn -0.9972 0.0273 -0.0702 707 | vn -0.0493 0.8480 -0.5276 708 | vn -0.0514 0.9982 -0.0317 709 | vn -0.0394 0.8805 0.4725 710 | vn -0.0170 0.5272 0.8496 711 | vn 0.0099 0.0324 0.9994 712 | vn 0.0342 -0.4713 0.8813 713 | vn 0.0495 -0.8483 0.5272 714 | vn 0.0513 -0.9982 0.0323 715 | vn 0.0394 -0.8807 -0.4720 716 | vn 0.0170 -0.5272 -0.8496 717 | vn -0.0099 -0.0324 -0.9994 718 | vn -0.0341 0.4710 -0.8815 719 | vn 0.9990 0.0435 -0.0098 720 | vn -0.9986 -0.0508 0.0115 721 | vn -0.0404 -0.0345 0.9986 722 | vn 0.0404 0.0335 -0.9986 723 | vn 0.1512 -0.9872 -0.0512 724 | vn -0.1487 0.9878 0.0452 725 | vn 0.9982 -0.0286 -0.0522 726 | vn -0.9983 0.0192 0.0548 727 | vn 0.0203 -0.0080 0.9998 728 | vn -0.0204 0.0085 -0.9998 729 | vn 0.1379 -0.9899 -0.0342 730 | vn -0.1382 0.9899 0.0310 731 | vn 0.9811 0.0032 -0.1934 732 | vn -0.9810 -0.0018 0.1939 733 | usemtl mat20.002 734 | s off 735 | f 1/1/1 2/2/1 3/3/1 4/4/1 736 | f 5/5/2 6/6/2 7/7/2 8/8/2 737 | f 3/9/3 5/10/3 8/11/3 4/12/3 738 | f 7/13/4 6/14/4 2/15/4 1/16/4 739 | f 8/17/5 7/18/5 1/19/5 4/20/5 740 | f 2/21/6 6/22/6 5/23/6 3/24/6 741 | f 9/25/7 10/26/7 11/27/7 12/28/7 742 | f 13/29/8 14/30/8 15/31/8 16/32/8 743 | f 11/33/9 13/34/9 16/35/9 12/36/9 744 | f 15/37/10 14/38/10 10/39/10 9/40/10 745 | f 16/41/11 15/42/11 9/43/11 12/44/11 746 | f 10/45/12 14/46/12 13/47/12 11/48/12 747 | f 17/49/13 18/50/13 19/51/13 20/52/13 748 | f 21/53/14 22/54/14 23/55/14 24/56/14 749 | f 19/57/15 21/58/15 24/59/15 20/60/15 750 | f 23/61/16 22/62/16 18/63/16 17/64/16 751 | f 24/65/17 23/66/17 17/67/17 20/68/17 752 | f 18/69/18 22/70/18 21/71/18 19/72/18 753 | f 25/73/19 26/74/19 27/75/19 28/76/19 754 | f 26/77/20 29/78/20 30/79/20 27/80/20 755 | f 29/78/21 31/81/21 32/82/21 30/79/21 756 | f 31/81/22 33/83/22 34/84/22 32/82/22 757 | f 33/85/23 35/86/23 36/87/23 34/88/23 758 | f 35/86/24 37/89/24 38/90/24 36/87/24 759 | f 37/89/25 39/91/25 40/92/25 38/90/25 760 | f 39/93/26 41/94/26 42/95/26 40/96/26 761 | f 41/94/27 43/97/27 44/98/27 42/95/27 762 | f 43/97/28 45/99/28 46/100/28 44/98/28 763 | f 45/101/29 47/102/29 48/103/29 46/104/29 764 | f 47/102/30 25/73/30 28/76/30 48/103/30 765 | f 28/105/31 27/106/31 30/107/31 32/108/31 34/109/31 36/110/31 38/111/31 40/112/31 42/113/31 44/114/31 46/115/31 48/116/31 766 | f 47/117/32 45/118/32 43/119/32 41/120/32 39/121/32 37/122/32 35/123/32 33/124/32 31/125/32 29/126/32 26/127/32 25/128/32 767 | f 49/129/33 50/130/33 51/131/33 768 | f 52/132/34 53/133/34 54/134/34 769 | f 49/135/35 52/136/35 54/137/35 50/138/35 770 | f 51/139/36 55/140/36 56/141/36 53/142/36 771 | f 49/143/37 51/144/37 53/145/37 52/146/37 772 | f 50/147/38 54/148/38 56/149/38 55/150/38 773 | f 50/130/39 55/151/39 51/131/39 774 | f 53/133/40 56/152/40 54/134/40 775 | f 57/153/41 58/154/41 59/155/41 60/156/41 776 | f 61/157/42 62/158/42 63/159/42 64/160/42 777 | f 59/161/43 61/162/43 64/163/43 60/164/43 778 | f 63/165/44 62/166/44 58/167/44 57/168/44 779 | f 64/169/45 63/170/45 57/171/45 60/172/45 780 | f 58/173/46 62/174/46 61/175/46 59/176/46 781 | f 65/177/47 66/178/47 67/179/47 68/180/47 782 | f 69/181/48 70/182/48 71/183/48 72/184/48 783 | f 67/185/49 69/186/49 72/187/49 68/188/49 784 | f 71/189/50 70/190/50 66/191/50 65/192/50 785 | f 72/193/51 71/194/51 65/195/51 68/196/51 786 | f 66/197/52 70/198/52 69/199/52 67/200/52 787 | f 73/201/53 74/202/53 75/203/53 76/204/53 788 | f 77/205/54 78/206/54 79/207/54 80/208/54 789 | f 75/209/55 77/210/55 80/211/55 76/212/55 790 | f 79/213/56 78/214/56 74/215/56 73/216/56 791 | f 80/217/57 79/218/57 73/219/57 76/220/57 792 | f 74/221/58 78/222/58 77/223/58 75/224/58 793 | f 81/225/59 82/226/59 83/227/59 84/228/59 794 | f 85/229/60 86/230/60 87/231/60 88/232/60 795 | f 83/233/61 85/234/61 88/235/61 84/236/61 796 | f 87/237/62 86/238/62 82/239/62 81/240/62 797 | f 88/241/63 87/242/63 81/243/63 84/244/63 798 | f 82/245/64 86/246/64 85/247/64 83/248/64 799 | f 89/249/65 90/250/65 91/251/65 92/252/65 800 | f 93/253/66 94/254/66 95/255/66 96/256/66 801 | f 91/257/67 93/258/67 96/259/67 92/260/67 802 | f 95/261/68 94/262/68 90/263/68 89/264/68 803 | f 96/265/69 95/266/69 89/267/69 92/268/69 804 | f 90/269/70 94/270/70 93/271/70 91/272/70 805 | f 97/273/71 98/274/71 99/275/71 100/276/71 806 | f 101/277/72 102/278/72 103/279/72 104/280/72 807 | f 99/281/73 101/282/73 104/283/73 100/284/73 808 | f 103/285/74 102/286/74 98/287/74 97/288/74 809 | f 104/289/75 103/290/75 97/291/75 100/292/75 810 | f 98/293/76 102/294/76 101/295/76 99/296/76 811 | usemtl mat5.002 812 | f 153/297/77 154/298/77 155/299/77 813 | f 156/300/78 157/301/78 158/302/78 814 | f 159/303/79 160/304/79 153/297/79 815 | f 158/305/80 157/306/80 153/307/80 155/308/80 816 | f 160/309/81 161/310/81 156/311/81 154/312/81 817 | f 157/301/82 161/313/82 159/314/82 818 | f 153/297/83 162/315/83 159/303/83 819 | f 157/306/84 162/316/84 153/307/84 820 | f 159/314/85 162/317/85 157/301/85 821 | f 160/309/86 159/318/86 161/310/86 822 | f 153/297/87 160/304/87 154/298/87 823 | f 156/300/88 161/313/88 157/301/88 824 | f 158/305/73 155/308/73 154/298/73 156/311/73 825 | usemtl mat4.002 826 | f 105/319/89 106/320/89 107/321/89 108/322/89 827 | f 109/323/90 110/324/90 111/325/90 112/326/90 828 | f 107/327/91 109/328/91 112/329/91 108/330/91 829 | f 111/331/92 110/332/92 106/333/92 105/334/92 830 | f 112/335/93 111/336/93 105/337/93 108/338/93 831 | f 106/339/94 110/340/94 109/341/94 107/342/94 832 | f 113/343/95 114/344/95 115/345/95 116/346/95 833 | f 114/344/96 117/347/96 118/348/96 115/345/96 834 | f 117/347/97 119/349/97 120/350/97 118/348/97 835 | f 119/351/98 121/352/98 122/353/98 120/354/98 836 | f 121/352/99 123/355/99 124/356/99 122/353/99 837 | f 123/355/100 125/357/100 126/358/100 124/356/100 838 | f 125/359/101 127/360/101 128/361/101 126/362/101 839 | f 127/360/102 129/363/102 130/364/102 128/361/102 840 | f 129/363/103 131/365/103 132/366/103 130/364/103 841 | f 131/367/104 133/368/104 134/369/104 132/370/104 842 | f 133/368/105 135/371/105 136/372/105 134/369/105 843 | f 135/371/106 113/373/106 116/374/106 136/372/106 844 | f 116/375/107 115/376/107 118/377/107 120/378/107 122/379/107 124/380/107 126/381/107 128/382/107 130/383/107 132/384/107 134/385/107 136/386/107 845 | f 135/387/108 133/388/108 131/389/108 129/390/108 127/391/108 125/392/108 123/393/108 121/394/108 119/395/108 117/396/108 114/397/108 113/398/108 846 | f 137/399/109 138/400/109 139/401/109 140/402/109 847 | f 141/403/110 142/404/110 143/405/110 144/406/110 848 | f 139/407/111 141/408/111 144/409/111 140/410/111 849 | f 143/411/112 142/412/112 138/413/112 137/414/112 850 | f 144/415/113 143/416/113 137/417/113 140/418/113 851 | f 138/419/114 142/420/114 141/421/114 139/422/114 852 | usemtl mat12.002 853 | f 145/423/115 146/424/115 147/425/115 148/426/115 854 | f 149/427/116 150/428/116 151/429/116 152/430/116 855 | f 147/431/117 149/432/117 152/433/117 148/434/117 856 | f 151/435/118 150/436/118 146/437/118 145/438/118 857 | f 152/439/119 151/440/119 145/441/119 148/442/119 858 | f 146/443/120 150/444/120 149/445/120 147/446/120 859 | -------------------------------------------------------------------------------- /Completed/app/sampledata/models/House.sfa: -------------------------------------------------------------------------------- 1 | { 2 | materials: [ 3 | { 4 | name: "mat12.002", 5 | parameters: [ 6 | { 7 | baseColor: null, 8 | }, 9 | { 10 | baseColorTint: [ 11 | 1, 12 | 0.92000000000000004, 13 | 0.23000000000000001, 14 | 1, 15 | ], 16 | }, 17 | { 18 | metallic: 1, 19 | }, 20 | { 21 | roughness: 0.14280000000000001, 22 | }, 23 | { 24 | opacity: null, 25 | }, 26 | ], 27 | source: "build/sceneform_sdk/default_materials/obj_material.sfm", 28 | }, 29 | { 30 | name: "mat20.002", 31 | parameters: [ 32 | { 33 | baseColor: null, 34 | }, 35 | { 36 | baseColorTint: [ 37 | 0.46999999999999997, 38 | 0.33000000000000002, 39 | 0.28000000000000003, 40 | 1, 41 | ], 42 | }, 43 | { 44 | metallic: 1, 45 | }, 46 | { 47 | roughness: 0.14280000000000001, 48 | }, 49 | { 50 | opacity: null, 51 | }, 52 | ], 53 | source: "build/sceneform_sdk/default_materials/obj_material.sfm", 54 | }, 55 | { 56 | name: "mat4.002", 57 | parameters: [ 58 | { 59 | baseColor: null, 60 | }, 61 | { 62 | baseColorTint: [ 63 | 0, 64 | 0.73999999999999999, 65 | 0.82999999999999996, 66 | 1, 67 | ], 68 | }, 69 | { 70 | metallic: 1, 71 | }, 72 | { 73 | roughness: 0.14280000000000001, 74 | }, 75 | { 76 | opacity: null, 77 | }, 78 | ], 79 | source: "build/sceneform_sdk/default_materials/obj_material.sfm", 80 | }, 81 | { 82 | name: "mat5.002", 83 | parameters: [ 84 | { 85 | baseColor: null, 86 | }, 87 | { 88 | baseColorTint: [ 89 | 0.01, 90 | 0.60999999999999999, 91 | 0.90000000000000002, 92 | 1, 93 | ], 94 | }, 95 | { 96 | metallic: 1, 97 | }, 98 | { 99 | roughness: 0.14280000000000001, 100 | }, 101 | { 102 | opacity: null, 103 | }, 104 | ], 105 | source: "build/sceneform_sdk/default_materials/obj_material.sfm", 106 | }, 107 | ], 108 | model: { 109 | attributes: [ 110 | "Position", 111 | "TexCoord", 112 | "Orientation", 113 | ], 114 | file: "sampledata/models/House.obj", 115 | name: "House", 116 | suggested_collision: { 117 | center: { 118 | x: 0, 119 | y: 0, 120 | z: 0, 121 | }, 122 | size: { 123 | x: 1, 124 | y: 1, 125 | z: 1, 126 | }, 127 | type: "Box", 128 | }, 129 | }, 130 | version: "0.51:1", 131 | } 132 | -------------------------------------------------------------------------------- /Completed/app/sampledata/models/andy.mtl: -------------------------------------------------------------------------------- 1 | newmtl unlit_material 2 | illum 2 3 | Kd 0.00 0.00 0.00 4 | Ka 0.00 0.00 0.00 5 | Tf 1.00 1.00 1.00 6 | map_Kd andy.png 7 | Ni 1.00 8 | -------------------------------------------------------------------------------- /Completed/app/sampledata/models/andy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/sampledata/models/andy.png -------------------------------------------------------------------------------- /Completed/app/sampledata/models/andy.sfa: -------------------------------------------------------------------------------- 1 | { 2 | materials: [ 3 | { 4 | name: "unlit_material", 5 | parameters: [ 6 | { 7 | baseColor: "andy", 8 | }, 9 | { 10 | baseColorTint: [ 11 | 1, 12 | 1, 13 | 1, 14 | 1, 15 | ], 16 | }, 17 | { 18 | metallic: 1, 19 | }, 20 | { 21 | roughness: 1, 22 | }, 23 | { 24 | opacity: null, 25 | }, 26 | ], 27 | source: "build/sceneform_sdk/default_materials/obj_material.sfm", 28 | }, 29 | ], 30 | model: { 31 | attributes: [ 32 | "Position", 33 | "TexCoord", 34 | "Orientation", 35 | ], 36 | file: "sampledata/models/andy.obj", 37 | name: "andy", 38 | suggested_collision: { 39 | center: { 40 | x: 0, 41 | y: 0, 42 | z: 0, 43 | }, 44 | size: { 45 | x: 1, 46 | y: 1, 47 | z: 1, 48 | }, 49 | type: "Box", 50 | }, 51 | }, 52 | samplers: [ 53 | { 54 | file: "sampledata/models/andy.png", 55 | name: "andy", 56 | pipeline_name: "andy.png", 57 | }, 58 | ], 59 | version: "0.51:1", 60 | } 61 | -------------------------------------------------------------------------------- /Completed/app/sampledata/models/andy_dance.sfa: -------------------------------------------------------------------------------- 1 | { 2 | animations: [ 3 | { 4 | clips: [ 5 | { 6 | name: 'Take 001', 7 | runtime_name: 'andy_dance', 8 | }, 9 | ], 10 | path: 'sampledata/models/andy_dance.fbx', 11 | }, 12 | { 13 | clips: [ 14 | { 15 | name: 'Take 001', 16 | runtime_name: 'andy_dance', 17 | }, 18 | ], 19 | path: 'sampledata/models/andy_dance.fbx', 20 | }, 21 | ], 22 | materials: [ 23 | { 24 | name: '08 - Default', 25 | parameters: [ 26 | { 27 | baseColor: [ 28 | 0.35686299999999999, 29 | 0.60392199999999996, 30 | 0.35686299999999999, 31 | 1, 32 | ], 33 | }, 34 | { 35 | baseColorMap: null, 36 | }, 37 | { 38 | normalMap: null, 39 | }, 40 | { 41 | interpolatedColor: null, 42 | }, 43 | { 44 | metallic: 0, 45 | }, 46 | { 47 | metallicMap: null, 48 | }, 49 | { 50 | roughness: 1, 51 | }, 52 | { 53 | roughnessMap: null, 54 | }, 55 | { 56 | opacity: null, 57 | }, 58 | ], 59 | source: 'build/sceneform_sdk/default_materials/fbx_material.sfm', 60 | }, 61 | ], 62 | model: { 63 | scale: 0.25, 64 | attributes: [ 65 | 'Position', 66 | 'TexCoord', 67 | 'Orientation', 68 | 'BoneIndices', 69 | 'BoneWeights', 70 | ], 71 | collision: {}, 72 | file: 'sampledata/models/andy_dance.fbx', 73 | name: 'andy_dance', 74 | recenter: 'root', 75 | }, 76 | version: '0.54:2', 77 | } 78 | -------------------------------------------------------------------------------- /Completed/app/sampledata/models/igloo.mtl: -------------------------------------------------------------------------------- 1 | newmtl lambert9SG 2 | illum 4 3 | Kd 0.57 0.97 1.00 4 | Ka 0.00 0.00 0.00 5 | Tf 1.00 1.00 1.00 6 | Ni 1.00 7 | -------------------------------------------------------------------------------- /Completed/app/sampledata/models/igloo.sfa: -------------------------------------------------------------------------------- 1 | { 2 | materials: [ 3 | { 4 | name: "lambert9SG", 5 | parameters: [ 6 | { 7 | baseColor: null, 8 | }, 9 | { 10 | baseColorTint: [ 11 | 0.56999999999999995, 12 | 0.96999999999999997, 13 | 1, 14 | 1, 15 | ], 16 | }, 17 | { 18 | metallic: 0, 19 | }, 20 | { 21 | roughness: 1, 22 | }, 23 | { 24 | opacity: null, 25 | }, 26 | ], 27 | source: "build/sceneform_sdk/default_materials/obj_material.sfm", 28 | }, 29 | ], 30 | model: { 31 | attributes: [ 32 | "Position", 33 | "TexCoord", 34 | "Orientation", 35 | ], 36 | file: "sampledata/models/igloo.obj", 37 | name: "igloo", 38 | scale: 0.25, 39 | suggested_collision: { 40 | center: { 41 | x: 0, 42 | y: 0, 43 | z: 0, 44 | }, 45 | size: { 46 | x: 1, 47 | y: 1, 48 | z: 1, 49 | }, 50 | type: "Box", 51 | }, 52 | }, 53 | version: "0.51:1", 54 | } 55 | -------------------------------------------------------------------------------- /Completed/app/src/androidTest/java/com/google/devrel/ar/codelab/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Google LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | https://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package com.google.devrel.ar.codelab; 17 | 18 | import android.content.Context; 19 | import android.support.test.InstrumentationRegistry; 20 | import android.support.test.runner.AndroidJUnit4; 21 | 22 | import org.junit.Test; 23 | import org.junit.runner.RunWith; 24 | 25 | import static org.junit.Assert.*; 26 | 27 | /** 28 | * Instrumented test, which will execute on an Android device. 29 | * 30 | * @see Testing documentation 31 | */ 32 | @RunWith(AndroidJUnit4.class) 33 | public class ExampleInstrumentedTest { 34 | @Test 35 | public void useAppContext() { 36 | // Context of the app under test. 37 | Context appContext = InstrumentationRegistry.getTargetContext(); 38 | 39 | assertEquals("com.google.devrel.ar.codelab", appContext.getPackageName()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Completed/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 31 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 47 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Completed/app/src/main/assets/Cabin.sfb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/assets/Cabin.sfb -------------------------------------------------------------------------------- /Completed/app/src/main/assets/House.sfb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/assets/House.sfb -------------------------------------------------------------------------------- /Completed/app/src/main/assets/andy.sfb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/assets/andy.sfb -------------------------------------------------------------------------------- /Completed/app/src/main/assets/andy_dance.sfb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/assets/andy_dance.sfb -------------------------------------------------------------------------------- /Completed/app/src/main/assets/igloo.sfb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/assets/igloo.sfb -------------------------------------------------------------------------------- /Completed/app/src/main/java/com/google/devrel/ar/codelab/MainActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Google LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | https://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package com.google.devrel.ar.codelab; 17 | 18 | import android.content.Intent; 19 | import android.graphics.Bitmap; 20 | import android.graphics.Point; 21 | import android.net.Uri; 22 | import android.os.Bundle; 23 | import android.os.Environment; 24 | import android.os.Handler; 25 | import android.os.HandlerThread; 26 | import android.os.Looper; 27 | import android.support.design.widget.FloatingActionButton; 28 | import android.support.design.widget.Snackbar; 29 | import android.support.v4.content.FileProvider; 30 | import android.support.v7.app.AlertDialog; 31 | import android.support.v7.app.AppCompatActivity; 32 | import android.support.v7.widget.Toolbar; 33 | import android.view.PixelCopy; 34 | import android.view.SurfaceHolder; 35 | import android.view.View; 36 | import android.view.Menu; 37 | import android.view.MenuItem; 38 | import android.widget.ImageView; 39 | import android.widget.LinearLayout; 40 | import android.widget.Toast; 41 | 42 | import com.google.ar.core.Anchor; 43 | import com.google.ar.core.Frame; 44 | import com.google.ar.core.HitResult; 45 | import com.google.ar.core.Plane; 46 | import com.google.ar.core.Trackable; 47 | import com.google.ar.core.TrackingState; 48 | import com.google.ar.sceneform.AnchorNode; 49 | import com.google.ar.sceneform.ArSceneView; 50 | import com.google.ar.sceneform.Scene; 51 | import com.google.ar.sceneform.animation.ModelAnimator; 52 | import com.google.ar.sceneform.rendering.AnimationData; 53 | import com.google.ar.sceneform.rendering.ModelRenderable; 54 | import com.google.ar.sceneform.rendering.Renderable; 55 | import com.google.ar.sceneform.rendering.Renderer; 56 | import com.google.ar.sceneform.ux.ArFragment; 57 | import com.google.ar.sceneform.ux.TransformableNode; 58 | 59 | import java.io.ByteArrayOutputStream; 60 | import java.io.File; 61 | import java.io.FileOutputStream; 62 | import java.io.IOException; 63 | import java.lang.ref.WeakReference; 64 | import java.nio.ByteBuffer; 65 | import java.text.SimpleDateFormat; 66 | import java.util.Date; 67 | import java.util.List; 68 | import java.util.concurrent.CompletableFuture; 69 | 70 | public class MainActivity extends AppCompatActivity { 71 | 72 | private ArFragment fragment; 73 | private PointerDrawable pointer = new PointerDrawable(); 74 | private ModelLoader modelLoader; 75 | private boolean isTracking; 76 | private boolean isHitting; 77 | 78 | 79 | @Override 80 | protected void onCreate(Bundle savedInstanceState) { 81 | super.onCreate(savedInstanceState); 82 | setContentView(R.layout.activity_main); 83 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 84 | setSupportActionBar(toolbar); 85 | 86 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); 87 | fab.setOnClickListener(new View.OnClickListener() { 88 | @Override 89 | public void onClick(View view) { 90 | takePhoto(); 91 | } 92 | }); 93 | 94 | fragment = (ArFragment) 95 | getSupportFragmentManager().findFragmentById(R.id.sceneform_fragment); 96 | 97 | fragment.getArSceneView().getScene().addOnUpdateListener(frameTime -> { 98 | fragment.onUpdate(frameTime); 99 | onUpdate(); 100 | }); 101 | 102 | modelLoader = new ModelLoader(new WeakReference<>(this)); 103 | 104 | initializeGallery(); 105 | } 106 | 107 | private String generateFilename() { 108 | String date = 109 | new SimpleDateFormat("yyyyMMddHHmmss", java.util.Locale.getDefault()).format(new Date()); 110 | return Environment.getExternalStoragePublicDirectory( 111 | Environment.DIRECTORY_PICTURES) + File.separator + "Sceneform/" + date + "_screenshot.jpg"; 112 | } 113 | 114 | private void saveBitmapToDisk(Bitmap bitmap, String filename) throws IOException { 115 | 116 | File out = new File(filename); 117 | if (!out.getParentFile().exists()) { 118 | out.getParentFile().mkdirs(); 119 | } 120 | try (FileOutputStream outputStream = new FileOutputStream(filename); 121 | ByteArrayOutputStream outputData = new ByteArrayOutputStream()) { 122 | bitmap.compress(Bitmap.CompressFormat.PNG, 100, outputData); 123 | outputData.writeTo(outputStream); 124 | outputStream.flush(); 125 | outputStream.close(); 126 | } catch (IOException ex) { 127 | throw new IOException("Failed to save bitmap to disk", ex); 128 | } 129 | } 130 | 131 | private void takePhoto() { 132 | final String filename = generateFilename(); 133 | ArSceneView view = fragment.getArSceneView(); 134 | 135 | // Create a bitmap the size of the scene view. 136 | final Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), 137 | Bitmap.Config.ARGB_8888); 138 | 139 | // Create a handler thread to offload the processing of the image. 140 | final HandlerThread handlerThread = new HandlerThread("PixelCopier"); 141 | handlerThread.start(); 142 | // Make the request to copy. 143 | PixelCopy.request(view, bitmap, (copyResult) -> { 144 | if (copyResult == PixelCopy.SUCCESS) { 145 | try { 146 | saveBitmapToDisk(bitmap, filename); 147 | } catch (IOException e) { 148 | Toast toast = Toast.makeText(MainActivity.this, e.toString(), 149 | Toast.LENGTH_LONG); 150 | toast.show(); 151 | return; 152 | } 153 | Snackbar snackbar = Snackbar.make(findViewById(android.R.id.content), 154 | "Photo saved", Snackbar.LENGTH_LONG); 155 | snackbar.setAction("Open in Photos", v -> { 156 | File photoFile = new File(filename); 157 | 158 | Uri photoURI = FileProvider.getUriForFile(MainActivity.this, 159 | MainActivity.this.getPackageName() + ".ar.codelab.name.provider", 160 | photoFile); 161 | Intent intent = new Intent(Intent.ACTION_VIEW, photoURI); 162 | intent.setDataAndType(photoURI, "image/*"); 163 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); 164 | startActivity(intent); 165 | 166 | }); 167 | snackbar.show(); 168 | } else { 169 | Toast toast = Toast.makeText(MainActivity.this, 170 | "Failed to copyPixels: " + copyResult, Toast.LENGTH_LONG); 171 | toast.show(); 172 | } 173 | handlerThread.quitSafely(); 174 | }, new Handler(handlerThread.getLooper())); 175 | } 176 | 177 | private void onUpdate() { 178 | boolean trackingChanged = updateTracking(); 179 | View contentView = findViewById(android.R.id.content); 180 | if (trackingChanged) { 181 | if (isTracking) { 182 | contentView.getOverlay().add(pointer); 183 | } else { 184 | contentView.getOverlay().remove(pointer); 185 | } 186 | contentView.invalidate(); 187 | } 188 | 189 | if (isTracking) { 190 | boolean hitTestChanged = updateHitTest(); 191 | if (hitTestChanged) { 192 | pointer.setEnabled(isHitting); 193 | contentView.invalidate(); 194 | } 195 | } 196 | } 197 | private boolean updateTracking() { 198 | Frame frame = fragment.getArSceneView().getArFrame(); 199 | boolean wasTracking = isTracking; 200 | isTracking = frame.getCamera().getTrackingState() == TrackingState.TRACKING; 201 | return isTracking != wasTracking; 202 | } 203 | private boolean updateHitTest() { 204 | Frame frame = fragment.getArSceneView().getArFrame(); 205 | android.graphics.Point pt = getScreenCenter(); 206 | List hits; 207 | boolean wasHitting = isHitting; 208 | isHitting = false; 209 | if (frame != null) { 210 | hits = frame.hitTest(pt.x, pt.y); 211 | for (HitResult hit : hits) { 212 | Trackable trackable = hit.getTrackable(); 213 | if ((trackable instanceof Plane && 214 | ((Plane) trackable).isPoseInPolygon(hit.getHitPose()))) { 215 | isHitting = true; 216 | break; 217 | } 218 | } 219 | } 220 | return wasHitting != isHitting; 221 | } 222 | 223 | private android.graphics.Point getScreenCenter() { 224 | View vw = findViewById(android.R.id.content); 225 | return new android.graphics.Point(vw.getWidth() / 2, vw.getHeight() / 2); 226 | } 227 | 228 | @Override 229 | public boolean onCreateOptionsMenu(Menu menu) { 230 | // Inflate the menu; this adds items to the action bar if it is present. 231 | getMenuInflater().inflate(R.menu.menu_main, menu); 232 | return true; 233 | } 234 | 235 | @Override 236 | public boolean onOptionsItemSelected(MenuItem item) { 237 | // Handle action bar item clicks here. The action bar will 238 | // automatically handle clicks on the Home/Up button, so long 239 | // as you specify a parent activity in AndroidManifest.xml. 240 | int id = item.getItemId(); 241 | 242 | //noinspection SimplifiableIfStatement 243 | if (id == R.id.action_settings) { 244 | return true; 245 | } 246 | 247 | return super.onOptionsItemSelected(item); 248 | } 249 | private void initializeGallery() { 250 | LinearLayout gallery = findViewById(R.id.gallery_layout); 251 | 252 | ImageView andy = new ImageView(this); 253 | andy.setImageResource(R.drawable.droid_thumb); 254 | andy.setContentDescription("andy"); 255 | andy.setOnClickListener(view ->{addObject( Uri.parse("andy_dance.sfb"));}); 256 | gallery.addView(andy); 257 | 258 | ImageView cabin = new ImageView(this); 259 | cabin.setImageResource(R.drawable.cabin_thumb); 260 | cabin.setContentDescription("cabin"); 261 | cabin.setOnClickListener(view ->{addObject(Uri.parse("Cabin.sfb"));}); 262 | gallery.addView(cabin); 263 | 264 | ImageView house = new ImageView(this); 265 | house.setImageResource(R.drawable.house_thumb); 266 | house.setContentDescription("house"); 267 | house.setOnClickListener(view ->{addObject(Uri.parse("House.sfb"));}); 268 | gallery.addView(house); 269 | 270 | ImageView igloo = new ImageView(this); 271 | igloo.setImageResource(R.drawable.igloo_thumb); 272 | igloo.setContentDescription("igloo"); 273 | igloo.setOnClickListener(view ->{addObject(Uri.parse("igloo.sfb"));}); 274 | gallery.addView(igloo); 275 | } 276 | 277 | private void addObject(Uri model) { 278 | Frame frame = fragment.getArSceneView().getArFrame(); 279 | android.graphics.Point pt = getScreenCenter(); 280 | List hits; 281 | if (frame != null) { 282 | hits = frame.hitTest(pt.x, pt.y); 283 | for (HitResult hit : hits) { 284 | Trackable trackable = hit.getTrackable(); 285 | if (trackable instanceof Plane && 286 | ((Plane) trackable).isPoseInPolygon(hit.getHitPose())) { 287 | modelLoader.loadModel(hit.createAnchor(), model); 288 | break; 289 | 290 | } 291 | } 292 | } 293 | } 294 | 295 | public void onException(Throwable throwable){ 296 | AlertDialog.Builder builder = new AlertDialog.Builder(this); 297 | builder.setMessage(throwable.getMessage()) 298 | .setTitle("Codelab error!"); 299 | AlertDialog dialog = builder.create(); 300 | dialog.show(); 301 | return; 302 | } 303 | 304 | public void addNodeToScene(Anchor anchor, ModelRenderable renderable) { 305 | AnchorNode anchorNode = new AnchorNode(anchor); 306 | TransformableNode node = new TransformableNode(fragment.getTransformationSystem()); 307 | node.setRenderable(renderable); 308 | node.setParent(anchorNode); 309 | fragment.getArSceneView().getScene().addChild(anchorNode); 310 | node.select(); 311 | startAnimation(node, renderable); 312 | } 313 | 314 | 315 | public void startAnimation(TransformableNode node, ModelRenderable renderable){ 316 | if(renderable==null || renderable.getAnimationDataCount() == 0) { 317 | return; 318 | } 319 | for(int i = 0;i < renderable.getAnimationDataCount();i++){ 320 | AnimationData animationData = renderable.getAnimationData(i); 321 | } 322 | ModelAnimator animator = new ModelAnimator(renderable.getAnimationData(0), renderable); 323 | animator.start(); 324 | node.setOnTapListener( 325 | (hitTestResult, motionEvent) -> { 326 | togglePauseAndResume(animator); 327 | }); 328 | } 329 | 330 | public void togglePauseAndResume(ModelAnimator animator) { 331 | if (animator.isPaused()) { 332 | animator.resume(); 333 | } else if (animator.isStarted()) { 334 | animator.pause(); 335 | } else { 336 | animator.start(); 337 | } 338 | } 339 | } 340 | -------------------------------------------------------------------------------- /Completed/app/src/main/java/com/google/devrel/ar/codelab/ModelLoader.java: -------------------------------------------------------------------------------- 1 | package com.google.devrel.ar.codelab; 2 | 3 | import android.net.Uri; 4 | import android.util.Log; 5 | 6 | import com.google.ar.core.Anchor; 7 | import com.google.ar.sceneform.rendering.ModelRenderable; 8 | 9 | import java.lang.ref.WeakReference; 10 | 11 | public class ModelLoader { 12 | private final WeakReference owner; 13 | private static final String TAG = "ModelLoader"; 14 | 15 | ModelLoader(WeakReference owner) { 16 | this.owner = owner; 17 | } 18 | 19 | void loadModel(Anchor anchor, Uri uri) { 20 | if (owner.get() == null) { 21 | Log.d(TAG, "Activity is null. Cannot load model."); 22 | return; 23 | } 24 | ModelRenderable.builder() 25 | .setSource(owner.get(), uri) 26 | .build() 27 | .handle((renderable, throwable) -> { 28 | MainActivity activity = owner.get(); 29 | if (activity == null) { 30 | return null; 31 | } else if (throwable != null) { 32 | activity.onException(throwable); 33 | } else { 34 | activity.addNodeToScene(anchor, renderable); 35 | } 36 | return null; 37 | }); 38 | 39 | return; 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /Completed/app/src/main/java/com/google/devrel/ar/codelab/PointerDrawable.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Google LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | https://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package com.google.devrel.ar.codelab; 17 | 18 | import android.graphics.Canvas; 19 | import android.graphics.Color; 20 | import android.graphics.ColorFilter; 21 | import android.graphics.Paint; 22 | import android.graphics.drawable.Drawable; 23 | import android.support.annotation.NonNull; 24 | import android.support.annotation.Nullable; 25 | 26 | public class PointerDrawable extends Drawable { 27 | private final Paint paint = new Paint(); 28 | private boolean enabled; 29 | @Override 30 | public void draw(@NonNull Canvas canvas) { 31 | float cx = canvas.getWidth()/2; 32 | float cy = canvas.getHeight()/2; 33 | if (enabled) { 34 | paint.setColor(Color.GREEN); 35 | canvas.drawCircle(cx, cy, 10, paint); 36 | }else { 37 | paint.setColor(Color.GRAY); 38 | canvas.drawText("X", cx, cy, paint); 39 | } 40 | } 41 | 42 | @Override 43 | public void setAlpha(int i) { 44 | 45 | } 46 | 47 | @Override 48 | public void setColorFilter(@Nullable ColorFilter colorFilter) { 49 | 50 | } 51 | 52 | @Override 53 | public int getOpacity() { 54 | return 0; 55 | } 56 | public boolean isEnabled() { 57 | return enabled; 58 | } 59 | 60 | public void setEnabled(boolean enabled) { 61 | this.enabled = enabled; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Completed/app/src/main/java/com/google/devrel/ar/codelab/WritingArFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Google LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | https://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package com.google.devrel.ar.codelab; 18 | 19 | import android.Manifest; 20 | 21 | import com.google.ar.sceneform.ux.ArFragment; 22 | 23 | public class WritingArFragment extends ArFragment { 24 | @Override 25 | public String[] getAdditionalPermissions() { 26 | String[] additionalPermissions = super.getAdditionalPermissions(); 27 | int permissionLength = additionalPermissions != null ? additionalPermissions.length : 0; 28 | String[] permissions = new String[permissionLength + 1]; 29 | permissions[0] = Manifest.permission.WRITE_EXTERNAL_STORAGE; 30 | if (permissionLength > 0) { 31 | System.arraycopy(additionalPermissions, 0, permissions, 1, additionalPermissions.length); 32 | } 33 | return permissions; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Completed/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /Completed/app/src/main/res/drawable/cabin_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/res/drawable/cabin_thumb.png -------------------------------------------------------------------------------- /Completed/app/src/main/res/drawable/droid_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/res/drawable/droid_thumb.png -------------------------------------------------------------------------------- /Completed/app/src/main/res/drawable/house_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/res/drawable/house_thumb.png -------------------------------------------------------------------------------- /Completed/app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 11 | 16 | 21 | 26 | 31 | 36 | 41 | 46 | 51 | 56 | 61 | 66 | 71 | 76 | 81 | 86 | 91 | 96 | 101 | 106 | 111 | 116 | 121 | 126 | 131 | 136 | 141 | 146 | 151 | 156 | 161 | 166 | 171 | 172 | -------------------------------------------------------------------------------- /Completed/app/src/main/res/drawable/igloo_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/res/drawable/igloo_thumb.png -------------------------------------------------------------------------------- /Completed/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Completed/app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 20 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Completed/app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /Completed/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Completed/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Completed/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /Completed/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Completed/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /Completed/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Completed/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Completed/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Completed/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Completed/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Completed/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Completed/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlecodelabs/sceneform-intro/bf7877db0770cbf14f9be5f195832d969c39ecff/Completed/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Completed/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /Completed/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | 4 | -------------------------------------------------------------------------------- /Completed/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Codelab 3 | Settings 4 | 5 | -------------------------------------------------------------------------------- /Completed/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |