理解着色器ma​​t4 * vec4计算 [英] understanding shader mat4 * vec4 calculation

查看:465
本文介绍了理解着色器ma​​t4 * vec4计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以确认以下计算,好吗? :)

can someone confirm following calculation, please? :)

在正常的android OpenGL着色计算:

in normal android opengl shader the computation:

mat4 a;
vec3 p;

vec3 pos = (a * vec4(p,1.0)).xyz;

将被计算如下:

pos.x = a0 * p.x + a1 * p.y + a2 * p.z + a3 * 1.0;
pos.y = a4 * p.x + a5 * p.y + a6 * p.z + a7 * 1.0;
pos.z = a8 * p.x + a9 * p.y + a10 * p.z + a11 * 1.0;

这是正确的?还是我错过了什么?每一个帮助高度AP preciated。

is this correct? or did I miss something? every help is highly appreciated.

推荐答案

因此​​,答案是是的。

So the answer is "yes."

这也可以被分解为三点产品。

This can also be factored as three dot products.

这篇关于理解着色器ma​​t4 * vec4计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆