uv

Index Buffer Object and UV Coordinates don't play nice

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This generates the 25 main vertices. For x As Single = -1 To 1 Step 0.5F For y As Single = 1 To -1 Step -0.5F Dim pt1 As New Vector3(x, y, 0) tFloats.Add(pt1) Next Next This is the indices, which makes up 16 tiles made of 32 triangles, I actually generate them but this is the first row: Dim inasd() As Integer = { 0, 2, 10, 2, 10, 12, 10, 12, 20, 12, 20, 22, 20, 22, 30, 22, 30, 32 } Now I'm trying to apply a texture to every single triangle, 1 texture per tile. 16 different textures. Now my problem lies within the fact that when I use GL

Brew doctor - “warning: unbrewed header files were found in /usr/local/include”?

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: When I run brew doctor , the following error is thrown Warning : Unbrewed header files were found in / usr / local / include . If you didn 't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected header files: /usr/local/include/curl/curl.h /usr/local/include/curl/curlbuild.h /usr/local/include/curl/curlrules.h /usr/local/include/curl/curlver.h /usr/local/include/curl/easy.h /usr/local/include/curl/mprintf.h /usr/local/include/curl/multi.h /usr/local/include/curl

THREE.js generate UV coordinate

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am working on importing a model into a scene using the THREE.js OBJ loader. I know that I am able to import the geometry fine, because when I assign a MeshNormalMaterial to it, it shows up great. However, if I use anything that requires UV coordinates, It gives me the error: [.WebGLRenderingContext]GL ERROR :GL_INVALID_OPERATION : glDrawElements: attempt to access out of range vertices in attribute 1 I know this is because the loaded OBJ has no UV coordinates, but I was wondering if there was any way to generate the needed texture

实现UGUI图片循环滚动

匿名 (未验证) 提交于 2019-12-03 00:37:01
解决思路: 利用图片的UV偏移来实现 解决方案: 1)新建一个Raw Image 2)导入一张.tif / .png / ..tga / .dds 格式(支持透明)的图片,Texture Type为Default,不要改成Sprite(2D and UI) 3)将图片放入新建的Raw Image中 4)改变Raw Image中UV Rect里的X或者Y值,大功告成。 文章来源: 实现UGUI图片循环滚动

第2章 Hexo博客配置

匿名 (未验证) 提交于 2019-12-03 00:29:01
Hexo官方 Hexo官方(中文) Hexo主题 Next 主题 ͼ1 默认有些页面是没有的,需要手动添加,进入博客文件夹,打开Git bash。 $hexo new page "categories" $hexo new page "tags" $hexo new page "about" 编辑 tags/index.md 和categories/index.md和about/index.md分别添加如下内容: type : "categories" layout : "categories" type : "tags" layout : "tags" type : "about" layout : "about" 主题的 _config.yml 文件中的 menu 中进行匹配。 menu : Home: / //主页 Archives: /archives //分类 categories: /categories //归档 tags: /tags //标签 about : / about //关于 来必力官网: https://livere.com 没有账号的注册账号,打开来必力官网: https://livere.com ,点击上方的安装,选择免费的city版本。 ͼ2 ͼ3 点击【申请获得代码】,进入下一步操作。 复制其中的uid字段。 <!-- 来必力City版安装代码

PV UV QPS 并发数

匿名 (未验证) 提交于 2019-12-02 22:56:40
TPS(Transactions Per Second) :每秒事务数 QPS(Query Per Second) :每秒请求数,QPS其实是衡量吞吐量的一个常用指标,就是说服务器在一秒的时间内处理了多少个请求。 并发数 :并发数是指系统同时能处理的请求数量,这个也是反应了系统的负载能力。 峰值QPS : 原理:每天80%的访问集中在20%的时间里,这20%时间叫做峰值时间 公式:( 总PV数 * 80% ) / ( 每天秒数 * 20% ) = 峰值时间每秒请求数(QPS) PV(Page View) :页面访问量,即页面浏览量或点击量,用户每次刷新即被计算一次 UV(Unique Visitor) :独立访客,统计1天内访问某站点的用户数(以cookie为依据) 吐吞量 :吞吐量是指系统在单位时间内处理请求的数量 响应时间(RT) :响应时间是指系统对请求作出响应的时间,一般取平均响应时间 QPS(每秒查询数)、TPS(每秒事务数)是吞吐量的常用量化指标,另外还有HPS(每秒HTTP请求数)。 QPS(TPS)、并发数、响应时间它们三者之间的关系是: QPS(TPS)= 并发数 / 平均响应时间 并发数 = QPS * 平均响应时间 举例说明: 例1:   假设1秒钟100个请求,处理每个请求需要花2秒,   那么 50(每秒可以处理50个请求,即QPS使50) = 100

Python获得百度统计API的数据并发送邮件

匿名 (未验证) 提交于 2019-12-02 22:11:45
Python获得百度统计API的数据并发送邮件 小工具 本来这么晚是不准备写博客的,当是想到了那个狗子绝对会在开学的时候跟我逼逼这个事情,所以,还是老老实实地写一下吧。 Baidu统计API的使用 系统环境: Python2 requests库:发出请求 json库:json处理 getSiteList的使用 官方文档 在此,说实话,这是我使用百BaiduAPI最坑的一次,在这个官方文档的getSiteList中,完全不告诉你请求参数是什么。 首先,需要获得百度统计API的token,在这 写了token获得的流程。 # encoding=utf-8 import requests import json siteListUrl = "https://api.baidu.com/json/tongji/v1/ReportService/getSiteList" # 这个是请求的数据 data = { "header": { 'username': "你的用户名", 'password': "你的密码", 'token': '前面所获得的token', 'Content-type': 'application/json' } } # 把请求数据变成json数据 data = json.dumps(data) r = requests.post(url,data=data) #

使用MTA HTML5统计API来分析数据

匿名 (未验证) 提交于 2019-12-02 22:09:29
在开发个人博客的时候,用到了腾讯移动分析(MTA),相比其他数据统计平台来说我喜欢她的简洁高效,易上手,同时文档也比较全面,提供了数据接口供用户调用。 在看了MTA演示 Demo 和 官方文档 后,我就决定使用 .NET Core将其HTML5统计API进行封装,以供博客直接调用,省去各种鉴权生成sign的操作。 首先需要在 MTA 官网进行HTML5应用创建,当然她还支持小程序和移动App。 然后就可以看到如上图的应用管理界面,如果你不打算使用其API接口,直接拿到统计代码嵌入在自己网站中即可,不出意外10分钟左右即可查看网站部分指标的实时数据,次日可以查看昨日的全部数据。 接下来继续,在调用MTA接口之前需要先生成sign, 双方维护同一份私钥,在发起请求的时候,发起方(合作方)将当前的请求参数数组,按照key值进行排序,然后'key=value'拼接到加密串后,进行md5的编码。接收方以同样的处理方式,对ts小于或等于30分钟的请求进行处理,sign一致则合法,否则失败。 有了这段算法描述,利用C#代码实现如下: /// <summary> /// 生成sign /// </summary> /// <param name="keyValues"></param> /// <returns></returns> public static string

Unity的UI究竟为什么可以合批

匿名 (未验证) 提交于 2019-12-02 22:06:11
1.UI/Default代码研究 首先,我想到的是,既然是对图集纹理进行采样,而且又不能统一更改材质的纹理UV值,我们通常写的shader都是直接根据模型UV值对主纹理进行采样,那会不会是shader中对MainTexture进行了什么神奇的处理,让图片采样只根据指定的UV值进行采样呢? 我去官网下载了shader代码,找到了UI/Default的具体实现: fixed4 _Color; fixed4 _TextureSampleAdd; float4 _ClipRect; v2f vert(appdata_t v) { v2f OUT; UNITY_SETUP_INSTANCE_ID(v); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); OUT.worldPosition = v.vertex; OUT.vertex = UnityObjectToClipPos(OUT.worldPosition); OUT.texcoord = v.texcoord; OUT.color = v.color * _Color; return OUT; } sampler2D _MainTex; fixed4 frag(v2f IN) : SV_Target { half4 color = (tex2D(_MainTex, IN.texcoord) +

UV数据与风速风向数据转换

匿名 (未验证) 提交于 2019-12-02 21:52:03
package com.qr.util; import java.text.DecimalFormat; /** * //TODO UV数据与风速风向数据转换 */ public class UVAndSD { /** * UV数据计算速度 */ public static double vectorToSpeed(double uMs, double vMs) { double windAbs = Math.sqrt(Math.pow(uMs, 2) + Math.pow(vMs, 2)); return windAbs; } /** * UV数据计算风向 */ public static double vectorToDegrees(double uMs, double vMs) { DecimalFormat df = new DecimalFormat("#.000"); double windAbs = Math.sqrt(Math.pow(uMs, 2) + Math.pow(vMs, 2)); double windDirTrigTo = Math.atan2(uMs / windAbs, vMs / windAbs); double windDirTrigToDegrees = windDirTrigTo * 180 / Math.PI; double