generalized bézier curve evaluation using recursion Image
it returns the point on the curve at t, where P is the set of control points, using recursion starting at B(d,0,t), where d is the degree of the bézier curve (number of points minus 1)

in code: Image
it's definitely not optimal, but, neither am I

I'm tired and was just curious to see if I could formulate the evaluation recursively in a short lil snippet~

(it evaluates most sub-points twice, among other things)
I didn't really cover this recursive formulation of de casteljau's algorithm in my video, mostly just showed that it is generalizable, but I might have to for my next video, as B-Splines are often defined in a similar way
I still haven't decided how much focus I should put on n-degree splines vs just cubic splines, since cubics are by far the most common type

but I think one of the powers of B-splines at least, is specifically that it's designed for you to be able to change degree

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Freya Holmér

Freya Holmér Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @FreyaHolmer

11 Sep
btw these large scary math symbols are just for-loops
dw game dev math mommy's got u ❤
math people interacting with this tweet are just now realizing how little math knowledge game devs and engineers can get by with
Read 13 tweets
11 Apr
how do you calculate correct normals when doing vertex displacement shaders?

here's a lil guide/example on the overly complicated but mathematically correct way of doing this~ Image
say you have this simple smoothstep bump, with a radius (r) and an amplitude (a)

the space we're working in will be in uv space, where (0,0) is in the center of this plane

o.uv = the current 2d uv coordinate

d = length(o.uv)
height = smoothstep(r,0,d)*a;
what we need is called the partial derivatives (rate of change) of this function, in order to calculate the normal

now, we're going the unnecessarily accurate route, so we're not using the ddx/ddy functions in the frag shader, that's cheating~
Read 15 tweets
13 Nov 20
I haven't been able to @PlayOverwatch for a year

it just, doesn't start, and I have *no idea* why

does anyone know what might be the issue?

(thread w. crash log & things I've tried so far that made no difference)
error from windows event viewer Image
Blizz files:
• Deleted all blizz/OW related things in %appdata%, %programdata%
• Repaired OW
• Reinstalled OW and Battle.net
• Reset OW config
• Deleted Documents/Overwatch
Read 11 tweets
19 Oct 20
(long thread. CW: cynical and depressing introspection)

sometimes it feels like the more you get to know yourself, the more you start questioning what your true self really is, versus what is just a layer of acting you mask it with

I don't even know if that distinction exists
quarantine has made me realize things about myself that I was sort of pretending wasn't there, and now I'm a little uncomfortable admitting that that's really who I am, or if that's even who I want to be, and if I even have a choice
I quit my job as co-founder/tech artist at Neat corp near april, right as covid hit, and we started self quarantining

I don't think I've ever had such an abrupt cutoff from friends that I used to meet every day at work, and from friends I used to meet a few times per year
Read 26 tweets
16 Oct 20
given three points, you can always find a circle passing through them all

1. draw lines from a to b to c
2. draw perpendicular bisectors (dashed)
3. the circle center is their intersection point
4. the circle radius is the distance from the center to any of the three points
this works because

• the circle center is by definition, the same distance to all three points
• given a pair of points, the region where the distance to both is the same, is a perpendicular line between them
• the intersection point is therefore where all three are the same
note that if all three points lie along a line, the circle is undefined! the bisectors would never intersect, so there is no circle passing through all points

(also if you comment about this because you don't read threads I will link you this tweet and make you feel *shame*)
Read 5 tweets
2 Sep 20
there are lot of misconceptions on high refresh rate monitors, so, quick facts!

• the eye doesn't have a "max framerate"
• the eye can absolutely distinguish between 144Hz and 1440Hz monitors

(thread)
the eye is continuously picking up light - if something is moving really fast, then it won't just get a "frame", it will smear in a blur, the size of which depends on the lighting conditions and the properties of your own eye

so - what if something is moving fast on a monitor?
try moving your cursor in a large circle quickly

do you see gaps between the cursors?

double your refresh rate and you would get one more cursor in the middle of those gaps

quadruple and you get three cursors covering that gap

see where this is going?
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(