Skip to content

Commit df041a7

Browse files
committed
docs: translated missing composable page
1 parent c77cb66 commit df041a7

File tree

2 files changed

+56
-56
lines changed

2 files changed

+56
-56
lines changed

docs/es/api/composables.md

+54-54
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
La API de Composición de Vue 3 [Composition API](https://vuejs.org/guide/extras/composition-api-faq.html#what-is-composition-api) te permite crear lógica reutilizable que se puede compartir entre componentes. También te permite crear hooks personalizados que se pueden utilizar en tus componentes.
44

5-
**TresJS** aprovecha al máximo esta API para crear un conjunto de funciones componibles que se pueden utilizar para crear animaciones, interactuar con la escena y más. También te permite crear escenas más complejas que podrían no ser posibles utilizando solo los Componentes de Vue (Texturas, Cargadores, etc.).
5+
**TresJS** aprovecha al máximo esta API para crear un conjunto de funciones composables que se pueden utilizar para crear animaciones, interactuar con la escena y más. También te permite crear escenas más complejas que podrían no ser posibles utilizando solo los Componentes de Vue (Texturas, Cargadores, etc.).
66

7-
El núcleo de **TresJS** utiliza estos componibles internamente, por lo que estarías utilizando la misma API que utiliza el núcleo. Por ejemplo, los componentes que necesitan actualizarse en el bucle de renderizado interno utilizan el componible `useRenderLoop` para registrar un callback que se llamará cada vez que el renderizador actualice la escena.
7+
El núcleo de **TresJS** utiliza estos composables internamente, por lo que estarías utilizando la misma API que utiliza el núcleo. Por ejemplo, los componentes que necesitan actualizarse en el bucle de renderizado interno utilizan el composable `useRenderLoop` para registrar un callback que se llamará cada vez que el renderizador actualice la escena.
88

99
## useRenderLoop
1010

11-
El componible `useRenderLoop` es el núcleo de las animaciones en **TresJS**. Te permite registrar un callback que se llamará en la frecuencia de actualización nativa. Este es el componible más importante en **TresJS**.
11+
El composable `useRenderLoop` es el núcleo de las animaciones en **TresJS**. Te permite registrar un callback que se llamará en la frecuencia de actualización nativa. Este es el composable más importante en **TresJS**.
1212

1313
```ts
1414
const { onLoop, resume } = useRenderLoop()
@@ -19,49 +19,49 @@ onLoop(({ delta, elapsed, clock, dt }) => {
1919
```
2020

2121
::: warning
22-
Be mindfull of the performance implications of using this composable. It will run at every frame, so if you have a lot of logic in your callback, it might impact the performance of your app. Specially if you are updating reactive states or references.
22+
Ten en cuenta las implicaciones de rendimiento al usar este composable. Se ejecutará en cada fotograma, por lo que si tienes mucha lógica en tu callback, podría afectar el rendimiento de tu aplicación. Especialmente si estás actualizando estados o referencias reactivas.
2323
:::
2424

25-
The `onLoop` callback receives an object with the following properties based on the [THREE clock](https://threejs.org/docs/?q=clock#api/en/core/Clock):
25+
El callback `onLoop` recibe un objeto con las siguientes propiedades basadas en el [reloj de THREE](https://threejs.org/docs/?q=clock#api/en/core/Clock):
2626

27-
- `delta`: The delta time between the current and the last frame. This is the time in seconds since the last frame.
28-
- `elapsed`: The elapsed time since the start of the render loop.
27+
- `delta`: El tiempo transcurrido entre el fotograma actual y el último fotograma. Este es el tiempo en segundos desde el último fotograma.
28+
- `elapsed`: El tiempo transcurrido desde el inicio del bucle de renderizado.
2929

30-
This composable is based on `useRafFn` from [vueuse](https://vueuse.org/core/useRafFn/). Thanks to [@wheatjs](https://github.com/orgs/Tresjs/people/wheatjs) for the amazing contribution.
30+
Este composable se basa en `useRafFn` de [vueuse](https://vueuse.org/core/useRafFn/). Gracias a [@wheatjs](https://github.com/orgs/Tresjs/people/wheatjs) por la increíble contribución.
3131

32-
### Before and after render
32+
### Antes y después de renderizar
3333

34-
You can also register a callback that will be called before and after the renderer updates the scene. This is useful if you add a profiler to measure the FPS for example.
34+
También puedes registrar un callback que se llamará antes y después de que el renderizador actualice la escena. Esto es útil si agregas un perfilador para medir los FPS, por ejemplo.
3535

3636
```ts
3737
const { onBeforeLoop, onAfterLoop } = useRenderLoop()
3838

3939
onBeforeLoop(({ delta, elapsed }) => {
40-
// I will run before the renderer updates the scene
40+
// Se ejecutara antes del renderizado de la escena
4141
fps.begin()
4242
})
4343

4444
onAfterLoop(({ delta, elapsed }) => {
45-
// I will run after the renderer updates the scene
45+
// Se ejecutara después del renderizado de la escena
4646
fps.end()
4747
})
4848
```
4949

50-
### Pause and resume
50+
### Pausar y reanudar
5151

52-
You can pause and resume the render loop using the exposed `pause` and `resume` methods.
52+
Puedes pausar y reanudar el bucle de renderizado utilizando los métodos `pause` y `resume` expuestos.
5353

5454
```ts
5555
const { pause, resume } = useRenderLoop()
5656

57-
// Pause the render loop
57+
// Pausa el bucle de renderizado
5858
pause()
5959

60-
// Resume the render loop
60+
// Reanuda el bucle de renderizado
6161
resume()
6262
```
6363

64-
Also you can get the active state of the render loop using the `isActive` property.
64+
También puedes obtener el estado activo del bucle de renderizado utilizando la propiedad `isActive`.
6565

6666
```ts
6767
const { resume, isActive } = useRenderLoop()
@@ -75,15 +75,15 @@ console.log(isActive) // true
7575

7676
## useLoader
7777

78-
The `useLoader` composable allows you to load assets using the [THREE.js loaders](https://threejs.org/docs/#manual/en/introduction/Loading-3D-models). It returns a promise with loaded asset.
78+
El composable `useLoader` te permite cargar recursos utilizando los [cargadores de THREE.js](https://threejs.org/docs/#manual/en/introduction/Loading-3D-models). Retorna una promesa con el recurso cargado.
7979

8080
```ts
8181
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader'
8282

8383
const { scene } = await useLoader(THREE.GLTFLoader, 'path/to/asset.gltf')
8484
```
8585

86-
Since the `useLoader` composable returns a promise, you can use it with `async/await` or `then/catch`. If you are using it on a component make sure you wrap it with a `Suspense` component. See [Suspense](https://vuejs.org/guide/built-ins/suspense.html#suspense) for more information.
86+
Dado que el composable `useLoader` devuelve una promesa, puedes usarlo con `async/await` o `then/catch`. Si lo estás utilizando en un componente, asegúrate de envolverlo con un componente `Suspense`. Consulta [Suspense](https://vuejs.org/guide/built-ins/suspense.html#suspense) para obtener más información.
8787

8888
```vue
8989
<template>
@@ -95,24 +95,24 @@ Since the `useLoader` composable returns a promise, you can use it with `async/a
9595

9696
## useTexture
9797

98-
The `useTexture` composable allows you to load textures using the [THREE.js texture loader](https://threejs.org/docs/#api/en/loaders/TextureLoader). It returns a promise with the loaded texture(s).
98+
El composable `useTexture` te permite cargar texturas utilizando el [cargador de texturas de THREE.js](https://threejs.org/docs/#api/en/loaders/TextureLoader). Retorna una promesa con la(s) textura(s) cargada(s).
9999

100100
```ts
101101
const texture = await useTexture(['path/to/texture.png'])
102102
```
103103

104-
**useTexture** also accepts an object with the following properties:
104+
**useTexture** también acepta un objeto con las siguientes propiedades:
105105

106-
- `map`: a basic texture that is applied to the surface of an object
107-
- `displacementMap`: a texture that is used to add bumps or indentations to the object's surface
108-
- `normalMap`: a texture that is used to add surface detail to and variations in shading to the object
109-
- `roughnessMap`: a texture that is used to add roughness or a matte finish to the object's surface
110-
- `metalnessMap`: a texture that is used to add a metallic effect to the object's surface
111-
- `aoMap`: a texture that is used to add ambient occlusion (shading in areas where light is blocked by other objects) to the object.
112-
- `alphaMap`: a texture that is used to add alpha (the black part render as transparent) to the object. It's necessary to set :trasparent="true" on the material to use this map
113-
- `matcap`: this textures encodes the material color and shading.
106+
- `map`: una textura básica que se aplica a la superficie de un objeto
107+
- `displacementMap`: una textura que se utiliza para agregar protuberancias o indentaciones a la superficie del objeto
108+
- `normalMap`: una textura que se utiliza para agregar detalles de superficie y variaciones en el sombreado al objeto
109+
- `roughnessMap`: una textura que se utiliza para agregar rugosidad o un acabado mate a la superficie del objeto
110+
- `metalnessMap`: una textura que se utiliza para agregar un efecto metálico a la superficie del objeto
111+
- `aoMap`: una textura que se utiliza para agregar oclusión ambiental (sombreado en áreas donde la luz es bloqueada por otros objetos) al objeto.
112+
- `alphaMap`: una textura que se utiliza para agregar transparencia (la parte negra se renderiza como transparente) al objeto. Es necesario establecer :transparent="true" en el material para usar este mapa.
113+
- `matcap`: esta textura codifica el color y el sombreado del material.
114114

115-
In that case it will return an object with the loaded textures.
115+
En ese caso, devolverá un objeto con las texturas cargadas.
116116

117117
```ts
118118
const { map, displacementMap, normalMap, roughnessMap, metalnessMap, aoMap, alphaMap, matcap } = await useTexture({
@@ -127,7 +127,7 @@ const { map, displacementMap, normalMap, roughnessMap, metalnessMap, aoMap, alph
127127
})
128128
```
129129

130-
Then you can bind the textures to the material.
130+
Luego puedes vincular las texturas al material.
131131

132132
```vue
133133
<template>
@@ -148,23 +148,23 @@ Then you can bind the textures to the material.
148148
</template>
149149
```
150150

151-
Similar to above composable, the `useTexture` composable returns a promise, you can use it with `async/await` or `then/catch`. If you are using it on a component make sure you wrap it with a `Suspense` component.
151+
Similar al composable anterior, el composable `useTexture` devuelve una promesa, puedes usarlo con `async/await` o `then/catch`. Si lo estás utilizando en un componente, asegúrate de envolverlo con un componente `Suspense`.
152152

153153
## useSeek
154154

155-
The `useSeek` composable provides utilities to easily traverse and navigate through complex ThreeJS scenes and object children graphs. It exports 4 functions which allow you to find child objects based on specific properties.
155+
El composable `useSeek` proporciona utilidades para recorrer y navegar fácilmente a través de escenas y gráficos de objetos complejos de ThreeJS. Exporta 4 funciones que te permiten encontrar objetos secundarios basados en propiedades específicas.
156156

157157
```ts
158158
const { seek, seekByName, seekAll, seekAllByName } = useSeek()
159159
```
160160

161-
The seek function accepts three parameters:
161+
La función `seek` acepta tres parámetros:
162162

163-
- `parent`: A ThreeJS scene or Object3D.
164-
- `property`: The property to be used in the search condition.
165-
- `value`: The value of the property to match.
163+
- `parent`: Una escena ThreeJS u Object3D.
164+
- `property`: La propiedad que se utilizará en la condición de búsqueda.
165+
- `value`: El valor de la propiedad a coincidir.
166166

167-
The `seek` and `seekByName` function traverses the object and returns the child object with the specified property and value. If no child with the given property and value is found, it returns null and logs a warning.
167+
La función `seek` y `seekByName` recorren el objeto y devuelven el objeto hijo con la propiedad y valor especificados. Si no se encuentra ningún hijo con la propiedad y valor dados, devuelve null y registra una advertencia.
168168

169169
```ts
170170
const carRef = ref(null)
@@ -179,7 +179,7 @@ watch(carRef, ({ model }) => {
179179
})
180180
```
181181

182-
Similarly, the `seekAll` and `seekAllByName` functions return an array of child objects whose property includes the given value. If no matches are found, then they return an empty array and a warning is logged.
182+
De manera similar, las funciones `seekAll` y `seekAllByName` devuelven un array de objetos secundarios cuya propiedad incluye el valor dado. Si no se encuentran coincidencias, devuelven un array vacío y se registra una advertencia.
183183

184184
```ts
185185
const character = ref(null)
@@ -192,15 +192,15 @@ watch(character, ({ model }) => {
192192
```
193193

194194
## useTresContext
195-
This composable aims to provide access to the state model which contains multiple useful properties.
195+
Este composable tiene como objetivo proporcionar acceso al modelo de estado que contiene múltiples propiedades útiles.
196196

197197
```ts
198198
const { camera, renderer, camera, cameras } = useTresContext()
199199

200200
```
201201

202202
::: warning
203-
`useTresContext` can be only be used inside of a `TresCanvas` since `TresCanvas` acts as the provider for the context data. Use [the context exposed by TresCanvas](tres-canvas#exposed-public-properties) if you find yourself needing it in parent components of TresCanvas.
203+
`useTresContext` solo puede ser utilizado dentro de un `TresCanvas`, ya que `TresCanvas` actúa como el proveedor de los datos de contexto. Utiliza [el contexto expuesto por TresCanvas](tres-canvas#propiedades-públicas-expuestas) si necesitas acceder a él en componentes superiores a TresCanvas.
204204
:::
205205

206206
```vue
@@ -219,18 +219,18 @@ const context = useTresContext()
219219
</script>
220220
```
221221

222-
### Properties of context
223-
| Property | Description |
222+
### Propiedades del contexto
223+
| Propiedad | Descripción |
224224
| --- | --- |
225-
| **camera** | the currently active camera |
226-
| **cameras** | the cameras that exist in the scene |
227-
| **controls** | the controls of your scene |
228-
| **deregisterCamera** | a method to deregister a camera. This is only required if you manually create a camera. Cameras in the template are deregistered automatically. |
229-
| **extend** | Extends the component catalogue. See [extending](/advanced/extending) |
230-
| **raycaster** | the global raycaster used for pointer events |
231-
| **registerCamera** | a method to register a camera. This is only required if you manually create a camera. Cameras in the template are registered automatically. |
232-
| **renderer** | the [WebGLRenderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer) of your scene |
233-
| **scene** | the [scene](https://threejs.org/docs/?q=sce#api/en/scenes/Scene). |
234-
| **setCameraActive** | a method to set a camera active |
235-
| **sizes** | contains width, height and aspect ratio of your canvas |
225+
| **camera** | la cámara actualmente activa |
226+
| **cameras** | las cámaras que existen en la escena |
227+
| **controls** | los controles de tu escena |
228+
| **deregisterCamera** | un método para cancelar el registro de una cámara. Esto solo es necesario si creas una cámara manualmente. Las cámaras en la plantilla se registran automáticamente. |
229+
| **extend** | Extiende el catálogo de componentes. Ver [extending](/advanced/extending) |
230+
| **raycaster** | el raycaster global utilizado para eventos de puntero |
231+
| **registerCamera** | un método para registrar una cámara. Esto solo es necesario si creas una cámara manualmente. Las cámaras en la plantilla se registran automáticamente. |
232+
| **renderer** | el [WebGLRenderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer) de tu escena |
233+
| **scene** | la [escena](https://threejs.org/docs/?q=sce#api/en/scenes/Scene) |
234+
| **setCameraActive** | un método para establecer una cámara activa |
235+
| **sizes** | contiene el ancho, alto y relación de aspecto de tu lienzo |
236236

docs/es/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ hero:
1414
actions:
1515
- theme: brand
1616
text: Empezar
17-
link: /guide/
17+
link: /es/guide/
1818
- theme: alt
1919
text: ¿Por qué Tres?
20-
link: /guide/#motivation
20+
link: /es/guide/#motivation
2121

2222
features:
2323
- icon: 💡

0 commit comments

Comments
 (0)