Computer Graphics Thinking–texture tiling
Here is one question: how to tile texture?
One thing worth to notice: The DirectX and OpenGL stipulate that a texture source(normally a picture)’s texture coordinate is fixed as [0,1], which mean that it’s smallest x and y coordinate is 0, and largest coordinate is 1.
If that’s the situation, how can we tile a texture source?
Can we do it this way?
1 we shrink the texture coordinate
2 and then ma texture to our triangles
Actually, we do it in the opposite way:
1 we enlarge the texture coordinate
2 and then map texture to our triangles
Why?
The key is :
As we mention before, the texture is fixated in range [0,1], and the texture coordinate is map to the whole triangles(like the triangles comprised as a height map), if the texture source was shrinked, like to 0.3, than mean we get [0,0.3] of the texture source map to the whole triangles, which will get the effect as enlarging the texture source.
So we have to do it the oppsite way. For example, if we enlarge the texture to 5 times, we get [0, 5] of the texture source map to the whole triangles, just like we get a whole texture resource map to [0,1], and then if we warp up the texture, we get another same texture map to [2, 3], [3,4],[4,5], so we get the final effect that we tile our texture to our triangles 5 times.
That’s a very confused concept for rookies in computer graphics.
Computer Graphics Thinking–texture tiling的更多相关文章
- Texture tiling and swizzling
Texture tiling and swizzling 原帖地址:http://fgiesen.wordpress.com If you’re working with images in your ...
- Computer Graphics Research Software
Computer Graphics Research Software Helping you avoid re-inventing the wheel since 2009! Last update ...
- Fundamentals of Computer Graphics 中文版(第二版) (Peter Shirley 著)
1 引言 2 数学知识 3 光栅算法 4 信号处理 5 线性代数 6 矩阵变换 7 观察 8 隐藏面消除 9 表面明暗处理 10 光线追踪 11 纹理映射 12 完整的图形流水线 13 图形学的数据结 ...
- How to Start Learning Computer Graphics
Background Input\Output Image Knowledge Image Digital Image Processing Computer Vision Knowledge Com ...
- 水题 HDOJ 4716 A Computer Graphics Problem
题目传送门 /* 水题:看见x是十的倍数就简单了 */ #include <cstdio> #include <iostream> #include <algorithm ...
- Mathematics for Computer Graphics数学在计算机图形学中的应用 [转]
最近严重感觉到数学知识的不足! http://bbs.gameres.com/showthread.asp?threadid=10509 [译]Mathematics for Computer Gra ...
- HDU 4716 A Computer Graphics Problem
A Computer Graphics Problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (J ...
- Mathematics for Computer Graphics
Mathematics for Computer Graphics 最近严重感觉到数学知识的不足! http://bbs.gameres.com/showthread.asp?threadid=105 ...
- Vector Math for 3D Computer Graphics (Bradley Kjell 著)
https://chortle.ccsu.edu/VectorLessons/index.html Chapter0 Points and Lines (已看) Chapter1 Vectors, P ...
随机推荐
- log.sh
#!/bin/echo Warnning, this library must only be sourced! # vim: set expandtab smarttab shiftwidth=4 ...
- Web Server CA证书签名步骤和自签名测试,支持多域名
Web Server支持HTTPS访问需要两个文件,私钥和证书.私钥和证书都放在服务器上,私钥用来加密数据,证书传递给客户端.自己签名的证书在传递给浏览器的时,因为证书不被信任,所以会弹出连接不安全, ...
- 大学生程序猿IT情书“2014爱的告白挑战赛”获奖名单及优秀情书展示系列之 - 【IT术语】情书+【搞笑另类】情书
经过专家评委们的层层精心评选和认真讨论,恭喜下面同学终于入选CSDN高校俱乐部"大学生程序猿IT情书2014爱的告白挑战赛活动"优胜者名单.获奖者将在本周内收到邮件通知.请依照邮件 ...
- POJ 2502 Subway(迪杰斯特拉)
Subway Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6692 Accepted: 2177 Descriptio ...
- api接口、RPC、WebService REST
RPC:所谓的远程过程调用 (面向方法) SOA:所谓的面向服务的架构(面向消息) REST:所谓的 Representational state transfer (面向资源) RPC 即远程过程调 ...
- jquery 中ajax的参数
url: 要求为String类型的参数,(默认为当前页地址)发送请求的地址. type: 要求为String类型的参数,请求方式(post或get)默认为get.注意其他http请求方法,例如put和 ...
- centos7上使用yum安装mysql
centos yum是没有mysql的,集成的是新的Mariadb,怎么用yum的方式在centos7上安装mysql呢? 1. 下载mysql的repo源 wget http://repo.mysq ...
- XAML 名称范围
XAML 名称范围存储 XAML 定义的对象名称和它们的对等实例之间的关系.此概念类似于其他编程语言和技术中的术语名称范围的更广泛的含义. 定义 XAML 名称范围的方式 XAML 名称范围中的名称使 ...
- 关于在Java代码中写Sql语句需要注意的问题
最近做程序,时不时需要自己去手动将sql语句直接写入到Java代码中,写入sql语句时,需要注意几个小问题. 先看我之前写的几句简单的sql语句,自以为没有问题,但是编译直接报错. String st ...
- 拦截Response.Redirect的跳转并转换为Js的跳转
有一个很常见的需求,某个页面需要用户登录才能访问,或者某个操作需要用户登录 这就需要检测用户登录,一般是使用Ajax去检测是否登录,当用户未登录时跳转到登录页面 那么问题来了···· 有的时候我们跳转 ...