fix post slice index

This commit is contained in:
DefectingCat
2022-09-08 03:54:07 +00:00
parent 09a4df9591
commit 078d9abdd2
3 changed files with 11 additions and 5 deletions

View File

@ -4,6 +4,12 @@ date: '2022-09-02'
tags: [Three.js, React]
---
<Image
src="/images/p/object-around-in-threejs/around-cover.jpg"
width="1800"
height="1201"
/>
使一个物体围绕另一个物体运动,主要是保证围绕物体的运动轨迹。在 three.js 中,一个 Mesh 实例可以通过其自身的 `add()` 方法,去添加另一个实例。
通过此方法就可以达成添加一个实例成为另一个实例的子节点。当父节点进行运动时(例如自身旋转),子节点也会跟随运动。
@ -49,7 +55,7 @@ three.scene.add(target);
<Image
src="/images/p/object-around-in-threejs/around.svg"
alt="类型推断"
alt="围绕运动"
width="664"
height="404"
/>

View File

@ -64,7 +64,7 @@ export const getStaticProps: GetStaticProps<{
return {
props: {
posts: posts.slice((page - 1) * PostPerPage, PostPerPage + 1),
posts: posts.slice((page - 1) * PostPerPage, PostPerPage * page),
prev: page - 1,
next: page + 1,
total: Math.ceil(posts.length / PostPerPage),

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 KiB