mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 16:51:37 +00:00
fix post slice index
This commit is contained in:
@ -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"
|
||||
/>
|
||||
|
@ -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),
|
||||
|
BIN
public/images/p/object-around-in-threejs/around-cover.jpg
Normal file
BIN
public/images/p/object-around-in-threejs/around-cover.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 356 KiB |
Reference in New Issue
Block a user