安静如鸡

  • Home
  • About Me
  • Contact Me
  • 东京女子篮球活动记录
一个博客
Tech

Unity中的相机投影矩阵以及推导

为什么突然想起写这个 很多讲Unity渲染,Shader等等的文章或者书里都会提到相机投影,因为渲染管线里比较重要的一环就是如何把一个object投影到View上。大部分时候这个Matrix都是直接给出来的,或者简单两句解释。我看的似懂非懂,所以找了一些资料想来详细看看如何证明的。 准备工作 准备工作自然是线性代数,最重要的一个知识是线性代数。首先复习下面的两个知识点 关于1,我们先在平面坐标系,也就是二维空间看几个经典变换。 平面缩放矩阵 如果我们想要把一个平面图形缩放,缩放矩阵很容易写出来。 (x′y′)=(s…

2026-08-14 0条评论 0人点赞 阅读全文
Leetcode

15. 3Sum

Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0. Notice that the solution set must not contain duplicate triplets. Example…

2026-08-05 0条评论 0人点赞 阅读全文
Leetcode

628. Maximum Product of Three Numbers

题干: Given an integer array nums, find three numbers whose product is maximum and return the maximum product. Example 1: Input: nums = [1,2,3] Output: 6 Example 2: Input: nums = [1,2,3,4] Output: 24 Example 3: Input: nums = [-1,-2,-3] Output: -6 Const…

2026-07-27 0条评论 0人点赞 阅读全文
Leetcode

2. Add Two Numbers

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list. You may assum…

2026-07-27 0条评论 0人点赞 阅读全文
Leetcode

1. Two Sum

这个题过于经典,是个easy题型,但是因为在3sum之前想复习一下所以先写一下思路。 首先这个followup看完就知道一开始肯定是有brute force解法的,两次for循环找到相加为target的就直接返回 现在我们看看如何能够不用两个for-loop。 首先就是我们需要找到两个数相加 = target,但是其实我们也可以反向想一下,只要找到一个数 = target - 另一个数就可以了 比较简单的想法是我们循环两次,第一次保存target-nums[i],第二次循环来寻找数列是否有一个数 = target-…

2026-07-14 0条评论 0人点赞 阅读全文
Leetcode

11. Container with most water

题解思路 这道题一开始肯定想到的思路是 Brute Force。 即循环两次,固定 end,然后让 i 从 0 遍历到 end-1,寻找最大的 Area。 面积计算公式为:Area=(end−i)×min⁡(height[i],height[end])Area=(end-i)\times\min(height[i],height[end]) 但是如此计算肯定会造成不必要的重复计算。 例如,如果 height[i]>height[i+1]height[i] > height[i+1] 那么继续向右移动 i…

2026-07-14 0条评论 0人点赞 阅读全文
Leetcode

88. Merge Sorted Array

88. Merge Sorted Array 这个题主要是要在num1上做一个in-place的替换,也就是说,题目不想让你去添加新的参数等等。 官方solution有个挺不人道的解法是: 这个确实没错,但是明显不是面试官要的,因为很明显一个非降序的数列不需要再排序一次了,且排序的时间复杂度达到了 O((n+m)log(n+m)) 第二种解法就是增加一个变量,拷贝nums1前m个数,然后用two pointer。分别给nums1和nums2各自一个pointer记录index,分别比对大小。 这样时间复杂…

2026-07-09 0条评论 0人点赞 阅读全文
Tech

Ubuntu 18 → 22 升级实录

升级的原因是因为要回国呆一段时间,想装个wireguard 搞下VPN。但是wireguard的自动化脚本不支持旧版的ubuntu所以就开始着手升级。(话说18也是够老的了。。。) 升级前的准备 备份文件 备份数据库 1️⃣ 第一阶段:18.04 → 20.04 执行上面指令直接完成升级 2️⃣ 第二阶段:20.04 → 22.04 这次执行完之后报下面错误 似乎是系统在用手动安装的 Python(3.9)而apt 依赖系统 Python(3.8) 搜了一下Stackoverflow下面指令可以修复 但是chatg…

2026-04-29 0条评论 0人点赞 阅读全文
Tech

MacOS Xcode上的Vulkan开发环境

https://vulkan-tutorial.com/Development_environment 基本上是按照教程来的,唯一的不同点是,header和library的search path。 在MacOS15上homebrew的路径不是/usr/local而是/opt/homebrew。 所以header search的path是/opt/homebrew/include,而library的path是opt/homebrew/lib 其他部分完全一致。

2025-08-21 0条评论 0人点赞 阅读全文
Tech

Memory profiler和Profiler API对应部分

Unity提供Profiler的API可以用在脚本里,runtime检测一些基础数据。 比如下面几个API:Profiler.GetTotalAllocatedMemoryLongProfiler.GetTotalReservedMemoryLongProfiler.GetTotalUnusedReservedMemoryLong 他们分别对应的是memory profiler里的All Of Memory > Native > Allocated columns (除去reserved的部分)All …

2025-08-13 0条评论 0人点赞 阅读全文
12345

Ellison

什么都懂点,什么都不精。属于混吃等死,享受生活,过一天算一天的享乐主义。喜欢电影,阅读,以及游戏和美食。

  • Leetcode
  • Tech
  • Unity
  • 写点东西
  • 呆驼
  • 小工具
  • 2026 年 8 月
  • 2026 年 7 月
  • 2026 年 4 月
  • 2025 年 8 月
  • 2025 年 3 月
  • 2024 年 8 月
  • 2024 年 7 月
  • 2024 年 5 月
  • 2024 年 4 月
  • 2024 年 3 月
  • 2024 年 1 月
  • 2023 年 10 月
  • 2023 年 9 月
  • 2023 年 6 月
  • 2023 年 5 月
  • 2023 年 4 月
  • 2023 年 3 月
  • 2022 年 12 月
  • 2022 年 11 月
  • 2022 年 10 月
  • 2022 年 9 月
  • 2022 年 4 月
  • 2021 年 6 月
  • 2021 年 5 月
最新 热点 随机
最新 热点 随机
Unity中的相机投影矩阵以及推导 15. 3Sum 628. Maximum Product of Three Numbers 2. Add Two Numbers 1. Two Sum 11. Container with most water
2. Add Two Numbers628. Maximum Product of Three Numbers15. 3SumUnity中的相机投影矩阵以及推导
【Unity小贴士】取得一个Texture的四个顶点在WorldSpace的Position Unity中的相机投影矩阵以及推导 【Unity小贴士】Motion Vector 11. Container with most water Fix You (四) 【WIP】URP Scriptable Renderer Feature

COPYRIGHT © 2024 安静如鸡. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang