Open Triazic opened 1 year ago
I would recommend looking at the original raylib examples, which all of our examples are based on. If you can't find an example of what you are trying to do, there are lots of helpful people on the raylib discord (including the 3 maintainers of this lib, like me, and the original author of raylib) that can probably help you put one together.
right now the typescript definitions for this are correct - it is a number instead of an array - or rather its a pointer address to the array in c memory, and there isn't a way to work with it from JS at the moment. there are a lot of places like this that still are pretty lacking in node-raylib, and it largely affects the 3d workflow. in all likelyhood this may not be the best library to work in 3d with, at the moment
this PR has some work in this regard - but materials still don't work in it https://github.com/RobLoach/node-raylib/pull/172
Noting the comment re. 3D not being great and the types being cooked, I have moved on from this library. The C# implementation Raylib-cs so far seems to have all the functions ported it's also not perfect (orbital camera doesn't work zz).
C# will also give you a far easier time outputting builds as complete EXEs too. unless you are 100% married to TS/JS, or need your Express server to render some text/images, it just needs more work. theres a lot of hard-to-handle stuff going on with memory management with the C code, and representing that data in JS, and handing it back-and-forth efficiently
I can use 'LoadModel' to load my obj and I can render it using DrawModel with a tint.
But I can't figure out how to apply texture/material to it. Of the following functions in the cheatsheet:
Only SetModelMeshMaterial is exposed which I can't do, if I can't load it in the first place:
And the approach used in the raylib example here doesn't work due to type errors:
I don't doubt there is a way but I'd rather not dig into the cryptic bowels of the js/ts wrappings etc. Please provide an example using the API as it stands today.