# GPT Chat can teach you how to use Babylon.js

**URL:** <https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324>\
**Category:** Tutorials and tips\
**Tags:** ai\
**Created:** [December 7, 2022, 3:07am UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324 "2022-12-07T03:07:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![arcman7](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/arcman7/32/20249_2.png) [@arcman7](https://forum.babylonjs.com/u/arcman7)\
**Post date:** [December 7, 2022, 3:07am UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/1 "2022-12-07T03:07:53Z")

</div>

Y’all need to see this:

 ![Screen Shot 2022-12-06 at 5.03.38 PM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/0/3050ae2d0deacbb20d1059f9a334b156f483d3c8.jpeg)

 ![Screen Shot 2022-12-06 at 5.06.08 PM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/8/c8d32712bc4681d287efed920669d4f710b31621.jpeg)

This is absolutely wild.

---

<div class="post-metadata">

**Author:** ![bigrig](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bigrig/32/5548_2.png) [@bigrig](https://forum.babylonjs.com/u/bigrig)\
**Post date:** [December 7, 2022, 5:19am UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/2 "2022-12-07T05:19:56Z")

</div>

woa. that’s better than google.

 ![Screenshot 2022-12-06 at 9.19.17 PM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/d/f/df9143ce8bdaf7571937a599c318707e6ccda537.jpeg)

---

<div class="post-metadata">

**Author:** ![arcman7](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/arcman7/32/20249_2.png) [@arcman7](https://forum.babylonjs.com/u/arcman7)\
**Post date:** [December 7, 2022, 5:43am UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/3 "2022-12-07T05:43:05Z")

</div>

Haha, awesome!

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [December 7, 2022, 5:28pm UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/4 "2022-12-07T17:28:38Z")

</div>

cc @PirateJC

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [December 7, 2022, 5:29pm UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/5 "2022-12-07T17:29:27Z")

</div>

[![](https://img.youtube.com/vi/8Ci8eZQI2Cc/maxresdefault.jpg "With Codex, creators can use natural language to build 3D scenes") ](https://www.youtube.com/watch?v=8Ci8eZQI2Cc)

---

<div class="post-metadata">

**Author:** ![arcman7](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/arcman7/32/20249_2.png) [@arcman7](https://forum.babylonjs.com/u/arcman7)\
**Post date:** [December 7, 2022, 9:46pm UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/6 "2022-12-07T21:46:32Z")

</div>

Wow. That is also impressive. So between being able to ask very specific questions with GPTChat and prototyping various scenes and objects with Codex, I can move really quickly! Love this!

---

<div class="post-metadata">

**Author:** ![bigrig](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bigrig/32/5548_2.png) [@bigrig](https://forum.babylonjs.com/u/bigrig)\
**Post date:** [December 9, 2022, 3:40am UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/7 "2022-12-09T03:40:15Z")

</div>

Ooh i was playing with codex today. It was a really good alternative to googling for babylonjs code snippets (and general javascript help). Their sandbox didn’t work for generating babyon scenes like in that video b/c it doesn’t load the libraries. Wonder if he created a custom setup there with libs preloaded and then using the codex api.

I wanted to try it out b/c when i asked “Create a snowstorm” … it generated some really interesting particle stuff. Was wondering how far i could take it…

I also did feel like a sucker for spending so much time doing things by hand. Like when you’re a kid and you realize that there’s a calculator for that.

---

<div class="post-metadata">

**Author:** ![arcman7](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/arcman7/32/20249_2.png) [@arcman7](https://forum.babylonjs.com/u/arcman7)\
**Post date:** [December 9, 2022, 3:49am UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/8 "2022-12-09T03:49:21Z")

</div>

> [@bigrig](#):
>
> I also did feel like a sucker for spending so much time doing things by hand. Like when you’re a kid and you realize that there’s a calculator for that.

I feel that; I will never use long division, ever. But just think how much more use you got out of the calculator by already having the basics down yourself!

---

<div class="post-metadata">

**Author:** ![stephenbuilds](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/stephenbuilds/32/28656_2.png) [@stephenbuilds](https://forum.babylonjs.com/u/stephenbuilds)\
**Post date:** [December 12, 2022, 12:49am UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/9 "2022-12-12T00:49:28Z")

</div>

I used ChatGPT to generate some animation code combining GSAP + babylon.js… it created novel working examples that I was able to tweak. Pretty mind blowing!

---

<div class="post-metadata">

**Author:** ![arcman7](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/arcman7/32/20249_2.png) [@arcman7](https://forum.babylonjs.com/u/arcman7)\
**Post date:** [December 12, 2022, 6:22am UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/10 "2022-12-12T06:22:46Z")

</div>

It’s really nice to have in your back pocket. When I’m feeling lazy I just ask it how to do stuff I don’t wanna look up such as “how to include GLTFFileLoader in your project” since I wasn’t sure what the npm package was called.

---

<div class="post-metadata">

**Author:** ![PirateJC](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/piratejc/32/1003_2.png) [@PirateJC](https://forum.babylonjs.com/u/PirateJC)\
**Post date:** [December 12, 2022, 9:46pm UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/11 "2022-12-12T21:46:45Z")

</div>

Not to hijack this thread, but if you could an AI feature to the Babylon platform, what would it be and why?

---

<div class="post-metadata">

**Author:** ![bigrig](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bigrig/32/5548_2.png) [@bigrig](https://forum.babylonjs.com/u/bigrig)\
**Post date:** [December 12, 2022, 10:27pm UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/12 "2022-12-12T22:27:32Z")

</div>

Integrate Codex into Playground.  
I was about to write a chrome plugin to do that actually… would make experimentation SO much faster.

---

<div class="post-metadata">

**Author:** ![arcman7](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/arcman7/32/20249_2.png) [@arcman7](https://forum.babylonjs.com/u/arcman7)\
**Post date:** [December 14, 2022, 6:56pm UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/13 "2022-12-14T18:56:03Z")

</div>

1. Looking up random packages such as:  
"how to include GLTFFileLoader in your project”  
“how to include fur material in your babylon.js project”

2. Generating conceptual explanations such as the difference between an objects center / bounding box center, its position, and its pivot point.

3. A general sense for what the side effects are when you recenter a model using code like this:

```auto
export const recenterMesh = (mesh: Mesh | AbstractMesh, center?: Vector3, offset?: Vector3) => {
  center = center || mesh.getBoundingInfo().boundingBox.center
  const offsetX = offset ? offset.x : 0
  const offsetY = offset ? offset.y : 0
  const offsetZ = offset ? offset.z : 0

  const pos = mesh.getVerticesData("position") || []

  for (let i = 0; i < pos.length / 3; ++i) {
    const x = pos[i * 3 + 0]
    const y = pos[i * 3 + 1]
    const z = pos[i * 3 + 2]

    pos[i * 3 + 0] = x - center.x + offsetX
    pos[i * 3 + 1] = y - center.y + offsetY
    pos[i * 3 + 2] = z - center.z + offsetZ
  }

  mesh.setVerticesData("position", pos)
  
  return center
}

```

And then ofc the things you already get from Codex are also definitely useful for fast prototyping. Imo I definitely see the case for two separate AI that help you with different things; it would be like Clippy and his pal Sticky Note.

In general babylon.js is a powerful and large framework. There’s just so many things to keep track of and remember, having a tool to quickly help you jump around from one domain such as animations to another, say thin instances in a quick and easy way would be awesome.

---

<div class="post-metadata">

**Author:** ![br-matt](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/br-matt/32/22436_2.png) [@br-matt](https://forum.babylonjs.com/u/br-matt)\
**Post date:** [December 14, 2022, 7:03pm UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/14 "2022-12-14T19:03:31Z")

</div>

I have been playing with this plenty myself. It’s had some amazing insights. The only rough part is its knowledge is from 2021 and often the babylon code/approaches are way out of date now. Can’t wait until a version of this exists that has up to date information from the internet too… kinda scary also though once it can 🙂

---

<div class="post-metadata">

**Author:** ![bigrig](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bigrig/32/5548_2.png) [@bigrig](https://forum.babylonjs.com/u/bigrig)\
**Post date:** [December 15, 2022, 12:43am UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/15 "2022-12-15T00:43:15Z")

</div>

Try Codex [OpenAI API](https://beta.openai.com/docs/models/codex)  
Not sure if it’s more up to date. Probably.

---

<div class="post-metadata">

**Author:** ![Vortex](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/vortex/32/26844_2.png) [@Vortex](https://forum.babylonjs.com/u/Vortex)\
**Post date:** [December 15, 2022, 2:09am UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/16 "2022-12-15T02:09:01Z")

</div>

While I love AI and think it is cool there have been so many scenarios on Stack Overflow where completely incorrect response to a SO question by ChatGPT has been copy and pasted as an answer that they had to ban usage of GPT generated answers on the site. Hopefully Babylon answers are better?

---

<div class="post-metadata">

**Author:** ![arcman7](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/arcman7/32/20249_2.png) [@arcman7](https://forum.babylonjs.com/u/arcman7)\
**Post date:** [December 15, 2022, 10:16am UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/17 "2022-12-15T10:16:51Z")

</div>

As I’m trying out more questions I am learning that GPT Chat is definitely not perfect; it made up a few non-existent method calls in response to some of my babylon.js questions

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [June 22, 2024, 7:50am UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/18 "2024-06-22T07:50:36Z")

</div>

It’s honestly a pile of shit when it comes to Babylonjs (mainly). It is just guessing the solution by combining code fragments from various sources and doesn’t have a clue about how things really works generally in 3D, nor in Babylon.js. As @arcman7 said it spills out code with non-existing classes, functions, etc. I event saw threejs classes mixed with Babylon’s ones. Lol.

If you are interested in a funny ChatGPT story and you wanna challenge a bit yourself in your drawing skills visit: [ChatGPT4 and the Tale of a Dog](https://forum.babylonjs.com/t/chatgpt4-and-the-tale-of-a-dog/51510)

---

<div class="post-metadata">

**Author:** ![Joe\_Kerr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joe_kerr/32/39017_2.png) [@Joe\_Kerr](https://forum.babylonjs.com/u/Joe_Kerr)\
**Post date:** [June 22, 2024, 1:02pm UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/19 "2024-06-22T13:02:59Z")

</div>

> [@roland](#):
>
> just guessing the solution by combining code fragments from various sources and doesn’t have a clue about how things really works generally in 3D

You can get quite far with that approach: [Early look: Turn-based tactics in Demo Town](https://forum.babylonjs.com/t/early-look-turn-based-tactics-in-demo-town/48587) 😁

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [June 22, 2024, 1:44pm UTC](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324/20 "2024-06-22T13:44:57Z")

</div>

Explain please 🕶

[Next page](https://forum.babylonjs.com/t/gpt-chat-can-teach-you-how-to-use-babylon-js/36324.md?page=2)
