#Brimming with Blood

1 messages · Page 1 of 1 (latest)

rough delta
#

Does it work from all angles?

calm grail
#

the pulsing gets faster depending on how low the player's health is, too!

rough delta
#

Wait what

#

Please explain how you're doing this because I have a great fear that the answer is "badly"

calm grail
rough delta
#

Here's my pitch

#

It might be technically more computation, but not much

#

Take the entity's (a player in this case) OBBMins and OBBMaxs and use them to calculate the 8 corners of their bounding box

#

ToScreen() those points and find the leftmost, rightmost, topmost, and bottommost ones

#

That'll give you a rectangle that perfectly covers the entity from any angle

#

You can then draw that rectangle with some percentage of its full height to get the health bar thing working

#

Given that 3D games are fundamentally about taking thousands of 3D points and mapping them to a 2D screen, I don't think a few extra ToScreen() calls will tank performance

calm grail
#

memories of making esp blobsmiletear

#

i believe i already have a function for 3d box -> 2d gift wrapped box

calm grail
#

the point is 100 variable units above ent origin, depending on ent health and standing vs crouching

#

i am going crazy i don't remember any of this code

rough delta
#

Great sign

#

Make you feel safe, doesn't it?

rough delta
calm grail
#

trying to conform to contents

rough delta
#

Oh, sure

#

Is that done with ToScreen() or some math I haven't considered?

#

I'm hoping it's the math one, because I don't love my solution

calm grail
#

ToScreen :(

#

i haven't been able to figure out a better way to do the math

#

it's simply too good

rough delta
#

Well, it's absolutely not "good"

#

If it doesn't have a better solution, that's a different thing

#

I refuse to let "This is the only available solution" mean that that solution is "good"

calm grail
#

if you keep things local to the camera EyePos() it works very nicely

#

i use it for my weapons' recoil crosshair

rough delta
#

A few things come to mind when I'm thinking about this...
A player's bounding box is symmetric so in theory all you really need is the center point and any single corner's offset from that center point and you can recreate the entire bounding box

#

Relatedly, the size of that bounding box is the same when viewed from any 90° angle around the ...yaw axis... for lack of a better term

#

I'd bet that this kind of symmetry and such could be used to make something like a lookup table or simple math to tell you the on-screen size of a player given their relative angle to the camera and distance

#

Though, having said that, it's possible that the perspective weirdness at the edges of the screen might be an issue

calm grail
#

it is

#

ToScreen returns bogus data after the position is off screen

rough delta
#

I feel like ToScreen is a poorly written function

#

I'm not a mathmatographer, but I feel like this is a solved problem

calm grail
#

let me find the C side of it

rough delta
#

4 calls to CurrentView() seems good

calm grail
#

specifically the Clip transform function right above that

calm grail