# How to draw a surface from xyz coordinates

**URL:** <https://discourse.threejs.org/t/how-to-draw-a-surface-from-xyz-coordinates/8052>\
**Category:** Questions\
**Tags:** geometry\
**Created:** [June 12, 2019, 6:59am UTC](https://discourse.threejs.org/t/how-to-draw-a-surface-from-xyz-coordinates/8052 "2019-06-12T06:59:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![whiteblackkeys](https://avatars.discourse-cdn.com/v4/letter/w/b782af/32.png) [@whiteblackkeys](https://discourse.threejs.org/u/whiteblackkeys)\
**Post date:** [June 12, 2019, 6:59am UTC](https://discourse.threejs.org/t/how-to-draw-a-surface-from-xyz-coordinates/8052/1 "2019-06-12T06:59:04Z")

</div>

Hi guys,

I’m trying to understand if it’s possible to draw a surface starting from xyz coordinates of its vertex.

The result I’d like to achieve is something like [this](https://codepen.io/manudones/pen/RmdJKQ).

Can you please give me some hints?

Thanks

---

<div class="post-metadata">

**Author:** ![qifei](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/qifei/32/5912_2.png) [@qifei](https://discourse.threejs.org/u/qifei)\
**Post date:** [June 12, 2019, 8:23am UTC](https://discourse.threejs.org/t/how-to-draw-a-surface-from-xyz-coordinates/8052/2 "2019-06-12T08:23:56Z")

</div>

It’s possible with three.js.  
Read the document and learn. When you encounter problems come to ask again, with your code.

I notice your example is made with plotly.js. maybe it’s a better library for your purpose.

---

<div class="post-metadata">

**Author:** ![prisoner849](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/prisoner849/32/535_2.png) [@prisoner849](https://discourse.threejs.org/u/prisoner849)\
**Post date:** [June 12, 2019, 8:39am UTC](https://discourse.threejs.org/t/how-to-draw-a-surface-from-xyz-coordinates/8052/3 "2019-06-12T08:39:36Z")

</div>

Hi!  
Take a look at this SO answer: [https://stackoverflow.com/a/49477023/4045502](https://stackoverflow.com/a/49477023/4045502)

---

<div class="post-metadata">

**Author:** ![whiteblackkeys](https://avatars.discourse-cdn.com/v4/letter/w/b782af/32.png) [@whiteblackkeys](https://discourse.threejs.org/u/whiteblackkeys)\
**Post date:** [June 12, 2019, 9:57am UTC](https://discourse.threejs.org/t/how-to-draw-a-surface-from-xyz-coordinates/8052/4 "2019-06-12T09:57:19Z")

</div>

I’m looking at [this thread](https://discourse.threejs.org/t/create-a-curved-plane-surface-which-dynamically-changes-its-size/6161/8), do you think it’s still up to date?

I’m trying to understand the code, starting from thwt faceIndices are in a BufferGeometry…

---

<div class="post-metadata">

**Author:** ![hofk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hofk/32/44944_2.png) [@hofk](https://discourse.threejs.org/u/hofk)\
**Post date:** [June 12, 2019, 10:20am UTC](https://discourse.threejs.org/t/how-to-draw-a-surface-from-xyz-coordinates/8052/5 "2019-06-12T10:20:50Z")

</div>

> [@whiteblackkeys](#):
>
> I’m looking at [this thread](https://discourse.threejs.org/t/create-a-curved-plane-surface-which-dynamically-changes-its-size/6161/8), do you think it’s still up to date?

I guess so, yeah. Just replace the three.js version.  
If something doesn’t work, I have to look.🙂

---

<div class="post-metadata">

**Author:** ![whiteblackkeys](https://avatars.discourse-cdn.com/v4/letter/w/b782af/32.png) [@whiteblackkeys](https://discourse.threejs.org/u/whiteblackkeys)\
**Post date:** [June 12, 2019, 10:23am UTC](https://discourse.threejs.org/t/how-to-draw-a-surface-from-xyz-coordinates/8052/6 "2019-06-12T10:23:47Z")

</div>

Yeah the code works, I’m trying to understand its logic, and the official documentation of three.js doesn’t help me so much

---

<div class="post-metadata">

**Author:** ![hofk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hofk/32/44944_2.png) [@hofk](https://discourse.threejs.org/u/hofk)\
**Post date:** [June 12, 2019, 11:31am UTC](https://discourse.threejs.org/t/how-to-draw-a-surface-from-xyz-coordinates/8052/7 "2019-06-12T11:31:20Z")

</div>

If there’s a passage not clear in my code, ask.

_I have not always made enough comments._ 😕
