Thank you. As the historian in this interdisciplinary project, I study the written sources for Ireland and Scotland, and the territorial units and place names of the hint lands around the project central places in Munster, Dalrida and Pictland. I aim to place this in an international context so we can produce an analysis integrated with the archaeological and environmental research. I'm currently undertaking a literature review which is showing how scholars interpret Ireland and Scotland differently. Both countries have generally been regarded as peripheral to the core of European development, thought to be best represented by England and Francia. Scotland has been considered a successful, as Gordon showed, baffling case of state formation with a unified kingdom of the Picts being the precursor of the later medieval kingdom of the Scots, and hence Scotland. While Ireland has been regarded as politically divided, unstable and backward, retaining hundreds of kingdoms with competing royal kindreds into the 12th century. However, recent scholarship for both countries has been moving in opposite directions to each other. In Ireland, historians like Duncan Caroyne have increasingly argued for the development of powerful early medieval kingdoms which suppressed minor polities, employing taxation in officials to dominate their realms more comprehensively, especially from the 10th century onwards. The importance of the church working alongside kings and encouraging economic development has also been stressed. In Scotland, in contrast, scholars used to argue for substantial royal early royal government, reflected in officials, churches the more there, per precursor to the later medieval Earl, and also a figure called the Thane who's a local official according to some scholars. But recently scholars such as Alex Wolff, David Brune, and Alice Taylor have convincingly proposed that by the early 12th century, these were not royal officials, but the leaders of local kindreds chosen from their regional power bases. The kingdom of the Scots at this time was ruled by the king through the aristocracy rather than in spite of it, as often as the view. So scholarship on kingship and governance seems in these countries to have switched viewpoints. But what was the reality? It is difficult to undertake a comparison between Ireland and Scotland because there is such a greater abundance of evidence, both textual and archaeological, surviving for Ireland rather than you can see for Scotland. However, if we bring the fragments of surviving evidence together for Scottish history and utilize developing fields in archaeology and landscape history in place names in which the evidence of the disciplines overlap, it becomes possible to produce comparative material. So we can consider individual texts which I'll be doing to some extent and these do provide us with some important evidence. So for instance, in the Leipzig and Colomba, written at the end of the 7th century AD by Adolf Narn, Abbot of Iona, there are a number of episodes involving kings, including an interesting group about Pickland focused on the Pictish king, Brithay, son of Maelkon. This is a potential goldmine of evidence for Brithay and his power center, including this episode, which is in book 2, chapter 33, when Colomba was staying with the Pictish king, Brithay, and saves the life of the wizard, Brithay, to free a slave girl. In this episode, as you can see from the highlighted texts, there is a fortress with a house, a hall, and also a place for royal treasures. It also includes information about people linked with Brithay. There is the wizard Breuchen, who's described as Brithay's foster father. There are Brithay's familiares, his household members, who have considerable status since they and Brithay sent the messengers on horseback to Colomba. We can therefore create a picture of a court government with a king and his key supporters around him, and elsewhere the text has a sub-king of the Orkneys in attendance with Brithay. These people presumably helped Brithay make important decisions of the realm, as well as being his subordinates. While there are issues with the use of this material, as with any hagiographical text, it is presumably a relatively plausible depiction in this account, since there was a Pictish audience to the text and Aduthnan had visited Pictlander. I think it's very likely that he was, as someone who had subordinate monasteries there, that he would have been visiting at least once or twice. It may therefore tell us about the situation in the late 7th century, it may tell us more about the situation in the late 7th century than about the 6th century when Colomba was writing, but it's still very useful for us. Unfortunately, our written evidence for early medieval Scotland is very sparse, so we often can't draw definite conclusions from it. Steve Driscoll has argued from the written sources and the archaeology that after 700 there was a shift from hilltop sites like Brithay's and Dundern, which you can see here, to less defensive low-lying sites with connections to the church, like for Teviot and Skun in Persia. But at least with the texts, we cannot be sure whether the apparent decline in references to forts is due to the changing nature of our sources, as the main source for the forts, the Irish Chronicles, provides very few details at all about any places after 740, when the Iona Chronicle sees this to be a major component and instead what we find is that we get overall in our Scottish evidence, we get more evidence for non-military places and events, such as where laws were being promulgated or where a king died, because the sources we have are increasingly about the deaths of kings and where they're enacting events, so we then get the sources that are about non-defensive sites. So what we find is there's a shift in the evidence type, away from sources that are going to tell us about hill forts, to type sources that have a wider range of places, so in effect the written sources are not going to be the answer to a question about the change in use of central places, and only archaeological investigation can determine whether the shift suggested by fiscal was a real one and how much of a change that was. Another subject to be considering in this project is the land units used in different regions and how they reflect territories, social structures and methods of taxation and renders and other types of governance. This might help us understand whether structures of governance were based on kinship, as in kin groups, not kingship. Clientship or local communities, how stable or fluid local society was, what levels of society had kings or different types of rulers, and how resources were redistributed from the general population to elites. For Ireland, Paul McCotta has argued that in the 12th century there was a hierarchy of kings, ruling territories of different sizes, the smallest of which was what he calls the local kingdom, the Tuath, so this is the left hand side here, sorry the local kingdom, which is the Chika Khed. There are about 180 of these in Ireland, below that was the Tuath, led by the non-royal Taishach Tuath, and who Paul McCotta argues had very little real power by this time. McCotta argues that the Tuath was not ruled even around about 700 on the right hand side by a king, but I'm not sure that he's correct about this, the evidence is probably indicates that there were some who were kings, some who were not earlier on. Smaller than the Tuath was the Balio Beatef, a key unit focused on the kin group, which provided food renders and military service to the Chika Khed kings. McCotta argues that the equivalent of the Balio Beatef in 700 was the Koikroth Khedat, sorry about all the names, but you can see that one's there, the Koikroth Khedat. This is a unit, it's described in the legal text as a unit with five wraths, the five wraths being ring forts, which are found abundantly, as Gordon said, around the Irish countryside, and were probably on the whole usually occupied by free commoner farmers. The early Irish legal text state the contrast that they described kings as having dunes, dunes, ring forts, which presumably had a higher number of ring ditches, and this was a marker of social status. Kings provided cattle to farmers as part of their client ship relationship, and they had base clients who were in this sort of relationship, and in exchange for the cattle, the farmers gave food renders annually, and also cattle, and also labor service, including digging the ditches around the royal dunes, among other duties. Dunes, the same word that is used for fortresses in pick land in our sources, and also happens to be used as the word for often the fortresses in Ireland too. So what I'll be doing is looking at how this word has different connotations or similar connotations in the different case study areas. It has been argued by Paul McCotter, John Bannerman, and Alasdair Ross, who are two Scottish historians, that some of this Irish structure was also the same in pick land and the later Scottish kingdom. In particular, scholars have equated the Balya Beardach with the Scottish unit called the Dabba on the right hand side, regarding it similarly as a compact economic unit, which was a multiple estate. In the 12th century, the Dabba was a unit used for raising the common burdens for the crown. These were army service, financial and military aid and military campaigns, and also labor services on buildings like castles and bridges. The Dabba certainly dates to the 11th century, but might be dated earlier. The argument is usually that it's Pictish. The word is Gaelic, meaning vat in those Irish Gaelic sources, but is much debated whether it relates to an arable food render or unit or something else. I follow Alasdair Ross in viewing it as relating to both arable and pastoral farming, probably originally referring to a mixed render to the value of that vat or whatever containers it is is content. In addition to the Dabba, in the Kingdom of the Scots, there was also a local figure, I've mentioned before, the Thane, comes in sources of Latin, Thanus. This is in Gaelic sources, the Toyshech. So naturally scholars have linked this to the Irish Toyshech who ruled the two of the island. This can all fit an argument that Scotia and the successor of Picland and therefore Picland. So shared a fundamentally similar territorial and social pattern with Ireland, but there are problems with this. First, in some cases Dabba can be divided into separate parts, distributed about the parish. So this is a picture of one parish. I haven't marked them all, but they all have multiple parts dotted around. So a Dabba could be divided into different sections. In contrast, in Ireland, the Baljebiadach is usually a single unit instead. So the other difference is that while the Baljebiadach is often the basis for the later parish, although not always the Dabba, it's always the subunit of the parish. And so we seem to be seeing something different. In addition to this, we get often in Ireland Baljebiadach units have the place name element Balla, which is the first part of Baljebiadach in the name of that unit. But while Balje was also introduced into Scotland, as you can see on the left hand map and is found in many cases, it seems to have been introduced in the late 11th century and 12th century, exactly roughly around the same time. You don't see the Dabba having a place name element Balla in these names of these units. They do sometimes have the element Pet, which seems to be a share of land or some units of some size. And also often it's just the name of the Dabba, because it can be just a general place name, presumably a more central place in that small Dabba. So what we see therefore is the difference in terms of the names. And also it is noticeable that place name scholars in Scotland would regard Balje as meaning a settlement, whereas in Ireland, Macotta argues that it is a land unit and that settlement is a secondary, well actually the original usage, and then it becomes a land unit and then becomes a settlement. So it does seem as if there seem we need to investigate this more, but the Scottish Dabba does seem to be, although it has some similarities to the Baljebiadak, there are some key differences too. In addition to this, we do have some other general differences between Ireland and Scotland. Most notably, as Gordon mentioned, after the references to the lesser kings in Alba and Pickland, Seath in the middle of the 8th century, only kings of the Pits or Alba appear in sources. So the kingdom of the Pits becomes around about from 900 onwards, they're called the kings of Alba, that's so if I'm switching that's why they basically get renamed, it becomes a Gaelic kingdom rather than Pits. So but under the kings of the of Alba, there is also a regional lord called the Moorvair, which you can see, hasn't moved on. Yeah, so it didn't move on before, sorry, let's see. Sorry, you've not been on the right picture for a minute. It's only one. Yeah, so I didn't realise. No, you have to drag it and drop it under the euro screen if you would extend it. No, no, it's two up. Yes, that's it. Okay, so yeah, so what we have in the kingdom of Alba is this figure known as the Moorvair, who is a regional lord, which means the word is Gaelic means great or sea steward. Whatever the situation was when we start to get this figure much more often than other figures at around about 1100, it's likely that this position was initially an appointed one. And as David Bruner's argued, we can infer that there was an earlier stage before the Moorvair, which was probably already the stage had already been reached by about 700 AD when there's a figure called the Maya steward found in Pipland. We can guess this from one or two place names. While I'm still researching, while I'm still researching whether there were similar positions in Ireland, including whether the Maya, the Moora and the rector that we find in Irish sources are anything similar at all with the Scottish ones. At the moment, it does seem that the officials in Pipland seem to be a significant difference from Ireland. What explains the comparative lack of kings in Pipland and Alba in comparison to Ireland? Was the geography an environment of eastern Scotland more suited to political centralization, perhaps favouring hill forts, which could dominate localities, enabling elites to consolidate wider polities? Did the agricultural economy of eastern Pipland, with arable lands near the coast, and just relatively discrete, but still substantial, highland area, but with valleys that are quite, they're accessible from each other, but they're still quite, and they're not really isolated, but they're still quite discrete. Did this sort of landscape play a role too? In contrast, what we see in Ireland is generally more low-lying lands with coastal and riverine waterways as well. And overall, it's likely that you could travel around if you had a kingdom in one place you could be attacked from lots of directions more than you would be able to in Scotland. And also, the excess landscape in general is more accessible, so making it perhaps a bit more difficult for a smaller polity to expand and defend against all its competitors. In addition to this, there is the other possibilities, which there are lots of different possibilities, but one of the major ones is polity competition. The obvious competitors to the Picts were the English Northumbrians who dominated Pipland until the Battle of Nethansmere in AD 685 when they were defeated and driven out, and earlier on the Romans, who may have altered local power structures and ideology significant, did such interventions favour a few larger kingdoms able to compete while suppressing local royal polities, even if the effects of this were perhaps only noticed a century later. Overall, the comparative approach brings up a lot of questions, I think, about how Ireland and Scotland compare with each other and also the rest of Europe. Combining disciplinary approaches is the key to success, enabling us to test interpretations and to build up a better picture of how kingship and governance developed. Thank you.


11 points this evening, and he will almost certainly hit 100 career goals before we see him back here again. He is Shane Ford. I think there's a high likelihood of it. Shane, what coach was just talking about, the way you guys are playing right now, not Karen, who scores the goals, just moving the ball, doing the right things. Can you kind of take me through, as a veteran on this team, how important it was for you guys to start clicking that way offensively? Oh, it was incredibly important. Like, we weren't doing that in those hard games beginning of the year. That was more selfish lacrosse. And then when we start going against these easier teams, we're like focusing on moving the ball, trying to actually play good offense. So when you play like a York, again, we're going to be on the same page. We're going to know what to do, and we're just going to ball out. That was what we've been talking about a little bit. How confident are you where this team is, again, going through the struggles that you went through to begin the year, but playing better lacrosse and being ready for some of those bigger games that are still to come this season? I don't think the rest of the Mac is ready, because we had Cam Leydig was hurt most of the year. Josh Bannon was hurt most of the year. I'm still in a boot. We have got Ryan Coleman who was hurt most of the year. And now we're all getting healthy all of our fifth years on offense. So we're in a really good spot. It's showing right now. By the way, your coach was like, hey, he's up on that a little bit. Let's not give any bulletin board material out right now. MC and I have been big fans of the Shane Ford spot on the field right now, which is that sort of little, I don't know, four yard angle that you've been comfortable from. Has that always been? I mean, we've seen you do so many different things, working from behind, taking on contact. But that shot in particular this year has sort of been your almost go-to, your bread and butter. Where did that shot come from? It's got to come when I was in college, because when I was in high school, the goalies were pretty bad. And the defense was pretty bad. So I could just run right by them, easy goal. I get my hands free. I can see an open spot in the goal, so I just got to let it fly. The placement's been really good, man. It's been really good. Where did the toughness come from, Shane? We joke about it a lot.  Where does your toughness come from? If you're not tough at Stevenson, you're not going to get on the field. So that's what I kind of learned when I got to Stevenson.  And in high school, I'd just run through people, get leveled. But if it went in, I wouldn't care. Feel good. That's what it feels better in those moments, right? All right, so we've been trying to get to know everybody better this season. I want to know from you, give me the last show that maybe you binged recently, or a show that maybe you're working on right now. South Park. South Park. That's so funny. I've been losing my mind for the past week and a half, just binge watching South Park.  I can't do that. I can't do that. I'll work on it. Next time I'm up here, I got you. Shane, who are we shouting out, man? Who do you want to say hello to? Debs, Sam Rawson, Corey is strong. Follow him. Shane Ford, congratulations, man. Hopefully we'll be celebrating that career goal number 100 with you the next time we see it. Thanks for coming up here and hanging out.


Hey guys, welcome back skits on series episode 24 topic today is going to be rendering Three-dimensional shells or solids using triangles. So it's not a very complicated topic. There are a lot of steps, however But I'll give you an example of what we're going for This is example 24d just to cross rendering you can see each face Well, each side has different colors our front left right top back Bottom all the different sides have different colors and it renders pretty well pretty good Framerate not so bad. So the goal today is to basically go through the steps of how you render a body like this or a scene of bodies like this okay, so Yeah, I guess first is to know that all surfaces all shell bodies can be decomposed into Consituent triangles So for example, you had a cube that's six square faces You can break each square face into two triangle faces. So you have 12 triangular faces That's the first step of this process. And so yeah, if you can render triangles in 2d you can render three-dimensional bodies essentially However, we never covered Rendering 2d triangles. We did cover rendering three-dimensional wireframes. I think it was two episodes ago. So All the math is the same in in that regard But we will talk first about how we're supposed to render two-dimensional triangles So the algorithms are, you know, diverse for this you could find plenty of them online This I think is the best and easiest one for our application and it's implemented in the set triangle Function in our code base the way this works is basically you have a triangle and then you first You have to order the vertices in some kind of vertical sense So either top to bottom or bottom to top. So this will be vertex one two three for example And what you do is you break the triangle at vertex to so you basically cut the triangle in half So you have a flat bottom and a flat top triangle right here. So you have a triangle on the top and Triangle on the bottom Then what you do is starting out at the top or the bottom you compute the slopes of those sides So for example this slope and this slope that you get despite Subtracting the X and a Y components of the two extrema of the line segments Then what you do is you just kind of trace down those slopes and draw a bunch of horizontal lines at every pixel that you see here And you do that from your starting vertex to your middle vertex in our case vertex 1 to vertex 2 and then at vertex 2 you Recompute one of your slopes because the other slopes stay the same and Then you continue down the line until you hit vertex 3. So it's a very simple algorithm and It's not too math-intensive There are some special cases for example, what if vertex 1? Or let's just say two vertices have the same Y coordinate So you either have a Flat top or a flat bottom triangle. Well in that case Your problem gets easier by half, right? You don't have to worry about the second half of the triangle But either way you have to handle that case more or less separately Okay, cool. So now that you can render two dimensional Triangles, how do you extend that to 3d objects? Well the algorithm is pretty straightforward First you have to break your body into vertices. We already have the idea of this from our previous episode about rendering wireframes But in this case, let's see you had these vertices vertex 0 1 2 3 all the way to 7 what you do is So let's say you have a triangle here at vertex 0 vertex 2 vertex 1 and Also, you have one at let's say vertex 6 vertex 5 vertex 7 For each triangle that you have there all 12 of them you have to Project all those vertices in the 3d sense onto the two-dimensional view plane and then just draw that triangle So in our case, let's say you picked this triangle v 0 v 1 v 2 you drew that with the algorithm above Then you pick this triangle Triangle v 5 v 6 v 7 and you drew that one with the algorithm above You do that for all 12 triangles And that would be it Right that that would satisfy a 3d rendering. It wouldn't be a very good rendering and why is that? well Because you'd have a catastrophe Basically, you have no semblance of which triangle should be drawn first second third fourth or last And so you may accidentally draw triangles from the foreground before drawing triangles in the background and that would mean that you'd have like this weird, you know modern art looking rendering of Faces showing through faces that ought not to be showing essentially And so to get around this there are a couple different ideas And I recommend you try to brainstorm some but the one that oh that's the two that we're going to implement I'll explain here the first one is Both to solve that problem But also to help performance and that would be to only render triangles that are facing Towards you or in other words facing in the opposite of the way that you are looking and so this requires some More definition on our part and basically what you have to do is Think about the numbering system as an encoding for the direction of the triangles face So in that in our case, we're using anti clockwise or counterclockwise vertex numbering What that means is basically Vertex zero one and two they wrap counterclockwise Around the triangle and then the normal points in that direction with the right hand rule or alternately You can take the vector from v0 to v1 and from v0 to v2 if you cross take the cross part of those The normal outward of that sweep would be the normal vector And then you'd only would draw this triangle if that normal vector opposed our view direction So if you see this is our view direction, you would only draw this triangle and not this triangle because The first triangle has a component Opposite of our view direction Whereas this one does not how can you determine that mathematically? Well use the dot product so if the dot product of that normal cross product and Our view direction is less than zero. You can draw the shape Otherwise skip it. So this would enable us to basically Added a line right here in our algorithm. Just check if that triangle is pointing the right way and It would result in half of these triangles not being rendered So it would speed up our rendering but also solve part of our problem here But not all of it But it does require additional work on our part now We have to encode if the connection to the order of the vertices when we encode the faces So now we have to encode this triangle on top as v0 v2 v1 We can't call it v0 v1 v2. That would be a clockwise numbering scheme Okay, so that will help us with the rendering speed and also the problem that we had but it still allows something to go wrong So basically it will make it so all of our convex shapes Individually will look okay. So you can draw a red cube. You can draw a yellow cube You start any kind of cube with its own colors, you know different colors different sides That's fine and it will always work out fine The problem is if you try to overlap these two convex shapes, you know in front of you like this There's a possibility that if you still render the The closer convex shape before the further convex shape You can still get the bleed problem that we had before so if you render this foreground red body Before you draw this background yellow body He obviously the yellow will show through so you can't have that So we'll talk about that in a second One little pro tip not all bodies are convex convex basically means does a body have an indentation or a depression in it? So for example the cross I showed you before is not convex neither is You know Patrick star however if you want to be clever you can cut up most bodies into like more or less convex shells With holes on them, but that's fine and basically you can draw each individual convex body Separately and that would solve some of the problems with non-convex shapes however, the second optimization that we're going to implement is going to be Kind of a way to address this problem here And what we do is we take the centroid of these objects So if this yellow object is basically further away the centroid of it will be you know a hundred meters away from us Whereas this red object would be you know ten meters away from us So what we do is we order the objects from furthest to nearest and render them in that order and That's it so that basically solves Almost all the problems you can still have some problems arising from Near objects to each other that they're a single same distance from away from you that may still be a problem, but Most problems will be resolved in this fashion and we'll go through how that looks in the code today So let's do that. I have four examples one on covering points, which is more or less irrelevant We'll cover 2d triangles. We'll cover 3d triangles With both the improvements I discussed above Okay Let's do that so in the The code we have four examples here 24 a b c and d. Let's check out 24 a really quick So what is this one? this one is rendering points so Not really relevant to what I talked about in today's episode But still an important thing for us in the future when we go to use this for CAD or FEA and want to be able to Identify different nodes of our model or points on our model this will help us do that and I'll show you the code for this. It's basically what we did in episode. I think 22 The very very similar at least so But if you recall from before and even here we have these edge structures So this edge geometry that has encoded inside it the points and edges that compose the wireframe for that cross Well in a similar way we have a point geometry structure that Embeds just the points as well as the kind of rendering you want to have so I Just showed you those triangle points I can change those triangles to be Circles by changing this four to be a one and if I run this you'll see that now those triangles have become blue circles So not too complicated not too relevant either. I'll skip this one. You're free to peruse the code at your leisure Example b this is going to be the 2d triangle rendering so this is the implementation of the algorithm I discussed before Let me show you the algorithm again just to refresh your memory This algorithm here is implemented by what I just showed you so Quickly I want to point out if you can see it on your resolution. I have some white dots here Pointing toward the vertices. That's not part of the rendering I'm not just part of my check to make sure that the triangles were in the right spots but yes, so this algorithm does drop the triangles in the proper locations and I I'll show you the code really quick. So in this case I have this set triangle Function, which is valid for all bitmaps not just screen renderings and If the pass in just a couple things you pass in the usual stuff the pointer to the The pixel information you point you put the color you want to draw the triangle in the dimensions dimensions of your image as well as the six values so you have the Three vertices X and Y location on the screen passed in R8 R9 R10 R11 R12 and R13 So down here. You can see how it's working the red triangle here. It just You pass in the frame buffer address Pass in the color you want in our case red pass in the Six values that define the triangle X and Y for each vertex and then execute that function So yeah, again that drew those triangles. So that's the basis for our entire rendering in This entire series is drawing triangles like that Okay, that's simple enough 24 C now this I will I will I will say before I run it This does not include and I'll even show you Both of those optimizations. I want to show you each step along the process. So this one will have a glaring flaw to it So basically this does not include any idea of Centroids like this But it does include Culling all triangles that are facing in the same direction as you so I'll show you how this looks Here you can see kind of the problem that we were talking about so I Have this cross is 30 some odd triangles that constructed and I've got them all Set up with normals pointing outward from the cross So I'm only drawing the the triangles on the faces that are pointing toward the viewer However, you'll notice that you know problems like this arise here or like this arise here Where this face is facing me as well as this face is facing me? however Even though this face ought to be drawn after this face is drawn The way I've set it up. It's not the case. This is one giant Non-convex body and so you have Issues like this manifesting where you basically have bleeding through just because of the way I've numbered these faces You know on my end randomly So it doesn't make sense here, but it does make sense here. You know what I mean? So how can we address this? Well, like I mentioned before with you know the Patrick analogy we can just cut off each individual side or you know spoke on this cross and Make them all separate bodies give them all a centroid and then basically Render them in the order that they are away from us towards us And that's what the other example is showing This example does do just that and I'll show you the code in a second But yeah, basically I've cut off the top left right and bottom spokes of this cross and broken them into their own bodies given them a centroid and Then wherever I'm looking from at every location around when I'm rotating around the model I check the distance from the look perspective point to the center of the body and Then I order them every single time well if I have to reorder them I do if not I leave them the way they are but if I have to reorder them I put them in order from furthest to closest So very simple problem to solve and a very simple solution to the problem However, there's still a problem if you kind of can see it in this angle here There is I can zoom in you can see here at the at the top right. I just had it No, it's a very minor problem, but There are situations where you can actually see through Let me rerun it Just in case You're right there. You see at the top right that blue bleed through because Even though I'm ordering the centroids from furthest to closest there are still Circumstances because these are very close together, you know in the in the plane of the page It's still a possibility that I can get them out of order, but it's very very very Small in how big that problem manifests. So Still a problem. That's why I said there was still like a 1% issue with this but as far as the Computational expense and how much you're getting for it There really is no better way to render these bodies than what I've shown you so far in the video Okay, so let's go into the code about this one And I'll show you how this one works. So again, there's almost no includes because they're all behind the scenes Basically, we've had this in a couple videos so far you have our Initialization for the 3d rendering and then you have the loop for the rendering then you have to have a cursor so we make our cursor here a little yellow cross and So the entire program is this start loop will start label and this loop here So we just initialize that rendering and then loop forever But the real, you know, beauty of this is taking place in our data structures, so Instead of having an edge structure or a point structure or a face structure like we have in our other examples in previous videos In this video, we have our it's called the shell list structures what I called it and basically this is what incident coding both a number of Spokes on our cross number of bodies that we're trying to be able to order You know in real time as long with only the pointer to each of those bodies So here I have a the top of the cross the bottom of the cross the right of the cross Left of the cross as well as the centroid of that body in space and of course you could compute this With math I just hard-coded to here But you could make a function that groups these points together takes the average The problem with doing that is that you may have a lot of resolution point-wise of your feature Like the average of your body may not be the average of its points You may have a lot of points. Let's see you during a person model You have a lot of points in the face for resolution And only a few points in the legs Well, the CG of your person will be in the nose somewhere it but in reality the CG is somewhere in the stomach, right? So, you know, there's different math that you could do for this But I just hard-coded the centroid of each of those bodies in space and then like we had Before we have our individual structures that define the faces on the top left right bottom of our cross and as we had before with our Wireframes if you recall from previous video, we have all the points to fight in space and now we have all the faces to find as combinations of those points along with a color And so for example the top face the top square of the cross is These nodes 13 12 14 and 15 and we decompose that into You know two triangles Each of them is it looks like our GB blue It looks like so. Yeah, that's how this is all working. This is all passed into our Render rendering and knit Function which pulls all this in and I could even show you how that works another key part about this is This value here this structure type. So I'll show you how this works really quick Okay So here's that loop function that we just we're just calling a lot of includes you can see it has the ability to rasterize Point clouds rasterize text rasterize faces rasterize edges every kind of geometric entity we can draw in This way and the only difference is what we're passing in and so you pass in that link list of the Geometric structures and then it just checks it checks did you pass in a value of one if so? It's a point cloud. Did you pass in a value of ten in binary? If so, that's a wireframe model Did you pass in a value of a thousand binary? Well, that would be just text. We had that in our previous video What about a face so a simple? Convex shape is just a face. That's 100 binary That's like example see I showed you before where you don't care so much about The order of things in the depth of the page But you do care about culling away Faces pointing away from you that would be binary 100 And if you have a list of bodies that you want to care about the order from the viewer That would be binary 101 and you can see how we could eventually add more Geometry types to our rendering. This is how I'm implementing that in assembly And so yeah, if you pass in the value of one you're a point cloud And so it processes that and it renderizes it rasterizes that point cloud Same thing with wireframes faces and lists of those shells So if you have passed in a list of those shell Convex bodies like we're doing how does that work? Well, you say have debugging code here Let's get rid of that while we're here So the first thing that happens is Centroid sort so it's a function that I wrote the other day that sorts all the shell bodies by the distance from the viewer So that's obvious. I'm not going to go into that That's just you know the distance between that centroid and the viewer remember that this is encoded in our Perspective structure here this look from These three quad words here encode where the viewer is where you're projecting upon so you can get the distance between those values and the Centroids of each body That's what this line does then it just loops through all of the Convex shell bodies and rasterizes them So yeah, very simple. That's pretty much all of it there And in doing so we're able to render That three-dimensional body. That's not itself convex, but is constructed from Convex shells essentially So yeah, that's the entire topic for today, I hope you found that interesting It's pretty cool that we can do all this and I want to show you the size of this file. It's only 14 K there's a binary here 14.3 So that's the entire Drawing pipeline in 14 kilobytes and it could be way less I did there's a lot of overhead here I can get rid of a lot of code in the same spot well different spots But the same code could be cleaned up. I'm not going to do that my goal here with the skips on series is to make things simple and Modular and easy to understand But you could get this down to probably 8k another thing you could get down and I'm not going to do this but you could do this if you cared is All this stuff down here. Let me show you all these faces When I'm encoding which vertices are part of you know, which triangle right? DQ 17 16 7 That doesn't have to be a quad word. You don't have to use 8 bytes to encode the number 17 That could be a double word that could be a word that could be even be a bite So we could get it, you know, we could shave off, you know a kilobyte of Nonsense zeros from our code if you wanted to I'm not going to do that, but you could At the end of the day, this program only takes 32 megabytes of RAM and what was it 14 kilobytes of? hard drive space, so I'm not too concerned with the The size I'm not code golfing this series, but you're able to do that. You have the code at your You know leisure to do that with so yep, I hope you enjoyed the video. That's it. I'll see you in the next one