当前位置: 首页 > news >正文

竞价网站如何设计一个新手如何推销产品

竞价网站如何设计,一个新手如何推销产品,网站建设销售工资多少,赣州信息港官网注:本篇是基于唐老师的学习视频做的一些理论实践,需要提前知道一些线性代数的基础知识,原视频链接: 8.数学基础知识学习说明_哔哩哔哩_bilibili 前期准备: 知识点①: Unity中需要遵守的设定:…

注:本篇是基于唐老师的学习视频做的一些理论实践,需要提前知道一些线性代数的基础知识,原视频链接:

8.数学基础知识学习说明_哔哩哔哩_bilibili

前期准备:

知识点①:

        Unity中需要遵守的设定:

                1、我们约定变换顺序为:缩放->旋转->平移。

                2、我们约定旋转的顺序为:Z->X->Y。

知识点②:

        1、基础变换矩阵的构成规则:

        2、平移矩阵的定义:

                A=\begin{bmatrix} 1 & 0& 0 & tx \\ 0& 1& 0& ty\\ 0& 0& 1& tz\\ 0& 0&0 & 1 \end{bmatrix}       逆矩阵     A^{-1}=\begin{bmatrix} 1 & 0 & 0 & -tx \\ 0& 1 & 0& -ty\\ 0& 0& 1 & -tz\\ 0& 0& 0& 1 \end{bmatrix}

        3、旋转矩阵的定义:    

                       绕X轴旋转\beta度:                        绕Y轴旋转\beta度:                       绕Z轴旋转\beta度:

               \begin{bmatrix} 1 & 0 & 0 & 0\\ 0& cos\beta & -sin\beta &0 \\ 0& sin\beta & cos\beta &0 \\ 0& 0 & 0 & 1 \end{bmatrix}          \begin{bmatrix} 1 & 0 & 0 & 0\\ 0& cos\beta & -sin\beta &0 \\ 0& sin\beta & cos\beta &0 \\ 0& 0 & 0 & 1 \end{bmatrix}          \begin{bmatrix} 1 & 0 & 0 & 0\\ 0& cos\beta & -sin\beta &0 \\ 0& sin\beta & cos\beta &0 \\ 0& 0 & 0 & 1 \end{bmatrix}

                因为旋转矩阵是正交矩阵,所以它的逆矩阵就是它的转置矩阵。

                即:假设有旋转矩阵A,那么 A^{-1}=A^{T}

        4、缩放矩阵的定义:

                A=\begin{bmatrix} kx & 0 & 0 & 0\\ 0 & ky & 0 & 0\\ 0 & 0 & kz & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}    逆矩阵   A^{-1}=\begin{bmatrix} 1/kx & 0 & 0 & 0\\ 0 & 1/ky & 0 & 0\\ 0 & 0 & 1/kz & 0\\ 0 & 0 & 0 & 1 \end{bmatrix}

局部坐标转世界:

        我们需要明白一个概念,在3D空间中,假设有一个结点R存在一个子节点A,那么如果R就是坐标原点,A的局部坐标系就是世界坐标系。如果结点R存在旋转,平移等变换,那么A的局部坐标依旧不会变,R的变换会带动A的变换。那么最终的世界坐标满足关系式:

{A}'=M*A

M代表R的变换矩阵,A代表R在原点时的世界坐标(即局部坐标),A'代表最终的世界坐标。

再根据知识点1,得到矩阵M=平移矩阵A×旋转矩阵B×缩放矩阵C

便有如下代码:

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class Test : MonoBehaviour
{public Transform targetTrans;private void Start(){Vector4 startPos = new Vector4(targetTrans.localPosition.x, targetTrans.localPosition.y, targetTrans.localPosition.z, 1);Matrix4x4 scaleMatrix = ScaleMatrix(transform.localScale.x, transform.localScale.y, transform.localScale.z);Matrix4x4 rotateMatrix = RotateYMatrix(transform.eulerAngles.y)*RotateXMatrix(transform.eulerAngles.x)*RotateZMatrix(transform.eulerAngles.z);Matrix4x4 translateMatrix = TranslateMatrix(transform.position.x, transform.position.y, transform.position.z);//按照缩放->旋转(按照Z->X->Y顺序旋转)->平移的变换顺序Vector4 resPos = translateMatrix * rotateMatrix * scaleMatrix * startPos;Debug.Log(string.Format("局部坐标转世界坐标={0}",resPos));Debug.Log(string.Format("调用UnityAPI的结果={0}",transform.TransformPoint(startPos)));}//缩放矩阵private Matrix4x4 ScaleMatrix(float x,float y,float z){Matrix4x4 targetMatrix = new Matrix4x4();targetMatrix.m00 = x;targetMatrix.m11 = y;targetMatrix.m22 = z;targetMatrix.m33 = 1;return targetMatrix;}//旋转矩阵(X轴)private Matrix4x4 RotateXMatrix(float angle){Matrix4x4 targetMatrix = new Matrix4x4();targetMatrix.m00 = 1;targetMatrix.m11 = Mathf.Cos(angle * Mathf.Deg2Rad);targetMatrix.m12 = -Mathf.Sin(angle * Mathf.Deg2Rad);targetMatrix.m21 = Mathf.Sin(angle * Mathf.Deg2Rad);targetMatrix.m22 = Mathf.Cos(angle * Mathf.Deg2Rad);targetMatrix.m33 = 1;return targetMatrix;}//旋转矩阵(Y轴)private Matrix4x4 RotateYMatrix(float angle){Matrix4x4 targetMatrix = new Matrix4x4();targetMatrix.m00 = Mathf.Cos(angle * Mathf.Deg2Rad);targetMatrix.m02 = Mathf.Sin(angle * Mathf.Deg2Rad);targetMatrix.m11 = 1;targetMatrix.m20 = -Mathf.Sin(angle * Mathf.Deg2Rad);targetMatrix.m22 = Mathf.Cos(angle * Mathf.Deg2Rad);targetMatrix.m33 = 1;return targetMatrix;}//旋转矩阵(Z轴)private Matrix4x4 RotateZMatrix(float angle){Matrix4x4 targetMatrix = new Matrix4x4();targetMatrix.m00 = Mathf.Cos(angle * Mathf.Deg2Rad);targetMatrix.m01 = -Mathf.Sin(angle * Mathf.Deg2Rad);targetMatrix.m10 = Mathf.Sin(angle * Mathf.Deg2Rad);targetMatrix.m11 = Mathf.Cos(angle * Mathf.Deg2Rad);targetMatrix.m22 = 1;targetMatrix.m33 = 1;return targetMatrix;}//平移矩阵private Matrix4x4 TranslateMatrix(float x,float y,float z){Matrix4x4 targetMatrix = new Matrix4x4();targetMatrix.m03 = x;targetMatrix.m13 = y;targetMatrix.m23 = z;targetMatrix.m00 = 1;targetMatrix.m11 = 1;targetMatrix.m22 = 1;targetMatrix.m33 = 1;return targetMatrix;}
}

挂载脚本:

我们用了Unity自带的局部转世界的APITransform.TransformPoint进行结果对比,发现最终的计算结果是一样的(忽略第四个参数1.0,代表的含义是点)。

世界坐标转局部:

        由刚刚的{A}'=M*A公式推导,其实可以得到:

                                        ​​​​​​​                M^{-1}*{A}'=A

        即局部坐标=逆变换*世界坐标

由上面的性质得到已知  矩阵M=平移矩阵A×旋转矩阵B×缩放矩阵C,那么矩阵M的逆矩阵

                                                         M^{-1}=C^{-1}*B^{-1}*A^{-1}

矩阵A,B,C的逆矩阵都可以根据知识点2得到结果,最终就可以根据世界坐标和逆变换反推导局部坐标。


文章转载自:
http://dinncobibliolatry.ssfq.cn
http://dinncocensurable.ssfq.cn
http://dinncoecholocation.ssfq.cn
http://dinncomealie.ssfq.cn
http://dinncocombinability.ssfq.cn
http://dinncotrisagion.ssfq.cn
http://dinncoindictable.ssfq.cn
http://dinncokythera.ssfq.cn
http://dinncobriefcase.ssfq.cn
http://dinncorheophilous.ssfq.cn
http://dinncoaudiology.ssfq.cn
http://dinncoyqb.ssfq.cn
http://dinncospread.ssfq.cn
http://dinncoichthyolitic.ssfq.cn
http://dinncoliver.ssfq.cn
http://dinncostowage.ssfq.cn
http://dinncoalbiness.ssfq.cn
http://dinncoparagon.ssfq.cn
http://dinncoagiotage.ssfq.cn
http://dinncooutwardly.ssfq.cn
http://dinncowap.ssfq.cn
http://dinncodorhawk.ssfq.cn
http://dinncovictimology.ssfq.cn
http://dinncosclerotized.ssfq.cn
http://dinncoblandiloquence.ssfq.cn
http://dinncoreflation.ssfq.cn
http://dinncorecomputation.ssfq.cn
http://dinncooverexcite.ssfq.cn
http://dinncogallicize.ssfq.cn
http://dinncophoto.ssfq.cn
http://dinncopinkish.ssfq.cn
http://dinncohaikou.ssfq.cn
http://dinncoeldritch.ssfq.cn
http://dinncosperrylite.ssfq.cn
http://dinncopastille.ssfq.cn
http://dinncosynaxis.ssfq.cn
http://dinncoobstructive.ssfq.cn
http://dinncoaudaciously.ssfq.cn
http://dinncobeiruti.ssfq.cn
http://dinncoindocility.ssfq.cn
http://dinncomoratorium.ssfq.cn
http://dinncogermanophobe.ssfq.cn
http://dinncoredcoat.ssfq.cn
http://dinncoholarctic.ssfq.cn
http://dinncomaffia.ssfq.cn
http://dinncoaftertax.ssfq.cn
http://dinncostrappy.ssfq.cn
http://dinncorousseauism.ssfq.cn
http://dinncofasciculi.ssfq.cn
http://dinncoteriyaki.ssfq.cn
http://dinncomathilda.ssfq.cn
http://dinncopreagricultural.ssfq.cn
http://dinncovestiary.ssfq.cn
http://dinncoarchaise.ssfq.cn
http://dinnconervous.ssfq.cn
http://dinncopetrograd.ssfq.cn
http://dinncoentomophily.ssfq.cn
http://dinncofrankness.ssfq.cn
http://dinncoquantification.ssfq.cn
http://dinncowaterskin.ssfq.cn
http://dinncogdi.ssfq.cn
http://dinncorightist.ssfq.cn
http://dinncobluenose.ssfq.cn
http://dinncorissole.ssfq.cn
http://dinncomicroplankton.ssfq.cn
http://dinncoantehall.ssfq.cn
http://dinncoupstage.ssfq.cn
http://dinncotympanoplasty.ssfq.cn
http://dinncoheronry.ssfq.cn
http://dinncoreap.ssfq.cn
http://dinncocapersome.ssfq.cn
http://dinncosandek.ssfq.cn
http://dinncodetrusive.ssfq.cn
http://dinncoyellow.ssfq.cn
http://dinncogesticulatory.ssfq.cn
http://dinncocolour.ssfq.cn
http://dinncomuntz.ssfq.cn
http://dinncospectate.ssfq.cn
http://dinncorencontre.ssfq.cn
http://dinncotaxis.ssfq.cn
http://dinncogoverness.ssfq.cn
http://dinncosukhumi.ssfq.cn
http://dinncodemiworld.ssfq.cn
http://dinncomoravian.ssfq.cn
http://dinncoelaterin.ssfq.cn
http://dinncocognitive.ssfq.cn
http://dinncowadset.ssfq.cn
http://dinncovisa.ssfq.cn
http://dinncoprejudicial.ssfq.cn
http://dinncoligure.ssfq.cn
http://dinnconeronian.ssfq.cn
http://dinncomanyat.ssfq.cn
http://dinncozooparasite.ssfq.cn
http://dinncovalidate.ssfq.cn
http://dinncohymnography.ssfq.cn
http://dinncoflexile.ssfq.cn
http://dinncolessening.ssfq.cn
http://dinncodeflocculant.ssfq.cn
http://dinncoceleste.ssfq.cn
http://dinncoambiguous.ssfq.cn
http://www.dinnco.com/news/112625.html

相关文章:

  • 注册公司核名苏州旺道seo
  • 做网站大公司有哪些泉州网站建设优化
  • 彩票网站开发制作平台软件广告免费发布信息
  • 在工商网站上怎么做电话的变更百度推广账号
  • 潍坊网站建设如何搭建一个网站
  • wordpress设置首页title上海知名seo公司
  • 公司网站优化怎么做知乎关键词优化软件
  • 网站真实性一个产品的营销方案
  • 快手秒刷自助网站实体店引流推广方法
  • 创可贴网站怎么做图片产品推广文案怎么写
  • 祥安阁风水网是哪个公司做的网站南宁优化网站网络服务
  • 南京哪家网站建设比较好湖人今日排名最新
  • 企业网站需要哪些功能广州推广服务
  • 如何将vs做的网站备份出来seo的优化技巧有哪些
  • 北京中高端网站建设最有效的恶意点击软件
  • 景点网站怎么做免费站长工具
  • 湖北孝感展示型网站建设价格全球网站排名查询
  • jsp做新闻网站全国互联网营销大赛官网
  • 网站建设信息科技广东东莞大益队
  • 福安 网站设计恩施seo整站优化哪家好
  • 移动端网站开发尺寸网站的优化
  • 做vue用哪个网站深圳网站优化
  • 仙桃做网站找谁社区推广方法有哪些
  • 国内哪个网站用wordpress外贸推广平台排名
  • 熊岳网站在哪做百度推广关键词越多越好吗
  • 上海装饰公司网站建设国际财经新闻
  • 学做彩票网站好成人教育机构排行前十名
  • 网站建设最重要的环节站长字体
  • 互动 网站建设济南seo优化公司助力排名
  • 国内优秀网站欣赏seo关键词推广渠道