Skip to content

Commit c615e3e

Browse files
committed
docs: swipe examples translations
1 parent df041a7 commit c615e3e

16 files changed

+286
-303
lines changed

docs/es/examples/basic-animations.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
# Basic Animations
22

3-
This guide will help you get started with basic animations in TresJS.
3+
Esta guía te ayudará a comenzar con animaciones básicas en TresJS.
44

5-
We will build a simple scene with a cube. We will then animate the cube to rotate around the Y and Z axis.
5+
Construiremos una escena simple con un cubo. Luego animaremos el cubo para que rote alrededor del eje Y y Z.
66

77
<SandboxDemo url="https://play.tresjs.org/#eNqVVF1P2zAU/StW9kAZbVI+hTqKOjo0bRofYrwRHkxy2xoc27KdtlD1v+8mTloHBipSH5rjc889vh9eBLcazHelwmkOQS84MYlmyhIDNleEUzHux4E1cXAaC5YpqS1ZEDOhnMvZDYzIkoy0zMgWRm998yiF6pCKKTVtkhu4AZGC/iOlWkUMLFIeTZRI3Qy90g/MDqWwWnLzls5AWGmKiFgkUhhLHuS8sNL3fLVEzvm2x1kQKar0/aahlqO541ZrQVLglrYJcKoMpGS5TfqnZBELQtiItFyycEp5DtsOJpUDB4ZaWmqZFOEz2ek7NczwPu0FHdXJvpJuuFeyl7FYFs5OItcRrD9+WMgUpxbwi5CTdZFJwoHqTiK51NiwL8d7P86Gh3FQlCSVM0MoVxNKZkzgV8ewF6eAGs1qRxVciV+DNgoSy6YwpBloWp8S0lPSsMI/prvbbZO9Njm8jwOPMJJTPDtAFx5ISz3EdxuwQPcIdsMmPCrR3W63u4ZfWbwAMyEaRshz5cVL90xCObgkJKHGdlwZVpFV7Jmc/wSZgdXP6EyPTXWX4od38VJ5yS6lzii/wCZoRrlvJ6oprjvlp2sPAieR17ugHbhx72RUhY9GCly9cpbi6gA3rldPVxz4u1IcxMHEWmV6UZSkAuNxyNhUhwJsJFQW+fTBfngYdqOUGRsVMLLjoP1G2G3VZ7RdBMof+fIV3MxiZ0CfFBWbeF9xBwchjkOlXINhxooYX3uiYSPdgjdAxcNj9LsDJvPLgM8XPgob19ejD3a7ZYFxs2AeZs3qVjycPg3pJ4RdwEfSSOykkLENRGtqcfmD8Cji7MGXrB8bnElr8LEcsfGriUxkphgHfaWKfW9OZvng/i4xq3NY+UsmkDz9B380c2f5GocF9BTLvW4lriBYd3z+9xLm+H91mMk051Vz3jm8ASN5Xnh0tLNcpGjb45Vuf5ULxsT41pzPLQhTX6ph1D4rKNG7er9Xs+aA+7JwJb9sx/CDKq1vth/urwq+/AdyGHHw" />
88

99
## useRenderLoop
1010

11-
The `useRenderLoop` composable is the core of TresJS animations. It allows you to register a callback that will be called every time the renderer updates the scene with the browser's refresh rate.
11+
El composable `useRenderLoop` es el núcleo de las animaciones en TresJS. Te permite registrar una función de devolución de llamada que se ejecutará cada vez que el renderizador actualice la escena con la frecuencia de actualización del navegador.
1212

13-
To see a detailed explanation of how it works, please refer to the [useRenderLoop](/api/composables#userenderloop) documentation.
13+
Para obtener una explicación detallada de cómo funciona, consulta la documentación de [useRenderLoop](/api/composables#userenderloop).
1414

1515
```ts
1616
const { onLoop } = useRenderLoop()
1717

1818
onLoop(({ delta, elapsed }) => {
19-
// I will run at every frame ~ 60FPS (depending of your monitor)
19+
// Se ejecutará en cada fotograma ~ 60FPS (dependiendo de tu monitor)
2020
})
2121
```
2222

23-
## Getting the reference to the cube
23+
## Obteniendo la referencia al cubo
2424

25-
To animate the cube, we need to get a reference to it. We can do it by passing a [Template Ref](https://vuejs.org/guide/essentials/template-refs.html) using `ref` prop to the `TresMesh` component. This will return the THREE instance.
25+
Para animar el cubo, necesitamos obtener una referencia a él. Podemos hacerlo pasando una [Referencia de Plantilla](https://vuejs.org/guide/essentials/template-refs.html) utilizando la propiedad `ref` en el componente `TresMesh`. Esto nos devolverá la instancia de THREE.
2626

27-
To improve the performance, we will use a [Shallow Ref](https://v3.vuejs.org/guide/reactivity-fundamentals.html#shallow-reactivity) to store the reference instead of a regular Ref. See why [here](../advanced/caveats.md#reactivity)
27+
Para mejorar el rendimiento, utilizaremos una [Referencia Superficial](https://v3.vuejs.org/guide/reactivity-fundamentals.html#shallow-reactivity) para almacenar la referencia en lugar de una referencia regular. Puedes ver por qué [aquí](../advanced/caveats.md#reactivity)
2828

2929
```vue
3030
<script setup lang="ts">
@@ -46,9 +46,9 @@ const boxRef: ShallowRef<TresInstance | null> = shallowRef(null)
4646
</template>
4747
```
4848

49-
## Animating the cube
49+
## Animando el cubo
5050

51-
Now that we have a reference to the cube, we can animate it. We will use the `onLoop` callback to update the cube's rotation.
51+
Ahora que tenemos una referencia al cubo, podemos animarlo. Utilizaremos la devolución de llamada `onLoop` para actualizar la rotación del cubo.
5252

5353
```ts
5454
onLoop(({ delta, elapsed }) => {
@@ -59,14 +59,14 @@ onLoop(({ delta, elapsed }) => {
5959
})
6060
```
6161

62-
You can also use the `delta` from the internal [THREE clock](https://threejs.org/docs/?q=clock#api/en/core/Clock) or the `elapsed` to animate the cube.
62+
También puedes usar el `delta` del [reloj interno de THREE](https://threejs.org/docs/?q=clock#api/en/core/Clock) o el `elapsed` para animar el cubo.
6363

64-
## But why not using reactivity?
64+
## ¿Pero por qué no usar la reactividad?
6565

66-
You might be wondering why we are not using reactivity to animate the cube. The answer is simple, performance.
66+
Es posible que te preguntes por qué no estamos usando la reactividad para animar el cubo. La respuesta es simple: rendimiento.
6767

6868
```vue
69-
// This is a bad idea ❌
69+
// Esto es una mala idea ❌
7070
<script setup lang="ts">
7171
import { TresCanvas } from '@tresjs/core'
7272
@@ -79,11 +79,11 @@ onLoop(({ delta, elapsed }) => {
7979
</script>
8080
```
8181

82-
We can be tempted to use reactivity to animate the cube. But it would be a bad idea.
83-
The reason is that [Vue's reactivity is based on Proxies](https://vuejs.org/guide/extras/reactivity-in-depth.html#how-reactivity-works-in-vue) and it's not designed to be used in a render loop that updates 60 or more times per second.
82+
Podemos sentirnos tentados a usar la reactividad para animar el cubo. Pero sería una mala idea.
83+
La razón es que [la reactividad de Vue se basa en Proxies](https://vuejs.org/guide/extras/reactivity-in-depth.html#how-reactivity-works-in-vue) y no está diseñada para ser utilizada en un bucle de renderizado que se actualiza 60 o más veces por segundo.
8484

85-
The embedded page below shows the [benchmark of a proxy vs a regular object](https://measurethat.net/Benchmarks/Show/12503/0/object-vs-proxy-vs-proxy-setter). As you can see, the proxy is 5 times slower than the regular object.
85+
La página incrustada a continuación muestra la [prueba de rendimiento de un proxy frente a un objeto regular](https://measurethat.net/Benchmarks/Show/12503/0/object-vs-proxy-vs-proxy-setter). Como puedes ver, el proxy es 5 veces más lento que el objeto regular.
8686

8787
<EmbedExperiment src="https://measurethat.net/Embed?id=399142" />
8888

89-
You can read more about this in the [Caveats](../advanced/caveats.md#reactivity) section.
89+
Puedes leer más sobre esto en la sección de [Caveats](../advanced/caveats.md#reactivity).

docs/es/examples/groups.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Group
1+
# Grupo
22

3-
A `<TresGroup>` is an instance of the [THREE.Group](https://threejs.org/docs/#api/en/objects/Group) class which is almost the same as a [THREE.Object3D](https://threejs.org/docs/#api/en/objects/Object3D) but allows you to **group together multiple objects in the scene** so that they can be manipulated as a single unit (transform, rotation, etc).
3+
Un `<TresGroup>` es una instancia de la clase [THREE.Group](https://threejs.org/docs/#api/en/objects/Group) que es casi lo mismo que un [THREE.Object3D](https://threejs.org/docs/#api/en/objects/Object3D) pero te permite **agrupar varios objetos en la escena** para que puedan ser manipulados como una unidad única (transformación, rotación, etc).
44

5-
## Usage
5+
## Uso
66

77
```vue{13,22}
88
<script setup lang="ts">

docs/es/examples/lights-shadows.md

+26-25
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
# Light-shadows
1+
# Luces y sombras
22

3-
This guide will help you get started with simple light and shadows in TresJS.
3+
Esta guía te ayudará a comenzar con luces y sombras simples en TresJS.
4+
5+
Construiremos una escena simple con tres mallas y un plano, pero solo dos tendrán sombras.
46

5-
We will build a simple scene with three meshes and a plane but only two will have shadows.
67
<SandboxDemo url="https://play.t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n0FuqiXAW97vEyOrm8NPuxGrsA47WEbFM3qljhsIAXZC4h9wHPUCOxkULAjSCuoTf48eBPmbFanrO467Emj8ZKds8WDjkxFIVkO6qe03d/sTHdHf3O23U8IF7OE9M8B+43eeslX2Cyg1lju/VHiZADj3Z8mP2CLzztnIbJVXh7OE85r0CJfWY0eNlrxDGXXcE7tV/eC4Q+Pqf60dW9umVRDqMFfO876q5pJu17zht+ucA7vjmP8TJX2mfWC3q7g9/8AWlN6bg==" />
78

8-
## Setting up the scene (optional)
9+
## Configurando la escena (opcional)
910

10-
We import all the modules that we need, for comfort we can use the orbit-controls from cientos,
11-
[check here to know how](/examples/orbit-controls).
11+
Importamos todos los módulos que necesitamos, para mayor comodidad podemos usar orbit-controls de cientos,
12+
[ver aquí para saber cómo](/examples/orbit-controls).
1213

13-
Let's put four objects in our scene, one will be the plane that receive shadows, two of them will cast shadows and the last one will not cast any shadow at all.
14+
Coloquemos cuatro objetos en nuestra escena, uno será el plano que recibirá sombras, dos de ellos proyectarán sombras y el último no proyectará ninguna sombra en absoluto.
1415

15-
I'm going to use [MeshToonMaterial](https://threejs.org/docs/index.html?q=toon#api/en/materials/MeshToonMaterial). Simply because we can see the "soft shadow" easily.
16+
Voy a usar [MeshToonMaterial](https://threejs.org/docs/index.html?q=toon#api/en/materials/MeshToonMaterial). Simplemente porque podemos ver fácilmente el "sobreado suave".
1617

1718
```vue
1819
<script setup lang="ts">
@@ -58,27 +59,27 @@ import { OrbitControls } from '@tresjs/cientos'
5859
</template>
5960
```
6061

61-
## Lights (explanation)
62+
## Luces (explicación)
6263

63-
As you know every instance in [ThreeJs](https://threejs.org/) is available in **TresJs** so are all the light types, we just need to add the `Tres` prefix to use them.
64+
Como sabes, cada instancia en [ThreeJs](https://threejs.org/) está disponible en **TresJs**, por lo que todos los tipos de luces también están disponibles, solo necesitamos agregar el prefijo `Tres` para usarlos.
6465

65-
But not all lights can cast shadows, this definition comes directly from ThreeJs and makes sense, for example the purpose of an [ambientLight](https://threejs.org/docs/index.html?q=ambient#api/en/lights/AmbientLight) is to iluminate everysingle side of your scene, so it makes no sense for it to cast shadows, on the contrary, a [DirectionalLight](https://threejs.org/docs/index.html?q=light#api/en/helpers/DirectionalLightHelper) immitating the sun can and should cast shadows.
66+
Pero no todas las luces pueden generar sombras, esta definición proviene directamente de ThreeJs y tiene sentido. Por ejemplo, el propósito de una [ambientLight](https://threejs.org/docs/index.html?q=ambient#api/en/lights/AmbientLight) es iluminar todos los lados de tu escena, por lo que no tiene sentido que genere sombras. En cambio, una [DirectionalLight](https://threejs.org/docs/index.html?q=light#api/en/helpers/DirectionalLightHelper) que imita al sol puede y debe generar sombras.
6667

67-
## Shadows (explanation)
68+
## Sombras (explicación)
6869

69-
There are also many types of shadows, for example the "soft shadow" is generated automatially when an object receives more light from one side, but in summary a "ThreeJS default shadow" that is directed towards another surface needs to be cast by a mesh and another mesh needs to receive it. As we see in our example, the `Plane` is receiving a shadow but not casting it. Please note that not all materials can cast or receive shadows.
70+
También existen muchos tipos de sombras, por ejemplo, la "sombra suave" se genera automáticamente cuando un objeto recibe más luz de un lado, pero en resumen, una "sombra predeterminada de ThreeJS" que se dirige hacia otra superficie debe ser proyectada por una malla y otra malla debe recibirla. Como vemos en nuestro ejemplo, el `Plano` está recibiendo una sombra pero no la está proyectando. Ten en cuenta que no todos los materiales pueden proyectar o recibir sombras.
7071

71-
Internally, ThreeJS automatically generates a new mesh with a [ShadowMaterial](https://threejs.org/docs/index.html?q=shado#api/en/materials/ShadowMaterial) which gets updated in each frame, that is why if you apply animations, the shadow also is animated, but also why you have to use shadows carefully, because they could slow your performance down.
72+
Internamente, ThreeJS genera automáticamente una nueva malla con un [ShadowMaterial](https://threejs.org/docs/index.html?q=shado#api/en/materials/ShadowMaterial) que se actualiza en cada fotograma, por eso si aplicas animaciones, la sombra también se anima, pero también es por eso que debes usar las sombras con cuidado, ya que pueden ralentizar el rendimiento.
7273

7374
::: warning
74-
The overuse of shadows in this way could drop your performance. However, there are ways to increase your performance, for more information please check out [this video](https://youtu.be/WGNvVGrS0kY?si=q7XyL5eABKUh3gbS&t=1256)
75+
El uso excesivo de sombras de esta manera puede afectar el rendimiento. Sin embargo, existen formas de mejorar el rendimiento. Para obtener más información, consulta [este video](https://youtu.be/WGNvVGrS0kY?si=q7XyL5eABKUh3gbS&t=1256)
7576
:::
7677

77-
## Enabling shadows
78+
## Habilitando las sombras
7879

79-
We could divide this into three steps:
80+
Podemos dividir esto en tres pasos:
8081

81-
### Activate shadows on the renderer
82+
### Activar las sombras en el renderizador
8283

8384
```vue
8485
//...
@@ -92,11 +93,11 @@ We could divide this into three steps:
9293
//...
9394
</template>
9495
```
95-
### Set the light to cast shadows
96+
### Configurar la luz para proyectar sombras
9697

97-
We can simple put the boolean `cast-shadow`, Vue understand this as a `prop` with `true` value
98+
Podemos simplemente agregar el booleano `cast-shadow`, Vue lo interpreta como una `prop` con valor `true`.
9899

99-
_The AmbientLight doesn't generate any type of shadow here_
100+
_La luz ambiental no genera ningún tipo de sombra aquí_
100101

101102
```vue
102103
//...
@@ -112,9 +113,9 @@ _The AmbientLight doesn't generate any type of shadow here_
112113
//...
113114
</template>
114115
```
115-
### Set the objects to cast or receive shadows
116+
### Establecer los objetos para proyectar o recibir sombras
116117

117-
Similarly to the previous step, we set the mesh that we want to cast shadow (our sphere) with the `cast-shadow` prop, and set the object to receive shadow (our plane) with the `receive-shadow` prop.
118+
De manera similar al paso anterior, configuramos la malla que queremos que proyecte sombra (nuestra esfera) con la propiedad `cast-shadow`, y configuramos el objeto para recibir sombra (nuestro plano) con la propiedad `receive-shadow`.
118119

119120
```vue
120121
//...
@@ -139,7 +140,7 @@ Similarly to the previous step, we set the mesh that we want to cast shadow (our
139140
</template>
140141
```
141142

142-
Now we have all the necessary steps to add shadows to our scene, and if we apply what we learned in [basic animations](/examples/basic-animations), and we add movement to our cube, you will see the shadow is animated as well 🤩
143+
Ahora tenemos todos los pasos necesarios para agregar sombras a nuestra escena, y si aplicamos lo que aprendimos en [animaciones básicas](/examples/basic-animations), y agregamos movimiento a nuestro cubo, verás que la sombra también se anima 🤩
143144

144145
```vue
145146
<script setup>
@@ -171,4 +172,4 @@ onLoop(() => {
171172
</template>
172173
```
173174

174-
_Note that I intentionally did not apply `cast-shadow` to the `Cone` so it doesn't cast any shadow_
175+
_Nota que intencionalmente no apliqué `cast-shadow` al `Cone` para que no proyecte ninguna sombra_

0 commit comments

Comments
 (0)