You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**TresJS**components emit pointer events when they are interacted with. This is the case for the components that represent three.js classes that derive from [THREE.Object3D](https://threejs.org/docs/index.html?q=object#api/en/core/Object3D) (like meshes, groups,...).
3
+
**TresJS**los componentes emiten eventos de puntero cuando se interactúa con ellos. Esto es válido para los componentes que representan clases de three.js que derivan de [THREE.Object3D](https://threejs.org/docs/index.html?q=object#api/en/core/Object3D) (como mallas, grupos, ...).
4
4
5
5
<StackBlitzEmbedproject-id="tresjs-events" />
6
6
@@ -15,13 +15,13 @@
15
15
/>
16
16
```
17
17
18
-
| Event |fires when ... | Event Handler Parameter Type(s)|
18
+
| Event |se dispara cuando ... | Tipo(s) de parámetro del controlador de eventos|
| click | ... the events pointerdown and pointerup fired on the same object one after the other|[Intersection](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/three/src/core/Raycaster.d.ts#L16), [PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent)|
21
-
| pointer-move | ... the pointer is moving above the object|[Intersection](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/three/src/core/Raycaster.d.ts#L16), [PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent)|
22
-
| pointer-enter | ... the pointer is entering the object|[Intersection](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/three/src/core/Raycaster.d.ts#L16), [PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent)|
23
-
| pointer-leave | ... the pointer is leaves the object|[PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent)|
20
+
| click | ... los eventos pointerdown y pointerup se disparan en el mismo objeto uno tras otro|[Intersection](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/three/src/core/Raycaster.d.ts#L16), [PointerEvent](https://developer.mozilla.org/es/docs/Web/API/PointerEvent)|
21
+
| pointer-move | ... el puntero se mueve sobre el objeto|[Intersection](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/three/src/core/Raycaster.d.ts#L16), [PointerEvent](https://developer.mozilla.org/es/docs/Web/API/PointerEvent)|
22
+
| pointer-enter | ... el puntero entra en el objeto|[Intersection](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/three/src/core/Raycaster.d.ts#L16), [PointerEvent](https://developer.mozilla.org/es/docs/Web/API/PointerEvent)|
23
+
| pointer-leave | ... el puntero sale del objeto |[PointerEvent](https://developer.mozilla.org/es/docs/Web/API/PointerEvent)|
24
24
25
-
The returned [Intersection](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/three/src/core/Raycaster.d.ts#L16)includes the [Object3D](https://threejs.org/docs/index.html?q=object#api/en/core/Object3D)that triggered the event. You can access it via`intersection.object`.
25
+
La [Intersection](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/three/src/core/Raycaster.d.ts#L16)devuelta incluye el [Object3D](https://threejs.org/docs/index.html?q=object#api/en/core/Object3D)que desencadenó el evento. Puedes acceder a él a través de`intersection.object`.
26
26
27
-
By default, objects positioned in front of others with event handlers do not prevent those events from being triggered. This behavior can be achieved by using the prop`blocks-pointer-events`.
27
+
De forma predeterminada, los objetos posicionados delante de otros con controladores de eventos no evitan que se disparen esos eventos. Este comportamiento se puede lograr utilizando la propiedad`blocks-pointer-events`.
Copy file name to clipboardexpand all lines: docs/es/api/instances-arguments-and-props.md
+43-37
Original file line number
Diff line number
Diff line change
@@ -1,119 +1,125 @@
1
-
# Instances
1
+
# Instancias
2
2
3
-
The core idea of **Tres**is an _autogenerated catalogue_ of all the ThreeJS elements. This catalogue is generated from the ThreeJS source code, so it's always up to date.
3
+
La idea principal de **Tres**es un _catálogo autogenerado_ de todos los elementos de ThreeJS. Este catálogo se genera a partir del código fuente de ThreeJS, por lo que siempre está actualizado.
4
4
5
-
When using ThreeJS, you need to import the elements you want to use. For example, if you want to use a `PerspectiveCamera`, you need to import it from the `three` package:
5
+
Cuando usas ThreeJS, necesitas importar los elementos que deseas utilizar. Por ejemplo, si quieres usar una `PerspectiveCamera`, necesitas importarla desde el paquete `three`:
With**Tres**you don't need to import anything, that's because **Tres**automatically generate a**Vue Component based of the Three Object you want to use in CamelCase with a Tres prefix**. For example, if you want to use a `PerspectiveCamera` you would use `<TresPerspectiveCamera />` component.
13
+
Con**Tres**no necesitas importar nada, esto se debe a que **Tres**genera automáticamente un**Componente Vue basado en el objeto Three que deseas usar en CamelCase con un prefijo Tres**. Por ejemplo, si quieres usar una `PerspectiveCamera`, puedes usar el componente `<TresPerspectiveCamera />`.
14
14
15
15
```vue
16
16
<template>
17
17
<TresCanvas>
18
18
<TresPerspectiveCamera />
19
-
<!-- Your scene goes here -->
19
+
<!-- Tu escena vive aqui -->
20
20
</TresCanvas>
21
21
</template>
22
22
```
23
23
24
-
This means that you can use the same [documentation](https://threejs.org/docs/)as you would when using plain ThreeJS, but with the power of Vue.
24
+
Esto significa que puedes utilizar la misma [documentación](https://threejs.org/docs/)que usarías al utilizar ThreeJS básico, pero con el poder de Vue.
25
25
26
-
## Declaring objects
26
+
## Declarando objetos
27
27
28
-
If we follow this argument, you should be able to lay out an instance like this: ❌
28
+
Si seguimos este argumento, deberías poder definir una instancia de esta manera: ❌
const camera =newPerspectiveCamera(45, 1, 0.1, 1000)
74
80
```
75
81
76
-
## Props
82
+
## Propiedades
77
83
78
-
You can also pass props to the component, for example, the`TresAmbientLight`has a `intensity` property, so you can pass it to the component like this:
84
+
También puedes pasar propiedades al componente, por ejemplo, el`TresAmbientLight`tiene una propiedad `intensity`, por lo que puedes pasarla al componente de la siguiente manera:
79
85
80
86
```html
81
87
<TresAmbientLight:intensity="0.5" />
82
88
```
83
89
84
-
### Set
90
+
### Establecer
85
91
86
-
All properties whose underlying object has a `.set()`method have a shortcut to receive the value as an array. For example, the`TresPerspectiveCamera`has a `position` property, which is a `Vector3` object, so you can pass it to the component like this:
92
+
Todas las propiedades cuyo objeto subyacente tiene un método `.set()`tienen un atajo para recibir el valor como un array. Por ejemplo, el`TresPerspectiveCamera`tiene una propiedad `position`, que es un objeto `Vector3`, por lo que puedes pasarlo al componente de esta manera:
87
93
88
94
```html
89
95
<TresPerspectiveCamera:position="[1, 2, 3]" />
90
96
```
91
97
92
-
To specify transformation properties such as position, rotation, and scale, a shorthand is available that allows you to directly indicate the axis you wish to set within the props. A similar shorthand is also available for color property.
98
+
Para especificar propiedades de transformación como posición, rotación y escala, hay una forma abreviada disponible que te permite indicar directamente el eje que deseas establecer dentro de las propiedades. Una forma abreviada similar también está disponible para la propiedad de color.
93
99
94
-
<!--I changed color syntax from vue to html, because vue seems broken and does not color nested components-->
100
+
<!--Cambié la sintaxis de color de Vue a HTML, porque Vue parece estar roto y no colorea los componentes anidados-->
When you set the rotation property in[three.js](https://threejs.org/docs/index.html#api/en/math/Euler), it will use the 'XYZ' order by default.
103
-
It is important to note that when setting the rotation property with the shorthand, the order in which you set the angles matters. For more information on this topic, please refer to [Euler angles](https://en.wikipedia.org/wiki/Euler_angles)
108
+
Cuando estableces la propiedad de rotación en[three.js](https://threejs.org/docs/index.html#api/en/math/Euler), se utilizará el orden 'XYZ' de forma predeterminada.
109
+
Es importante tener en cuenta que al establecer la propiedad de rotación con la forma abreviada, el orden en el que estableces los ángulos importa. Para obtener más información sobre este tema, consulta [Ángulos de Euler](https://es.wikipedia.org/wiki/%C3%81ngulos_de_Euler)
<!-- Note that the order of the rotation properties matters, and swapping the order can result in different outcomes. -->
117
+
<!-- Ten en cuenta que el orden de las propiedades de rotación importa y cambiar el orden puede dar lugar a resultados diferentes. -->
112
118
```
113
119
114
-
### Scalar
120
+
### Escalar
115
121
116
-
Another shortcut you can use is pass a scalar value to a property that expects a `Vector3` object, using the same value for the rest of the Vector:
122
+
Otro atajo que puedes usar es pasar un valor escalar a una propiedad que espera un objeto `Vector3`, usando el mismo valor para el resto del vector:
117
123
118
124
```html
119
125
<TresPerspectiveCamera:position="5" /> ✅
@@ -123,9 +129,9 @@ Another shortcut you can use is pass a scalar value to a property that expects a
123
129
<TresPerspectiveCamera:position="[5, 5, 5]" /> ✅
124
130
```
125
131
126
-
### Colors
132
+
### Colores
127
133
128
-
You can pass colors to the components using the`color` prop, which accepts a string with the color name or a hex value:
134
+
Puedes pasar colores a los componentes usando la propiedad`color`, la cual acepta un string con el nombre del color o un valor hexadecimal:
129
135
130
136
```html
131
137
<TresAmbientLightcolor="teal" /> ✅
@@ -135,9 +141,9 @@ You can pass colors to the components using the `color` prop, which accepts a st
135
141
<TresAmbientLightcolor="#008080" /> ✅
136
142
```
137
143
138
-
### Methods
144
+
### Métodos
139
145
140
-
Some underlying properties are actually methods, the`TresPerspectiveCamera`has a `lookAt`method inherit from [Object3d](https://threejs.org/docs/#api/en/core/Object3D.lookAt), so you can pass it the coords to the component like this:
146
+
Algunas propiedades subyacentes son en realidad métodos, el`TresPerspectiveCamera`tiene un método `lookAt`heredado de [Object3d](https://threejs.org/docs/#api/en/core/Object3D.lookAt), por lo que puedes pasarle las coordenadas al componente de esta manera:
0 commit comments