Table of Contents
Write a comment
hey guys welcome to another very exciting hard-surface episode inside of Maya so I had a question asked to me by some unknown entity about some hard surface stuff and what to do in terms of adding supporting edges so we've covered a few of these things before in terms of curved surfaces there will be a little hidden hidden bonus over here with with curved surfaces but we'll get to that so essentially let's smooth this so this is supposed to represent a car door so imagine this this is where the car door goes down and you usually have a split of the front part of the car to this little I don't know car part car bumper that's underneath the car and then this would be the door itself so the question is how do we make this part here super crisp so the question that was asked to me it was like okay so if I just add a loop here say I'd loop there and we subdivide it you see we get kind of the way there now and let's assume that this is our limit like we want the car door to flow in a certain way and we can't actually add more vertical loops to it so how do we get around that problem now this is where triangles comes into play but Mortain aren't the triangles the most evil thing in the world yes they are the most evil thing in the world and you can never touch them mmm that's not true so I say we wanted to smooth this off it's like to get a smooth circle because like so when you're doing car modeling and I've done my fair bit of caramel ooh hey Pat yeah and I'm not a fan of it either but it did teach me a lot of really good valuable things so I mean basically the less you can get away with the better because making an even car surface or surface for a car when you have a reflective surface can be really tricky enough so the fewer loops you have going across and up the easier it's gonna be for you so my solution for something like this to getting a really nice and crisp edge here is to do with a triangle what I would do is so this edge over here is already at it's already it's already a supporting edge right because you can see we have one edge here and another edge that goes across here so what we could do is just add a loop up that goes up there so you can get it close enough and then we would just move this all the way over here now the problem is that we talked about before maybe we can't do this maybe we can't add more loops maybe we have restrictions for some you have a curved surface and by adding stuff like this yeah everything just goes yeah exactly that's a really good example maybe you have already have a curved surface that goes like this swim so if it were to curve this way if you add a supporting loop up here now you're gonna have to fiddle with the surface to get everything to flow nicely and then it could also just pinch like crazy yeah so the what I would propose for a solution here is just to do this you take that edge delete it from up there and then you just merge that into here now once you subdivide we have a really nice hard edge but evil triangles were cut evil try it but it doesn't actually matter no because what the triangle does here is only serve as a supporting edge around this area and doesn't actually go up and affect our our area up here which is it's the curved area all right so you can see that here now one thing I would try to do to minimize how much the track because you can see the triangle does go up here to fix something it stretched a lot now yeah what I would do is first of all I would add maybe another loop that goes across here but we can do that in like a little bit of a hacky me so I would do multi cut time time yeah so I'll probably add a loop here now I'm not gonna complete this all the way I'll just just end it let's just end it there and then I would merge these two together and I can see we still retain our triangle mm which has the supporting edge close to here so once we subdivide we still have our really nice and crisp edge but without sacrificing any sort of weird stuff and we minimize you see where the triangle is stretching out to we minimize that area quite a lot triangles are not the bevel there oh no there are - the shorter ways of fixing this here but triangles in this case they're fine yeah so one thing we talked about is like what quantify it to make sure you have quite well if you really want to quad easiest way would to be to do this but now you have a quad but nothing has changed no literally nothing has changed except now you have more loops right so you don't necessarily want that another solution we talked about was you could add another loop up here and then basically do that yes you could merge these and then delete that we ended up with another triangle mm-hmm let's ignore that there but that's the solution you could do as well yeah so you know it was good before yeah you could go up here and add the loops up there and that would solve them yeah so let's see also make mistakes sometimes sometimes so here is a curved example now I know this is technically curving the wrong way but let's like see this let's try it I don't know so we just threw in a bend deformer onto this ribbon deformers one these that we just talked about before a quarry now once you understand it you can do amazing things to it if you don't fully it's a tricky one you will do a tutorial and a bend deformer because that is a that's a tricky little thing to get right sometimes yeah so that's like this oh my god nice three of the vendor former right here and now we have a extremely curved surface yeah this is generally a surface surface which is tricky to to wrestle or run with a hard surface in Maya yeah the issue here now there's gonna be a there's gonna be multiple issues here is that first of all if you wanted a curved surface like this let's say on a car right this part here is gonna be straight now on the bottom part you would obviously want to add more supporting loops to get this straight this is just to explain the example a little quicker so add a supporting loop here like we had before this this supporting loop actually let's undo this okay because that supporting loop should technically be in place already so let's pretend that we'd already model something that was super nice like this model here which is super nice yes yes it's been a long time all of two three minutes as obviously like what you would need is have these be spaced out kind of evenly unlike this this is not the ideal situation so I think rotated it's always a funny when you use the performer yeah it really is it took me embarrass a long time to learn ideal so now we have that there so you can see and now we're ending up with that little edge there that we need again for a more production ready example you would add more support items and you don't want your subdivisions to take care of of of the de loops you want you want to look the same yeah in polygon mode as a subdivision mode but here now I'll be able to illustrate the example of like the issue that will rise we can let's see this is a pretty nice and smooth surface here right once you start to add supporting loops obviously that surface is gonna start to bring we don't fin
Thanks for your comment Ollie Paglia, have a nice day.
- Tuan Farinacci, Staff Member
hello everyone in computer graphics we really need two big pieces of data that are triangles or 3d models and textures we'll have a look at textures in the next episode so today we'll discuss triangles to get started I want to have a look at a 3d model for example this fire hydrant if we display it like this it might not immediately be obvious how this can be made out of triangles however if I show this wireframe overlay the model becomes a bit more mathematical it is made out of polygons and polygons are just planar figures made out of line segments for example we've got a triangle made out of three line segments we've got a quadrilateral or quote for short there's also a Pentagon a hexagon heptagon a octagon and I can continue that list for a while I've displayed these polygons in their regular form but I can also draw them in their irregular form which doesn't change anything about their name since name is based on the amount of lines that make them up you might have noticed that the majority of our 3d model is made out of quadrilaterals and that is because they allow you to create horizontal and vertical lines across the model which is easy to work with for 3d artists however that doesn't mean we're limited to using only quotes for example the cap of the fire hydrant is closed with triangles or we could have also used a octagon to close it off this variety of polygons is not easy to work with instead it would be much easier if everything was a triangle because it only contains three points and it simplifies the math down the line quite a lot the process to convert a polygon into a bunch of triangles is called triangulation and there's really two options we have either the polygon is convex or it is concave in a convex polygon all the inner angles are less than 180 degrees I mean a concave polygon there is at least one inner angle that is larger than 180 degrees also any line you draw through a convex polygon will only intersect twice with the polygon and in a concave polygon you can draw at least one line that intersects at least four times the triangulation of a convex polygon is rather easy you just pick a random point and then you move counterclockwise or clockwise which is what I'll do in this case we will skip the first point we encounter and we'll draw a line to the next point we encountered we then continue to mark points and connect them with lines to our original point and of course we don't have to draw a line to our final point because that wouldn't create a new triangle and with that we've triangulated our convex polygon unfortunately this method won't work for the triangulation of a concave polygon but let's try to show why we pick a random point skip the next point and then continue to the next point and draw a line however this line introduces a triangle outside of our concave polygon and therefore changes its shape explaining an algorithm that solves this problem is beyond the scope of this video and you shouldn't really be using concave polygons in 3d models anyways so after triangulation what we end up with is a bunch of triangles and now the question is how we tell the computer about these triangles we do that using a vertex buffer so a triangle consists of three points which in computer graphics we call vertices or it's a singular vertex these vertices are connected with lines which we call edges and in between them goes a face the most important piece of information we need about these vertices are their positions and to do that we'll draw a coordinate system and now we can assign coordinates to the vertices you should think of the coordinates of these vertices as position vectors which means they are vectors that start at the origin we also call these coordinates or positions of our vertices vertex attributes and in this case every vertex has attribute being its position it's now time to introduce our vertex buffer which is a location in memory in which we can store all these attributes given this vertex buffer a computer will be able to recreate our triangle it does that by starting at the first vertex in the vertex buffer drawing a line to the second vertex drawing a line to the third vertex and enclosing off by going back to the first vertex the order in which the vertices are stored in the vertex buffer is quite important because it determines the winding order if you paid close attention you'll have seen that we moved in a clockwise direction if we change the order of the vertex buffer then the order in which the triangle gets generated will change and therefore the winding order will now be counterclockwise when it comes to you for ticks attributes we're not limited to the position only we can assign any attributes we want for example a color these color attributes would get stored in the vertex buffer together with all the other attributes of that vertex what's interesting about vertex attributes is that they get interpolated across a triangles surface so if we visualize the color we get this kind of rainbow triangle since the red green and blue colors get interpolated if we want to know the position of this point for example the computer can calculate that its coordinate is 0 for the x y&z axis by interpolating the 3 positions of our vertices there is a small problem with vertex buffers however and to solve that problem I'll need to introduce the index buffer let's say we don't wanna draw a triangle but instead we want a square which is of course made out of two triangles if we want to store the information of this square in our vertex buffer all we need to do is add the vertices of our first triangle and append vertices of our second triangle now every three elements in the vertex buffer represent a triangle and we could append even more triangles just by adding their data to the vertex the problem with this however is that the top left vertices are duplicated and the bottom right vertices are duplicated it would be much nicer if we could delete these duplicates and only store unique values in the vertex buffer however now triangles are no longer grouped in groups of three the first step in solving this problem is to assign an index to every vertex that index starts at zero because programmers start counting from zero and goes all the way up to the amount of vertices that there are to now recreate our triangles we'll need an index buffer in which we're gonna stored indices of the vertices of every triangle so for the first triangle that is 0 1 and 2 and for the second triangle that is 0 2 and 3 and you notice that we adhere to the same wining order for every triangle in these buffers we can now use the index buffer to recreate our triangles every three elements in it represent a triangle and the index in the index buffer can be used to look up the correct attributes for each vertex finally I wanted to talk about vertex normals given this triangle it's normal is a vector that points perpendicular to its surface and on a 2d screen that's kind of difficult to represent so you should think of a blue vector as pointing outwards of your screen a 3d modeling software usually provides us with these nor
Thanks Diego your participation is very much appreciated
- Tuan Farinacci
About the author
I've studied algebraic geometry at University of Chicago in Chicago and I am an expert in space exploration. I usually feel blank. My previous job was hazardous waste management analyst I held this position for 12 years, I love talking about transit map collecting and baking. Huge fan of Leonardo Nam I practice nordic combined and collect baseball cards.
Try Not to laugh !
Joke resides here...