Sprit in front of 3d?

Hi, I was wondering if @AqeeAqee could help me with getting a 2d sprite over the 3d-ness… preferably in blocks if u can.

Thanks if you’re able to!

idk why I blurred that

1 Like

I hope I can, too.
But that really depends on what kind of 3d sprite you want. We need define it exactly, before we can discuss the possibility.

2 Likes

Ok, here’s the link for context, there’s a comment for the sprite that needs to be… um… un-3d’d? (idk how to say dat lol).
https://arcade.makecode.com/S13942-09823-98508-37753
Thx if it is possible!
:slight_smile:

The red car sprite in raycasting world. that already in 3d, in one kinds of, a 2d texure in a 3d world with a angle according the angle between itself and player.
What you want is to draw a different angle view of the car based on this only one image? If so, I have to say that’s a impossible task for any one. :sweat_smile:

2 Likes

I think what he’s trying to say is make it so that the car doesn’t rotate to face you as you move around it, but rather stays 2d and facing one direction constantly.

That’s how I understood it.

3 Likes

I was going to like this post, but then I ran out of likes. :weary:

1 Like

Thanks for the explaination, that could be more reasonable, if it is.

1 Like

Just now learned that this was already built-in from the start by @AqeeAqee…:

Would love to see a best practice implementation of this by maestro himself, without wasting time on drawing many sprites at different angles!

An extremely amateurish, crude and lazy hack attempt based on 4 gallery images:

(Sorry for the intrusion, much more 3D-competent guys, I just wanted to quickly familiarize with this great raycasting extension and the challenge at hand my self.)

2 Likes

@Ultimategreg123, are you wanting something like this?

4 Likes

Nice!

Of course this must be it!
(@Ultimategreg123?)

For @Blobbey's eyes only...

Other than that, I am extremely happy that @Blobbey stepped by here, so that he can see with his own eyes from my two previous posts above, which clearly were moderated/approved by @makecode in the incorrect LIFO/stack order, thus proving, that I indeed beat him to the finish line in the other thread, which, of course, was no competition either… :wink:

1 Like

YES THANK YOU! @blobbey thx

2 Likes

Good work! I thought of recommending the relative to camera block but I was unsure of whether it would work

2 Likes

here is what id do
first get the angle of the player and the car
then if the car is in viue do the faloing
find at what angel the car is facing based on the player and find what image to set the car to baset on that angle

to: @Ultimategreg123 (not to Sage, sorry)

Can’t believe what you want is sprite relatived camera, why u call it 3d-ness?

2 Likes

I … er… didn’t know what to say :sweat_smile:

2 Likes

alright :joy:

2 Likes

I had this reply drafted for like 2 weeks now and wasn’t quite sure how to word it, so it may be a bit confusing to read. But I may as well post it:

Could probably implement that with zig-zag wave function and scaling X, so when you are at a 90 or 270 degree angle to it, the (Xscale = 0), and when you are at a 0 degree angle, the picture looks normal (Xscale = 1), and when you are at at 180 degrees, the picture will appear backwards. (Xscale -1). So if the angle is 0-179 degrees, it is like mapping 0 to 179 to 1 to -1, then if the angle is 180 to 359 degrees, subtract 180 and then map the resulting value (between 0 to 179) from -1 to 1. This is not really a sine function though because that is more of a wave, this is more linear.

2 Likes