演讲稿: 如何使用增强现实技术提高应用的用户体验

With the accellerated evolution of mobile hardware, application developers tend to reconsider the importance of the Augmented Reality technology ( called AR for short in this article subsequently ) in regard to satisfy their customers better with enhanced user experience.

What is AR? See one explanation from Wikipedia:

Augmented reality (AR) is an interactive experience of a real-world environment where the objects that reside in the real world are enhanced by computer-generated perceptual information. AR can be defined as a system that fulfills three basic features: a combination of real and virtual worlds, real-time interaction, and accurate 3D registration of virtual and real objects.

This blog will not explore the possible scenario where AR can play its important role. Instead, Jerry will introduce a kind of development approach which enables developers to generate applications leveraging AR without deep knowledge on Computer Graphics.

This approach consists of pure JavaScript technical stack:the combination of React-Native plus ViroReact.

Jerry has introduced how to use Cordova to package a hybrid mobile application in the past:

And compared with Cordova, React-Native has quite different design idea: while Cordova can easily allow existing web application to run under different mobile platform at the cost of some performance loss, the application built by React-Native can behave more like a native mobile application.

For the concrete comparison between these two technical stacks, please refer to this medium article.

ViroReact,a platform for developers to rapidly build native cross platform AR applications using React Native. Its website provides many step by step guide by following which, you can soon get a running Hello World application with AR enablement.

Although just a single declaration code to introduce the dependency of ViroReact to your React-Native application as below, it‘s just the tip of iceberg.

When we enter the root folder of application with react-viro declared as dependency in its package.json and perform npm install, lots of artifacts are automatically downloaded into the node_modules folder:

Expand folder react-viro and we can find two separate folder, android and ios, which contains corresponding library codes for each platform. This mechanism implies how ViroReact achieves the cross platform enablement of AR feature. And what‘s the meaning of arcore_client under android folder above?

Before we go deep into the source code, let‘s acquaint ourselves with some prerequisite knowledge. In ViroReact website, it is documented that both ARKit from iOS and ARCore from Android are supported.

In this blog I choose Android platform which means I will concentrate on ARCore. Still remember the arcore_client folder mentioned previously?

Let‘s first see some real examples, developed by my colleague Wang Leo:

https://youtu.be/05A0bIiVouE
https://youtu.be/Rt163cQ_fbg

Amazing, isn‘t it?

Below are steps how to develop an application like that and make it running in your Android phone.

As the first step, ARCore should be installed on the Android phone.

ARCore is Google’s platform for building augmented reality experiences. Using different APIs, ARCore enables your phone to sense its environment, understand the world and interact with information.

Check the supported device list from Google website and install ARCore into your device according to corresponding instructions:


In ViroReact website there is a nice tutorial for beginners( just as our SAP UI5 tutorials):

Just follow the steps there and finally you will get a Hello World application with some computer generated virtual objects positioned within your real world:

In fact the AR car demo by my colleague Leo is also based on this tutorial, so I will introduce the delta part Leo has added on top of the Hello World tutorial.

In React-Native package.json file, name the project as "ViroSample" and declare the dependency of React-Native and ViroReact as below:

Execute the following two command lines:

  • react-native start
  • react-native run-android

And you can find the corresponding generated Java source code for Android platform under android folder. The most important one is MainActivity.java, where the project name defined in package.json is injected:

And in MainApplication.java, the entry point of React-Native JavaScript module is injected in Android callback getJSMainModuleName:

In my opinion the common process of ViroReact development consists of three major steps: Match, Replace and Augment.

Match step

As developers mix computer generated virtual objects with real world, they must decide which places in real environment could be used to hold the virtual objects and tell AR application the exact position. In ViroReact based AR application this is achieved by the tag . See one example below.

As its name hints, this tag declares a marker which guides ViroReact with exact position where the virtual object should be put on. As long as end user opens device Camera and detects a real object in the real world which is exactly the same as the object represented by the marker, we call this process as "matched" and ViroReact will automatically replace marker with another prepared virtual object ( will introduce soon ). As long as the marker is matched by some object in the real world, the replace process is automatically done without any additional coding from developer.

A marker is a placeholder in the application and could have various types, and of course ViroARImageMarker has Image as marker type, the image marker is indicated as name "logo" defined in line 44 above.

In the above example, the marker named "logo" is created by the following code:

The input of createTargets API is an image file stored in project folder:

This is reason in the youtube demo video that first Leo displays this image in his screen, then scan it via phone camera, and the image marker is replaced by the prepared car 3D model.

Replace step

As mentioned earlier, there is nothing to do from developer in this step except providing a 3D model to be replaced by image marker.

ViroReact provides the tag which represents the 3D car model consisting of a pure model ( .obj file ) and a series of material textures.

Below is the obj file for this car demo, opened by 3D Design software:

In Paint 3D software, we can drag it and have a 360 degree view on it. You can see the dynamic effect from this video:

You might think that the car model has no color on its surface and doesn‘t look not fancy at all. So do I. That‘s why we need to prepare texture as well.

In the project folder six different image files are stored there as raw material for model texture.

Colorful materials are created using those texture images files, and finally generate the glossy car model in the youtube video.

Augment step

Finally it‘s time for we developers to play with those generated virtual car model by JavaScript code. Since now we have six colorful textures at hand, it follows logically that it could be nice if the car in the AR application could change color every time it‘s tapped in the phone.

A piece of cake: register a function to onClick event handler:

And change the binding field for texture property accordingly:

Check this video below about how the Tesla car model in the application can change color once pressed:

Hope this blog can give you a basic understanding how to develop AR application using React-Native + ViroReact, thanks for reading.

要获取更多Jerry的原创文章,请关注公众号"汪子熙":

原文地址:https://www.cnblogs.com/sap-jerry/p/11663503.html

时间: 2024-10-07 21:57:59

演讲稿: 如何使用增强现实技术提高应用的用户体验的相关文章

vs2010 使用SignalR 提高B2C商城用户体验(三)

vs2010 使用SignalR 提高B2C商城用户体验(三) 上一章节,我们的web即时通讯已经可以实现跨域了,但针对我们的需求,还希望,一些客户端程序可以和我们的web用户,在线聊天,所以到SignalR官网,查阅文档,当然,还有版本限制,限制都是SignalR 2.0了,我们1.几版本的能不能完美支持呢? 看到了这些内容,感觉是不是很惊喜,全端支持 我们来看.NET Library,大概浏览一下,启动VS,新建一个WinForm程序,打开nuget,找到Client的对应版本:  Inst

使用SignalR 提高B2C商城用户体验1

vs2010 使用SignalR 提高B2C商城用户体验(一) 1.需求简介,做为新时代的b2c商城,没有即时通讯,怎么提供用户粘稠度,怎么增加销量,用户购物的第一习惯就是咨询,即时通讯,应运而生.这里使用SignalR来实现即时通讯,再好不过了,不过项目依然简历在2010的基础上,所以不能使用新版本的SignalR了,这里介绍一下1.0.0版本的. 2.整个框架大概是这样搭建的,欢迎拍砖: 3.启动VS2010,新建一个项目,这里我建立的是asp.net mvc4 然后通过nuget引入Sig

案例分享(一)——如何提高产品的用户体验

提问:你觉得微信wechat和QQ两个相比,哪个更易于使用? 微信wechat目前已经成为了一个国际产品,很多其他国家也在使用,例如,在东南亚国 家非常流行.它是如何做到的呢--微信团队投入了更多的资源来进行易用性设计.经过研究 发现,如果想获得好的用户体验,开发项目应该花10%甚至更多的预算用于易用性测试. 目前许多软件的开发,开发周期过短,以至于验收时,存在不少与用户界面有关的缺 陷,造成大量的返工. 那么想一想:是否可以在前面需求设计阶段就使用有效方法,预先与最终客户确认界面 上的相关问题

CDN高级技术专家周哲: 深度剖析短视频分发过程中的用户体验优化技术点

2018深圳云栖大会已经圆满落幕,在飞天技术汇-弹性计算.网络和CDN专场中,阿里云CDN高级技术专家周哲为我们带来了<海量短视频极速分发>的主题分享,带领我们从视频内容采集.上传.存储和分发的角度介绍整体方案,并且重点讲解短视频加速的注意事项和用户体验优化要点. 讲解从三个部分展开:短视频应用场景,阿里云短视频解决方案,阿里云对短视频用户体验优化的相关优化. 短视频应用场景 短视频比图片和文字包含更多的信息,在移动互联网普及的今天,短视频应用场景非常广泛. 一. 社群分享场景用户可以录制视频

CDN高级技术专家周哲:深度剖析短视频分发过程中的用户体验优化技术点

深圳云栖大会已经圆满落幕,在3月29日飞天技术汇-弹性计算.网络和CDN专场中,阿里云CDN高级技术专家周哲为我们带来了<海量短视频极速分发>的主题分享,带领我们从视频内容采集.上传.存储和分发的角度介绍整体方案,并且重点讲解短视频加速的注意事项和用户体验优化要点. 讲解从三个部分展开:短视频应用场景.阿里云短视频解决方案.阿里云对短视频用户体验的相关优化. 短视频应用场景 短视频比图片和文字包含更多的信息,在移动互联网普及的今天,短视频应用场景非常广泛. 一. 社群分享场景 用户可以录制视频

增强现实技术漫谈

前言 随着信息技术的高速发展,虚拟现实.增强现实等逐渐火热.虚拟现实是一种完全建立虚拟环境,让人类脱离现有环境进入新的世界,它的广泛应用可能还要经过一段时间的积淀,目前虚拟现实主要在科研仿真.虚拟漫游.游戏娱乐.教育培训等领域发挥作用.而从虚拟现实中发展起来的增强现实,旨在增强人类能力,为人类提供各种辅助信息,成为沟通人类个体与信息世界的重要枢纽.目前已经在医疗.交通.教育培训.航天.通信.工业维修等领域发挥作用.相信增强现实的大规模应用会比虚拟现实更早一些,可能取代智能手机,成为下一代智能计算

干货系列1:Java互联网网站开发工程师 的技术提高与晋升路线(技术专精)

前几天写了自己对于Java软件开发工程师职业发展规划方面的一些感悟,陆续收到一些反馈,希望我能再就Java工程师不同的开发(职责)方向谈谈职业发展问题.(上一篇:Java软件开发工程师的自我修养与晋升(B/S结构)下面就具体谈谈Java程序员的另一个职责方向:Java互联网开发工程师 Java互联网开发工程师的主要岗位职责是: 负责网站平台的系统设计.数据库设计.代码开发,以及技术攻关的工作. 职业发展道路基本有3条: 第一条路线(技术专精): 初级Java开发---中级--高级---项目主管-

用缓冲技术提高JSP应用的性能和稳定性之OSchche应用(3)

Oscache 特点 缓存任何对象,你可以不受限制的缓存部分jsp页面或HTTP请求,任何java对象都可以缓存. 拥有全面的API--OSCache API给你全面的程序来控制所有的OSCache特性. 永久缓存--缓存能随意的写入硬盘,因此允许昂贵的创建(expensive-to-create)数据来保持缓存,甚至能让应用重启. 支持集群--集群缓存数据能被单个的进行参数配置,不需要修改代码. 缓存记录的过期--你可以有最大限度的控制缓存对象的过期,包括可插入式的刷新策略(如果默认性能不需要

C#多线程技术提高RabbitMQ消费吞吐率(二)

一.课程介绍 本次分享课程属于<C#高级编程实战技能开发宝典课程系列>中的第二部分,阿笨后续会计划将实际项目中的一些比较实用的关于C#高级编程的技巧分享出来给大家进行学习,不断的收集.整理和完善此系列课程!本次高级系列课程适合人群如下: 1.有一定的NET开发基础并对RabbitMQ技术有一定了解和认识. 2.喜欢阿笨的干货分享课程的童鞋们. 希望大家在选择阿笨的 C#高级编程实战技能开发宝典课程系列的时候,根据自身的情况进行选择,由于本次课程不是零基础教学课程系列,所以说.NET基础差的到了