instead if(gravity) velocity += something u can use velocity+=(something * !!gravity) it makes code branchless, cpu do not have to predict anything
@JorgeVinoRodriguez9 күн бұрын
@@grijjly6091 that’s correct! Other things to consider: is the branch involved causing any actual slowdowns in your code? How readable is the !! pattern compared to the regular? How much longer might a person not familiar with that pattern take to understand it, and what are the odds they figure it out correctly? Is the increase in performance outweighed by the extra difficulty in understanding and possible bugs that may be introduced when manipulating unusual code?
@grijjly60919 күн бұрын
@@JorgeVinoRodriguez branch is costly thing itself, it also can cause pipeline flush which is also costly thing 15+ clock cycle, if branch address is not in cache, it cause 100+ clock cycle, so branchless programming is serious thing in games, i mean it is really matter. Game engines abuse bitwise tricks and conditional move whenever possible. you can check roller coster tycoon source code, there is not single conditional branch written in pure assembly
@JorgeVinoRodriguez9 күн бұрын
@@grijjly6091 Yes, that's all true :)
@leahniko10 күн бұрын
hey, who has watched this playlist can you explain your opinion after finishing? this will be helpful for me or not? thanks!
@JorgeVinoRodriguez10 күн бұрын
I may be biased but I've had a lot of people watch all the videos and express gratitude at the end of them. Maybe try a few and if you like it you can keep going.
@Cinarbayramic11 күн бұрын
thank you man, i really needed this.
@amuerta304112 күн бұрын
This is very useful for the other more common reason: update to render interpolation, if my game updates 30 times per second, it will cause jitter when using the data to draw things in 60 FPS for example, interpolation is extremely useful in such a scenario, since it allows to have FPS way higher then UPS with reatning smooth look for movement. Great tutorial! Exactly what I was looking for :)
@julianaskuratovsky870116 күн бұрын
Wonderful!! Thank you!
@julianaskuratovsky870116 күн бұрын
super awesome!!
@julianaskuratovsky870117 күн бұрын
Magnificent super ultra cool!
@julianaskuratovsky870117 күн бұрын
awesome!
@julianaskuratovsky870117 күн бұрын
perfect!!
@julianaskuratovsky870118 күн бұрын
awesome super cool!!😊
@shubhamtangadpalliwar228018 күн бұрын
Ok, so i am trying to rotate an object around an axis which is not at origin, (w,v) will be my quaternion where theta is angle i want to rotate the point by and xyz as axis of rotation? And then where does my point to be rotated comes in the picture?
@shubhamtangadpalliwar228018 күн бұрын
So if i understood (w,v) is the axis of rotation and if i multiply vector "a" it will give me coordinates of a' the rotated vector?
@julianaskuratovsky870118 күн бұрын
awesome! thank you very much
@JorgeVinoRodriguez18 күн бұрын
@@julianaskuratovsky8701 im glad you’ve been enjoying the videos!
@julianaskuratovsky870118 күн бұрын
Fabulous!!
@julianaskuratovsky870118 күн бұрын
Amazing super cool. Thanks! The “shift” moment is hilarious
@julianaskuratovsky870118 күн бұрын
Perfect!
@julianaskuratovsky870118 күн бұрын
wonderful!!
@julianaskuratovsky870120 күн бұрын
Super amazing
@Digifan00122 күн бұрын
I don't get it, if you need to calculate the I, don't you also need the fx? I think based on your logic it should be kinda like this fx= (Px-V0x)/(V1x-V0x) ?
@julianaskuratovsky870122 күн бұрын
this is awesome!! Thank you very much!
@julianaskuratovsky870122 күн бұрын
a super nice video!!
@julianaskuratovsky870122 күн бұрын
Magnificent!!❤
@julianaskuratovsky870122 күн бұрын
Ultra cool! Perfect!! Thank you
@animearmy581323 күн бұрын
In output how -1 come 0+-5 will be -5 because + and - become minus
@liangbinyu7620Ай бұрын
I can not believe this series of videos were made 10 years ago , and still explains the linear algebra and computer graphics the easiest way,keep up the good work.
@julianaskuratovsky8701Ай бұрын
Awesome!!
@Digifan001Ай бұрын
So Roll would mean like when you tilt your head? But it looks like we don't need roll in this case if we are just wanting to see where the character is looking. Like tilting the character's head when is hiding and want to see the monster (or the enemy). But what would be the formula for that?
@JorgeVinoRodriguezАй бұрын
@@Digifan001 yes, roll is tilting your head. It doesn’t affect the “forward” vector of where the character/camera will be looking. It does affect the “right” and “up” vectors that describe what is to the side and above the character. The forward right and up vectors together form a rotation matrix. Keep watching the series for more info on that and if you still have trouble ask again :)
@julianaskuratovsky8701Ай бұрын
super fabulous!!❤
@julianaskuratovsky8701Ай бұрын
Super ultra cool!! Thanks!❤
@theleopeople5771Ай бұрын
I don't understand a thing... don't player and enemy in the final example face in the same direction? So it would mean that dot product should be 1, not -1 What is it I'm missing here?!
@julianaskuratovsky8701Ай бұрын
Awesome!!
@julianaskuratovsky8701Ай бұрын
Extras cool! My thanks!❤
@julianaskuratovsky8701Ай бұрын
Incredible!!
@julianaskuratovsky8701Ай бұрын
Super amazing awesome, thanks!!❤
@julianaskuratovsky8701Ай бұрын
Thank you very much, Sir, you’re literally a savior ✨💖🫶🏿
@julianaskuratovsky8701Ай бұрын
Ultra cool!!❤
@jackreaper5405Ай бұрын
23 + 11 years ago*
@TheFingledorfАй бұрын
Coming back to this, and I think I got it working fairly well in Unity, though I made a separate ToVector method that doesn't scale by the Cos of the pitch (so the vector doesn't shrink and speed doesn't lessen) and some other changes. I'm just surprised and happy I seem to have gotten it working tbh. public VectorNew ToVectorNoCosPitch() { VectorNew result; if (pitch < 0) pitch = 0; result.x = Mathf.Cos(yaw + 90 * Mathf.Deg2Rad);// * Mathf.Cos(pitch); result.y = -Mathf.Sin(pitch); result.z = Mathf.Sin(yaw + 90 * Mathf.Deg2Rad);// * Mathf.Cos(pitch); return result; } public void FixedUpdate() { vecMovement.z = Maths.Approach(veloMovementGoal.z, vecMovement.z, Time.deltaTime * 40); vecMovement.x = Maths.Approach(veloMovementGoal.x, vecMovement.x, Time.deltaTime * 40); //vid 14, Cross Product vecForward = camEulerAngle.ToVectorNoCosPitch(); vecForward.y = 0; vecForward.Normalized(); Debug.Log($"vecForward: {vecForward}"); Debug.Log($"vecForward length: {vecForward.Length()}"); VectorNew vecRight = VectorNew.CrossProduct(new VectorNew(0, 1, 0), vecForward); //VectorNew vecVelo = vecForward * vecMovement.z + vecRight * vecMovement.x; Debug.DrawRay(rbPlayer.transform.position, new Vector3(vecRight.x, vecRight.y, vecRight.z), Color.yellow); rbVeloForward = new Vector3(vecForward.x, 0, vecForward.z) * vecMovement.z; rbVeloRight = new Vector3(vecRight.x, 0, vecRight.z) * vecMovement.x; Debug.Log($"forward: {rbVeloForward}, right: {rbVeloRight}, vecForward: {vecForward}"); rbPlayer.position += (rbVeloForward+rbVeloRight) * Time.deltaTime; }
@BusinessWolf1Ай бұрын
For anyone watching this, avoid naming your variables 'x' and 'y' at all costs. Because you end up naming other variables 'X' and 'Y' and so on. And then you read the code in 3 months and understand nothing. Just create an object, give it a real name, and put the x and y inside as keys.
@julianaskuratovsky8701Ай бұрын
Ultra super amazing very cool ❤️🔥🔥
@julianaskuratovsky8701Ай бұрын
The best series ever!! Great!
@BusinessWolf1Ай бұрын
This is pure gold man, I love this so much! I can't wait to find out how to calculate x and y values in order to rotate the vector towards something
@BusinessWolf1Ай бұрын
Thanks! This puts the useless math I learned in high school into perspective. That's what I always lacked in math class. Gonna use these videos to learn more about both math and game dev.
@rahulrozi8246Ай бұрын
Auto subscribe bro, Thankyou,
@JaimeBeilis2 ай бұрын
great video! You have good teaching skills
@itsmypersonalaccount2 ай бұрын
all i have written code in is c and java (tf is cpp, man its getting over my head, only at some places) iget the concept but not the code