Can I know the method of importing the obj and can I have the file?
To load a 3d model, scroll down the first JS event and at the end uncomment the loading method you need, comment the cube loading and save the project before starting the preview.
Make sure to modify the Z position in the second JS event to make the object far enough to not clip into the camera.
Hello all! I decided to publish pseudo 3d example with the camera rotating. First post updated.
Maybe someone will be interested - raycasting test 3, I was able to improve the emission of rays using the condition “Raycast”, it works instantly, but so far it is impossible to make walls with textures without bugs. But this pseudo 3D method works faster than the non-ray method and I will try to develop it further.
That’s awesome! I’ve been watching your other videos with textures and it looks really nice!
Thank you! I also like how it looks It is a pity that so far it will not work to make a full-fledged game, a lot of things still need to be finalized
This is amazing.
Hi everyone, a gdevelop newbie here, although I’ve dabbled in amateur game development for about 20 years, starting with, among other things, Klik & Play. So I’m pretty used to gdevelop’s even system.
I downloaded Mikhail’s work from his comments on YouTube (I go by the handle elveede there) and have experimented with it a lot.
My question: Does anyone have an idea how to integrate mouse look (only horizontal) into this pseudo-raycasting “engine”? I’m not sure gdevelop can catch the mouse although HTML5 can do it via “Pointer Lock API”. Anyone have any ideas?
“Camera” rotation is controlled by changing the angle of the player’s sprite, so mouse control is possible. Use conditions as advised @ars_creativa .
Thanks for the quick replies!
I will try that out asap. The issue usually was that the mouse cursor can still leave the game window making it impractical. But I will see whether I just did something wrong! Thanks!
Okay, I give up. It’s easy enough to get the player sprite to move based on the mouse input (by using MouseX instead of of the Cursor X position) but it’s all useless if the cursor can move around freely on the screen?
How do I lock the cursor to the center of the window? I could not find a variable to do this, as compared to (for example) Construct Classic.
This is a problem… Сentering the camera on the cursor may help? Although I’m not sure
It occurs to me that you can hide the cursor, and make two variables for X and Y that copy and caps the mouse position to the window’s dimensions. Then you can calculate the difference between these variables to the mouse position each frame to calculate the difference of the angle and change the view accordly.
That sounds good but how do you even cap the mouse position? So far I have not found a way to interact with the mouse cursor in any way from inside the program. It’s position can only be read, it can be hidden, etc. but there is no way to cap it that I have found so far.
You don’t need to cap the mouse position, just the variables that copy the mouse position.
In pseudo code could be as is:
variable Xcapped = clamp (MouseX, 0 , WindowWidth)
variable Ycapped = clamp (MouseY, 0 , WindowHeight)
You might calculate the difference between the center of the camera and the mouse position to find the angle of movement.
And there is an action to hide the cursor:
Pseudo fps games
Thanks! However, that means the mouse cursor can still leave the window, making it impossible to use it in-game. As far as my research goes GDevelop simply doesn’t support keeping the mouse cursor within the window.
What about fullscreen?
Your mouse can’t leave the window if the window takes up the whole screen taps head
Another 3d example… mine is not nearly as nice as the ones mentioned in this thread, but it’s much simpler and easy to duplicate. Think of this as a way to do 3d for people that aren’t very good at math
I’ve been playing with @Mikhail_Pomaskin 's (https://forum.gdevelop-app.com/u/Mikhail_Pomaskin) example and manage to generate an error. It really didn’t like the light objects with the walls having light obstacle behavior.
I’ve managed some success but haven’t got everything figured out yet. Object that I create aren’t displayed exactly right - they appear slightly below ground for a reason I haven’t found yet.