# 3D效果实现

目前在Android原生开发环境下，实现了基于**双目视差**的**伪3D效果**，基本原理是让左右布局中相同位置的View，**左边**布局的view**向右**偏移，**右边**布局的view**向左**偏移，从而产生视差，不同的偏移值会产生不同的景深感觉，合目后形成3D视觉效果。SDK提供了**make3DEffect**() 和**make3DEffectForSide**()，来实现该功能。

```kotlin
// 同时设置左右两个View
make3DEffect(left.slideView, right.slideView, true, 10f)
// 左右两边分别单独调用
make3DEffectForSide(this.ivSelectHover, isLeft, true)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rayneo.gitbook.io/rayneo-devdoc/x-xi-lie/android-kai-fa/neng-li-jie-shao/3d-xiao-guo-shi-xian.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
