V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  ccraohng  ›  全部回复第 9 页 / 共 21 页
回复总数  417
1 ... 5  6  7  8  9  10  11  12  13  14 ... 21  
2021-08-20 17:27:39 +08:00
回复了 17681880207 创建的主题 程序员 Vue3 hooks 的问题
全是模板代码。。。。
antd 的 pro table 设计挺好的。

这种 table 设计,不都是一个模式吗,抽成组件吧
2021-08-20 17:08:07 +08:00
回复了 qnyh 创建的主题 游戏 黑神话悟空发新视频了
@li24361 其它的质量美术也比不上啊。
2021-08-20 17:00:44 +08:00
回复了 qnyh 创建的主题 游戏 黑神话悟空发新视频了
战斗感觉像各打各的,特别是白龙,感觉好尬,为什么要肉搏,腾云驾雾,应该是法师流啊。呼风唤雨
2021-08-07 07:45:10 +08:00
回复了 lux182 创建的主题 程序员 想了解一下有多少人写代码的时候是盲打的
半盲打?闭着眼不行,眼睛余光稍微瞄着
react-spring
2021-08-02 08:21:45 +08:00
回复了 dicc 创建的主题 成都 从来都不觉得没有房子怎么样,反而让我不舒服的是家人的催促
租户在小区或者物业被不公平对待,这点让我很不舒服
2021-06-23 22:12:39 +08:00
回复了 skyrem 创建的主题 程序员 如何以最快速度加载 H5 页面,考虑网络不佳的情况?
全站加速。
就一个键盘,尽量不要用库。
图片用 secset 用 webp 。
加快后端响应
2021-06-21 11:53:41 +08:00
回复了 liudaolunhuibl 创建的主题 成都 成都真的被吹得太过了,一线的同学谨慎回来吧
成都冬天雾霾还大吗
2021-06-18 16:48:15 +08:00
回复了 happyCodings 创建的主题 Vue.js 求大佬们优化一下代码,屎山代码给孩子头皮想破了
function convert() {
const levels = ['province', 'city', 'district'];
const result = {
children: {},
};

data.forEach((item) => {
levels.reduce((map, level) => {
const current = item[level];

if (!map.children) {
map.children = {};
}

map.children[current] = map.children[current] || {
data: {
label: current,
value: level === 'district' ? item.adcode : current,
},
};

return map.children[current];
}, result);
});

const format = (item) => {
if (item.children) {
const children = Object.values(item.children).map((child) => {
return format(child);
});

item.children = children;
}

return item;
};

const root = format(result).children;
console.log(root);
}
convert();
@sillydaddy 没有 “转成”这个概念,我错了。是你发的链接中的 不同解释,老哥可以的话加我 v cmhkaWFuamk=
@sillydaddy

什么行列优先。

我是奇怪 gl-matrix 的写法为何“反着”的,
在 shader 里是
[
1, 0, 0, tx,
0, 1, 0, ty
0, 0, 1, tz,
0, 0, 0, 1
] *
[x,
y,
z,
1]

MDN 上说了 uniformMatrix 是以列优先录入值,即坐标 0 - 3 会被转成 m[0] ( m[0] is the left column of m )

[
1, 0, 0, 0,
0, 1, 0, 0
0, 0, 1, 0,
tz, ty, tz, 1
] 刚好被 转成

[
1, 0, 0, tx,
0, 1, 0, ty
0, 0, 1, tz,
0, 0, 0, 1
]
https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/uniformMatrix

这个方法假定矩阵是列优先。

[
1, 0, 0, tx,
0, 1, 0, ty
0, 0, 1, tz,
0, 0, 0, 1
]

会变成

[
1, 0, 0, 0,
0, 1, 0, 0
0, 0, 1, 0,
tz, ty, tz, 1
]
与正确结果相反,所以 gl-matrix 使用的是

[
1, 0, 0, 0,
0, 1, 0, 0
0, 0, 1, 0,
tz, ty, tz, 1
]
@3dwelcome 抱歉是我举得例子有问题
@3dwelcome 你看下 https://github.com/toji/gl-matrix/blob/master/src/mat4.js#L829 fromTranslation 函数, 变换值是写在 12 13 14 索引上的
@ccraohng 说错了,不是转置矩阵。gl-matrix 的写法使用行优先,位置调换一下?
@3dwelcome

是我的表述问题。
上面手册里定点向量实际为

[x,
y,
z,
1]

它的平移变换矩阵,按照 `uModelMatrix * aVertexPosition` 的写法应该(我的理解)为

```
[
1, 0, 0, tx,
0, 1, 0, ty
0, 0, 1, tz,
0, 0, 0, 1
]
```

但是 gl-matrix 是这样的

```
[
1, 0, 0, 0,
0, 1, 0, 0
0, 0, 1, 0,
tz, ty, tz, 1
]
```


gl-matrix 写法是 T(tx, ty, tz) 的转置矩阵,按照我的理解在 shader 里位置应该调换一下

```
gl_Position = aVertexPosition * uModelMatrix
```

为啥
2021-04-27 10:45:15 +08:00
回复了 DreamTrace 创建的主题 React 关于 react 编程思路的问题
只关心组件自己的状态维护,如果你只是改变子组件的数据,可以改成受控组件。比较复杂的函数操作,比如 `slider.next()`,通过 ref 暴露就行。
2021-04-25 11:33:01 +08:00
回复了 MoriartyCy 创建的主题 职场话题 千万不要随便裸辞,真是血的教训!
这里有个奇怪的现象
1. 说起考公好像能考就能进
2. 出社会后考研就能考上
2021-04-13 09:52:27 +08:00
回复了 w292614191 创建的主题 JavaScript 各位大佬,求一个正则。
假设规则是 去掉重复的 一个大写字母一个数字吧

```js
g = /([A-Z]\d)\1+/g

s = "A1+M2-N2N2+H4H4+G7+H5/J3J3J3J3*PREXM('','','')"

s.replace(g, '$1')

```
2021-04-11 18:20:00 +08:00
回复了 xz 创建的主题 MacBook Air 这个时间可以入 M1 的 MacBook Air 吗?
刚需就买。
不是,你想不买永远有理由,想买就有理由
1 ... 5  6  7  8  9  10  11  12  13  14 ... 21  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5355 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 33ms · UTC 05:52 · PVG 13:52 · LAX 22:52 · JFK 01:52
Developed with CodeLauncher
♥ Do have faith in what you're doing.