Questions tagged [rust]
Rust is a multi-paradigm programming language designed for performance and safety, especially safe concurrency
32 questions
1
vote
1
answer
126
views
How the intersection of BVH boxes can determine whether or not a triangle appears?
I'm programming a Ray Tracer using Rust and OpenGL, I've already made Ray Tracing work in the basics by converting the data to an SSBO and sending it to the Shader in a basic way... The problem is ...
0
votes
1
answer
42
views
What's wrong with the TBN map?
I'm trying to import 3D models into OpenGL using Rust and GLFT models, the problem is that this function used to work... Now it doesn't work at all!
It's working to load the 3D model, with the texture ...
-1
votes
1
answer
100
views
Isometric Rendering Doesn't Align
I've been starting to experiment with 2D rendering, in particular isometric rendering.
So far I've been having issues getting my tiles to line up.
I am currently writing this in Rust using the Bevy ...
0
votes
0
answers
38
views
spawning from an event reader in Bevy
In the following code, I load a mesh and trigger some post processing code from the MeshLoading event, because it loads in parallel, meaning I can't access it synchronously from the same function that ...
1
vote
1
answer
40
views
Pan orthographic non-axis-aligned camera
I'm trying to create a panning control for a camera in bevy, but I can't seem to get the panning logic right when the camera is rotated. It works fine if the camera transform is directly facing the XY ...
0
votes
0
answers
91
views
Efficient PRNG for WASM and x86_64?
For a game I am finishing, I need a random sequence that can be generated in Wasm and in the server, yielding the same result.
This generated 64-bit(or more if supported by WASM) numbers sequence is ...
1
vote
1
answer
161
views
How do I make the joints and weights skinned with the variables I'm using?
For some time now I have been trying to do skeleton animation using Rust and OpenGL(specifically the gl library), I loaded the animation information correctly(with the gltf library), the bone ids and ...
2
votes
0
answers
117
views
How to correctly rotate 2D orthographic projection around a central point?
I want to rotate a 2D orthographic projection around the centre point of my view. However, something is off (it looks like a translation) but I'm not sure what.
To put some concrete values on the ...
0
votes
1
answer
191
views
Why might performance of a Rust-sdl2 project be better while profiling?
I'm making a simple SDL2-based Rust game, on an OSX laptop. Graphics mostly involves drawing lots of colored squares to the screen. Performance is really slow for what I'm doing, so I decided to ...
1
vote
1
answer
590
views
How to rotate 2D image in 3D space using a quaternion
I am trying to rotate a flat 2D image around a 2D origin in 3D space. The problem I am having is that the image becomes stretched after the rotation. I am using the WGSL from this tutorial, but with ...
0
votes
1
answer
285
views
How to implement movement with move speed in a multiplayer game?
I'm developing a MMO RPG using Rust and bevy both in the client and the server, which means that I'm using ECS on both sides. My game is tile based, so each tile is a point in my map in the server, ...
8
votes
1
answer
4k
views
In Bevy ECS, what is a good way to have entities reference each other?
I am wondering if there is a better way than storing the entity ID. For the sake of example, let's assume I have a world with many entities who implement the component Name. Every x amount of time I ...
0
votes
0
answers
254
views
How can I convert a raw pixel buffer (1D array) into a 2D array?
I have to deal with a raw buffer representing some pixels, specifically the pixels crate. So far I am able to do some magic from the examples, however it is terribly bad when it comes to readability ...
1
vote
1
answer
655
views
Rust lang and Cheaters
So I started to learn Rust for personal usage, i am Back-end Node.js dev originally.
And I see that people often say Rust is a very secure solution because of memory management. In theory games/...
0
votes
0
answers
604
views
How can I render a texture in a specific x/y position on the screen? (OpenGL - glium)
I am in the process of writing a 2D game in Rust, and decided to use glium for the graphics part. So far I'm doing fine, able to render textures and shapes ...