# Is there a getTextureCoordinates method that does not require pickWithRay?

**URL:** <https://forum.babylonjs.com/t/is-there-a-gettexturecoordinates-method-that-does-not-require-pickwithray/8077>\
**Category:** Questions\
**Created:** [January 16, 2020, 7:03pm UTC](https://forum.babylonjs.com/t/is-there-a-gettexturecoordinates-method-that-does-not-require-pickwithray/8077 "2020-01-16T19:03:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlos.Mendieta](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carlos.mendieta/32/124_2.png) [@Carlos.Mendieta](https://forum.babylonjs.com/u/Carlos.Mendieta)\
**Post date:** [January 16, 2020, 7:03pm UTC](https://forum.babylonjs.com/t/is-there-a-gettexturecoordinates-method-that-does-not-require-pickwithray/8077/1 "2020-01-16T19:03:13Z")

</div>

I’ve been successfully using the standard example in the Babylon JS documentation:

```
var pickingInfo = scene.pickWithRay(ray, function (currentMesh) {
    return meshTask.loadedMeshes.find(x => currentMesh);
});

```

Then once I have my pickingInfo, i use it to getTextureCoordinates for the corresponding picked point, but was curious if there was an existing method that would allow me to provide my own mesh and point as a parameter without using the pickWithRay?

Thank you,  
Carlos

---

<div class="post-metadata">

**Author:** ![kvasss](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/kvasss/32/3774_2.png) [@kvasss](https://forum.babylonjs.com/u/kvasss)\
**Post date:** [January 16, 2020, 7:45pm UTC](https://forum.babylonjs.com/t/is-there-a-gettexturecoordinates-method-that-does-not-require-pickwithray/8077/2 "2020-01-16T19:45:11Z")

</div>

hi. you can get mesh from scene e.g. by name and provide your coordinates as Vector 3. other question where you get coordinates in local space of texture…

---

<div class="post-metadata">

**Author:** ![Carlos.Mendieta](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carlos.mendieta/32/124_2.png) [@Carlos.Mendieta](https://forum.babylonjs.com/u/Carlos.Mendieta)\
**Post date:** [January 16, 2020, 7:52pm UTC](https://forum.babylonjs.com/t/is-there-a-gettexturecoordinates-method-that-does-not-require-pickwithray/8077/3 "2020-01-16T19:52:23Z")

</div>

Right, I know I can use scene.getMeshByName and I know how to make a Vector3. What I want to be able to do is something like:

var setMeshInfo = scene.setPointOnMeshForTextureCoords(mesh, point);  
var textureCoords = setMeshInfo.getTextureCoordinates();

something like that. Is this possible? I know I can hijack the return values of a scene.pickWithRay… I tried it and it worked, but i know that’s not what its for and would rather do things properly if the method exists.

Thanks!

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [January 16, 2020, 9:41pm UTC](https://forum.babylonjs.com/t/is-there-a-gettexturecoordinates-method-that-does-not-require-pickwithray/8077/4 "2020-01-16T21:41:58Z")

</div>

You need to use the picking info because we need to understand where on the triangle the point is (we need the distance from the triangle vertices to evaluate the correct uv)

---

<div class="post-metadata">

**Author:** ![kvasss](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/kvasss/32/3774_2.png) [@kvasss](https://forum.babylonjs.com/u/kvasss)\
**Post date:** [January 16, 2020, 10:18pm UTC](https://forum.babylonjs.com/t/is-there-a-gettexturecoordinates-method-that-does-not-require-pickwithray/8077/5 "2020-01-16T22:18:45Z")

</div>

what are you trying to do?

---

<div class="post-metadata">

**Author:** ![Carlos.Mendieta](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carlos.mendieta/32/124_2.png) [@Carlos.Mendieta](https://forum.babylonjs.com/u/Carlos.Mendieta)\
**Post date:** [January 17, 2020, 4:44pm UTC](https://forum.babylonjs.com/t/is-there-a-gettexturecoordinates-method-that-does-not-require-pickwithray/8077/6 "2020-01-17T16:44:04Z")

</div>

I understand, thank you everyone for your time
