cx10w 航拍视频zp 怎么3d翻转

[Android]实现数字的3d翻转效果
传统的旋转动画方式如:&?xml version="1.0" encoding="utf-8"?&
&set xmlns:android="/apk/res/android"&
android:fromDegrees="0"
android:toDegrees="359"
android:duration="500"
android:repeatCount="-1"
android:pivotX="50%"
android:pivotY="50%" /&
&/set&只能实现在一个2维平面内旋转,要实现3D只能使用opengl或者简化了3D动画实现的camera类。api demo中的Rotate3DAnimation
演示了如何使用camera来实现3D翻转动画,本文讲解如何将这种动画运用到数字的翻转中。
数字翻转最常见的是在日历应用中,当日期改变,数字将翻转到另外一个值,和一般的翻转不同,这种翻转有以下几个特征:1.数字增加或者减少翻转的方向不同,一般增加是顺时针,减少是逆时针。2.数字的翻转需要同时改变数字的值:当翻转进度过半时需要更新其显示内容。3.这点不重要。我们需要一个能美化数字的字体。4.为了使翻转更生动需要在翻转过程中按照一定的规律的改变透明度。下面几张图演示了4-5的翻转过程:实现:我们仿照api demo中的Rotate3DAnimation 写了一个Rotate3DNumberAnimation: & & & & Rotate3DNumberAnimation的构造函数需有三个参数,分别说明动画组件的中心点位置及旋转方向。
 & & & & Rotate3DNumberAnimation.initialize()将初始化动画组件及其父容器的宽高;通常亦可进行另外的初始化工作,本例中用于执行对camera进行实例化赋值。
 & & & & Rotate3DNumberAnimation.applyTransformation()第一个参数为动画的进度时间值,取值范围为[0.0f,1.0f],第二个参数Transformation记录着动画某一帧中变形的原始数据。该方法在动画的每一帧显示过程中都会被调用。
 & & & & 
在翻转过程中,为了避免在动画下半部分时图像为镜面效果影响数字的阅读,应将翻转角度做180度的减法。代码为Rotate3DNumberAnimation.applyTransformation()中的:if (overHalf) {
// 翻转过半的情况下,为保证数字仍为可读的文字而非镜面效果的文字,需翻转180度。
degree = degree - 180;
}动画翻转到一半后,应更新数字内容。为了得知翻转进度,于Rotate3DNumberAnimation中设计一内部静态接口类&InterpolatedTimeListener&,该接口只有一个方法&interpolatedTime(float interpolatedTime)&可以将动画进度传递给监听发起者。除了在翻转一半后更新数字内容外,我们还需根据这个Listener改变数字的透明度。@SuppressLint("NewApi")
public void interpolatedTime(float interpolatedTime) {
// 监听到翻转进度过半时,更新txtNumber显示内容。
if (enableRefresh && interpolatedTime & 0.5f) {
txtNumber.setText(Integer.toString(number));
Log.d("ANDROID_LAB", "setNumber:" + number);
enableRefresh =
//改变透明度
if(interpolatedTime & 0.5f) {
txtNumber.setAlpha((interpolatedTime -0.5f) * 2);
txtNumber.setAlpha(1-interpolatedTime * 2);
}当翻转一半透明度由1变0,然后在完成后续的翻转过程中透明度由0变1。我们使用了@SuppressLint(&NewApi&)是因为view.setAlpha方法不支持api 11以下,如果你想兼容2.x的设备,请用nineoldandroids库,并用ViewHelper.setAlpha()替代。为了美化数字,我们将字体 HelveticaNeueLTPro-ThEx.otf放到Assets/fonts目录下。设置字体的代码如下:Typeface localTypeface = Typeface.createFromAsset(getAssets(), "fonts/HelveticaNeueLTPro-ThEx.otf");
txtNumber.setTypeface(localTypeface);同时为字体加上阴影效果:&style name="text_shadow_style"&
&item name="android:shadowColor"&#&/item&
&item name="android:shadowDx"&1.0&/item&
&item name="android:shadowDy"&1.0&/item&
&item name="android:shadowRadius"&0.5&/item&
&/style&下面是java全部代码:MainActivity package com.example.
import com.example.rotatedemo.Rotate3DNumberAnimation.InterpolatedTimeL
import android.annotation.SuppressL
import android.app.A
import android.graphics.T
import android.os.B
import android.util.L
import android.view.V
import android.view.View.OnClickL
import android.widget.B
import android.widget.TextV
public class MainActivity extends Activity implements OnClickListener, InterpolatedTimeListener {
private Button btnIncrease, btnD
private TextView txtN
/** TextNumber是否允许显示最新的数字。 */
private boolean enableR
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnIncrease = (Button) findViewById(R.id.btnIncrease);
btnDecrease = (Button) findViewById(R.id.btnDecrease);
txtNumber = (TextView) findViewById(R.id.txtNumber);
btnIncrease.setOnClickListener(this);
btnDecrease.setOnClickListener(this);
number = 3;
Typeface localTypeface = Typeface.createFromAsset(getAssets(), "fonts/HelveticaNeueLTPro-ThEx.otf");
txtNumber.setTypeface(localTypeface);
txtNumber.setText(Integer.toString(number));
public void onClick(View v) {
enableRefresh =
Rotate3DNumberAnimation rotateAnim =
float cX = txtNumber.getWidth() / 2.0f;
float cY = txtNumber.getHeight() / 2.0f;
if (v == btnDecrease) {
rotateAnim = new Rotate3DNumberAnimation(cX, cY, Rotate3DNumberAnimation.ROTATE_DECREASE);
} else if (v == btnIncrease) {
rotateAnim = new Rotate3DNumberAnimation(cX, cY, Rotate3DNumberAnimation.ROTATE_INCREASE);
if (rotateAnim != null) {
rotateAnim.setInterpolatedTimeListener(this);
rotateAnim.setFillAfter(true);
txtNumber.startAnimation(rotateAnim);
@SuppressLint("NewApi")
public void interpolatedTime(float interpolatedTime) {
// 监听到翻转进度过半时,更新txtNumber显示内容。
if (enableRefresh && interpolatedTime & 0.5f) {
txtNumber.setText(Integer.toString(number));
Log.d("ANDROID_LAB", "setNumber:" + number);
enableRefresh =
//改变透明度
if(interpolatedTime & 0.5f) {
txtNumber.setAlpha((interpolatedTime -0.5f) * 2);
txtNumber.setAlpha(1-interpolatedTime * 2);
}Rotate3DNumberAnimationpackage com.example.
import android.graphics.C
import android.graphics.M
import android.view.animation.A
import android.view.animation.T
public class Rotate3DNumberAnimation extends Animation {
/** 值为true时可明确查看动画的旋转方向。 */
public static final boolean DEBUG =
/** 沿Y轴正方向看,数值减1时动画逆时针旋转。 */
public static final boolean ROTATE_DECREASE =
/** 沿Y轴正方向看,数值减1时动画顺时针旋转。 */
public static final boolean ROTATE_INCREASE =
/** Z轴上最大深度。 */
public static final float DEPTH_Z = 0.0f;
/** 动画显示时长。 */
public static final long DURATION = 500;
/** 图片翻转类型。 */
private final float centerX;
private final float centerY;
/** 用于监听动画进度。当值过半时需更新txtNumber的内容。 */
private InterpolatedTimeL
public Rotate3DNumberAnimation(float cX, float cY, boolean type) {
centerX = cX;
centerY = cY;
this.type =
setDuration(DURATION);
public void initialize(int width, int height, int parentWidth, int parentHeight) {
// 在构造函数之后、getTransformation()之前调用本方法。
super.initialize(width, height, parentWidth, parentHeight);
camera = new Camera();
public void setInterpolatedTimeListener(InterpolatedTimeListener listener) {
this.listener =
protected void applyTransformation(float interpolatedTime, Transformation transformation) {
// interpolatedTime:动画进度值,范围为[0.0f,1.0f]
if (listener != null) {
listener.interpolatedTime(interpolatedTime);
float from = 0.0f, to = 0.0f;
if (type == ROTATE_DECREASE) {
from = 0.0f;
to = 180.0f;
} else if (type == ROTATE_INCREASE) {
from = 360.0f;
to = 180.0f;
float degree = from + (to - from) * interpolatedT
boolean overHalf = (interpolatedTime & 0.5f);
if (overHalf) {
// 翻转过半的情况下,为保证数字仍为可读的文字而非镜面效果的文字,需翻转180度。
degree = degree - 180;
// float depth = 0.0f;
float depth = (0.5f - Math.abs(interpolatedTime - 0.5f)) * DEPTH_Z;
final Matrix matrix = transformation.getMatrix();
camera.save();
camera.translate(0.0f, 0.0f, depth);
camera.rotateY(degree);
camera.getMatrix(matrix);
camera.restore();
if (DEBUG) {
if (overHalf) {
matrix.preTranslate(-centerX * 2, -centerY);
matrix.postTranslate(centerX * 2, centerY);
//确保图片的翻转过程一直处于组件的中心点位置
matrix.preTranslate(-centerX, -centerY);
matrix.postTranslate(centerX, centerY);
/** 动画进度监听器。 */
public static interface InterpolatedTimeListener {
public void interpolatedTime(float interpolatedTime);
} 项目下载地址:注:背景图片比较大,如果在低端机上比较卡,可以将activity的背景换成纯色。
上一篇: 1,背景 吸入(Inhale)效果,最初我是在iOS上面看到的,它是在Note程序中,用户可能添加了一页记录,在做删除时,它的删除效果是:这一页内容吸入到一个垃圾框的图标里面。请看下图所示: =================================================================
下一篇: 实现数字的3d翻转效果麻雀虽小五脏俱全 澄星航模CX-10W无人机--百度百家
麻雀虽小五脏俱全 澄星航模CX-10W无人机
分享到微信朋友圈
麻雀虽小五脏俱全 澄星航模CX-10W无人机
近些年来民用消费级无人机越来越受到关注,其中以大疆最为典型,虽说无人机的型号和种类也让用户有很多选择,但是无人机由于价格的原因,一直以来被视为“土豪的玩具”。就在本月小米推出了旗下第一款四轴无人机,分为1080P和4K版本,价格分别为2499元和2999元,一直秉承“让每个人都能享受科技的乐趣”的小米此次并没有给用户一个特别大的惊喜,“为发烧而生”的价格着实让很多粉丝有了些许的失望。
此刻也许你在纠结小米无人机的价格及性能等问题,也还在犹豫小米无人机是否值得入手,那么在这之前对于一个从未接触过无人机的消费者不妨体验一下接下来的这款Mini无人机他的名字就是——澄星航模CX-10W
1.澄星航模CX-10W采用锂电池充电,电池容量为150mAh,理论续航时间为5min,充电时长为10 min
2.澄星航模CX-10W控制方式有两种,一种是手机端下载控制APP,另外一种是通过附赠的Mini遥控器进行控制
3.澄星航模CX-10W控制信号采用WIFI信号,理论可控距离为25m
包装及开箱
澄星航模CX-10W绝对符合Mini的称号,这种小巧的设计感,不由让用户有一种爱不释手的感觉,包装的正面是澄星航模CX-10W的一个主视图,背面是一些基本的参数和介绍。
包装内部是XX的机身,底下夹层是说明书及充电线等配件。
外观及结构
照片中可以非常直观的看到澄星航模CX-10W实际上非常的小巧,整体体积仅为32×32×22mm。
澄星航模CX-10W采用四旋翼设计,重量重要集中在机身中间的位置,重量主要来源于电池,机身底部是一根WIFI天线,建议在使用的时候将天线与机身保持垂直。
1.手机APP控制
手机控制需要下载手机端的APP
2.Mini遥控手柄控制
澄星航模CX-10W还具有遥控器版本,遥控器的尺寸要比正常的手柄小很多,
拍摄及充电
澄星航模CX-10W配备高像素摄像头,并可通过WIFI在手机APP上实时图传拍摄的画面。
通过手机端可快速拍摄和录制拍摄的画面。
澄星航模CX-10W的充电时通过的一个特制的充电接口进行充电的,另外一端则是采用标准的USB。
飞行操控体验
1.客观的讲,澄星航模CX-10W的上手并没有想象中的那么简单,缺少了大型无人机的一键起飞和一键返航降落等功能,澄星航模CX-10W的降落着实很让人伤脑筋。
2.起飞的时候问题不大,推动油门推杆,XX会垂直起飞,反应迅速。
3.降落时对于新手来说速度的控制尤为重要,往往新手这个时候难以把控“坠机”的情况时有发生,也因此极为考验操作技巧。
4.飞行过程中的拍摄非常的容易,通过手机端的一键拍照/摄影键,即可轻松
新手最好购置旋翼保护罩,既能保证旋翼意外损坏,也能够防止旋翼高速旋转的时候伤及他人和自己。
虽然澄星航模CX-10W的飞行距离及高度受限硬件本身,但也需要用户注意在城市的禁飞区尽量不要尝试飞行。
澄星航模CX-10W作为一款定价仅为200元的无人机产品,在产品体验方面确实符合“麻雀虽小五脏俱全”,除了高端品牌的一键起飞、降落、返航以外,XX完全具备无人机的基本飞行和拍摄能力,对于那些刚刚接触无人机的用户,将XX作为购买真正高端无人机前的练手产品,再合适不过了,相信真正入手的用户定会爱上这个“小家伙”的
关注72变,关注智能生活
微信号www72byte
原文地址:
分享到微信朋友圈
在手机阅读、分享本文
还可以输入250个字
推荐文章RECOMMEND
阅读:1048
阅读:40万
阅读:1369
热门文章HOT NEWS
日,由中国投资协会投资咨询专业委员会电商金...
百度新闻客户端
百度新闻客户端
百度新闻客户端
扫描二维码下载
订阅 "百家" 频道
观看更多百家精彩新闻Hot Search:
Recent searches:
Cheerson CX-10W CX10W Mini Wifi FPV 0.3MP Camera LED 3D Flip 2.4G 4CH 6 Axis RC Quadcopter BNF Without Transmitter - Dark Gray
Item Code: 362174
Reg. Price:
USD 84.21&& Save: 73%
You will get 24 GeekPoints
if you purchase this item.
12item(s) added
Add to Cart
Bulk order rebate
Shipping: in 2-7 business days
FREE SHIPPING
Price for all:
You Save:USD -26.61
Original price : USD 22.99
Description
Highlights
0.3MP camera to shoot videos and pictures
4CH with LED lights
6-axis gyro with calibration function
Ascend, descend, forward, backward, turn left, turn right, hover, Left sideward fly, right sideward fly etc.
Battery with protective function
WIFI mobile control, R/C distance up to 15m
Switch between H/L speed
FPV with 3D flip function
It allows many people to play it simultaneously and the transmission function featured by 8 frequency points to make sure that they do not disturb each other
Cheerson CX-10W Mini Wifi FPV 0.3MP Camera Quadcopter&
Cheerson CX-10-W (Worlds Smallest FPV Drone)
Cheerson CX-10W Drone Review
Specification
Specification
Flight Time
About&4 minutes
Charging&Time
About 60 minutes
Control&Distance
About&15-30M
Flight Distance
About 15-30M
Battery for Quadcopter
3.7V 150mAh
Dimensions & Weight (Main Product)
62 x 62 x 20mm
Package Contents
1 x CX-10W Mobile RC Quadcopter
1 x USB charging cable
4 x Spare blades
1 x User Manual
Customer Photos
Be the first to of this product!
Customer Videos
Be the first to of this product!
Customer Reviews
Overall Customer Reviews Rating:
( Based on
100% Good Reputation Rate
Be the first to of this product!
Questions & Answers
Guests Also Bought
4%Site-Wide OFFSubscribe to get exclusive offers and more savings!
Cheerson CX-10W CX10W Mini Wifi FPV 0.3MP Camera LED 3D Flip 2.4G 4CH 6 Axis RC Quadcopter BNF Without Transmitter - Dar...
Buy it Now
geekbuying
Cheerson CX-10W CX10W Mini Wifi FPV 0.3MP Camera LED 3D Flip 2.4G 4CH 6 Axis RC Quadcopter BNF Without Transmitter - Dark Gray
Highlights
0.3MP camera to shoot videos and pictures
4CH with LED lights
6-axis gyro with calibration function
Ascend, descend, forward, backward, turn left, turn right, hover, Left sideward fly, right sideward fly etc.
Battery with protective function
WIFI mobile control, R/C distance up to 15m
Switch between H/L speed
FPV with 3D flip function
It allows many people to play it simultaneously and the transmission function featured by 8 frequency points to make sure that they do not
disturb each other
Cheerson CX-10W Mini Wifi FPV 0.3MP Camera Quadcopter&
Cheerson CX-10-W (Worlds Smallest FPV Drone)
Cheerson CX-10W Drone Review
Specification
Specification
Flight Time
About&4 minutes
Charging&Time
About 60 minutes
Control&Distance
About&15-30M
Flight Distance
About 15-30M
Battery for Quadcopter
3.7V 150mAh
Dimensions & Weight (Main Product)
62 x 62 x 20mm
Package Contents
1 x CX-10W Mobile RC Quadcopter
1 x USB charging cable
4 x Spare blades
1 x User Manual
Product #: 362174
5 stars, based on 10
Regular price: USD 84.21
(Sale ends
January 09!)
Available from:
Executive Objects
Condition: Previously owned,
in excellent condition
In stock! Order now!Hot Search:
Recent searches:
Customer Reviews &
Cheerson CX-10W CX10W Mini Wifi FPV 0.3MP Camera LED 3D Flip 2.4G 4CH 6 Axis RC Quadcopter BNF Witho...
Free shipping
For This Product:
Average Rating
Good Reputation Rate
people found the following review helpful
Big fun in a nano quadcopter
April 25,2016
This quadcopter is really small,The app was easy download and the quad connected to it easily
Was this review helpful to you?}

我要回帖

更多关于 cx 10w说明书 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信