Calculating normals for a polygon mesh (3D computer graphics)
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I want to write a program to generate arches, a common architectural form, and export them to a wavefront object format for sharing with various three dimensional graphics editors. To do this, I need to generate normals for inclusion in the wavefront object. I understand that normals represent the orientation of a surface at a vertex. I need to understand how to calculate them, and specifically what the i,j,k coordinates signify.
computer-science 3d
add a comment |
up vote
1
down vote
favorite
I want to write a program to generate arches, a common architectural form, and export them to a wavefront object format for sharing with various three dimensional graphics editors. To do this, I need to generate normals for inclusion in the wavefront object. I understand that normals represent the orientation of a surface at a vertex. I need to understand how to calculate them, and specifically what the i,j,k coordinates signify.
computer-science 3d
You may want to look at en.wikipedia.org/wiki/Cross_product. Although, calculating the normal from your mesh is going to make your shading look not as smooth compared to calculating your normal from the actual equation of the thing you are approximating. This course udacity.com/course/cs291 also has more info.
– Steven Gubkin
Dec 9 '13 at 14:19
Face normals are easy to compute, per Omnomnomnom's answer. Vertex normals can then be obtained through a weighted average of the face normals; see e.g. Max's paper.
– J. M. is not a mathematician
Dec 27 '16 at 5:33
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I want to write a program to generate arches, a common architectural form, and export them to a wavefront object format for sharing with various three dimensional graphics editors. To do this, I need to generate normals for inclusion in the wavefront object. I understand that normals represent the orientation of a surface at a vertex. I need to understand how to calculate them, and specifically what the i,j,k coordinates signify.
computer-science 3d
I want to write a program to generate arches, a common architectural form, and export them to a wavefront object format for sharing with various three dimensional graphics editors. To do this, I need to generate normals for inclusion in the wavefront object. I understand that normals represent the orientation of a surface at a vertex. I need to understand how to calculate them, and specifically what the i,j,k coordinates signify.
computer-science 3d
computer-science 3d
asked Dec 9 '13 at 13:50
John Spragge
62
62
You may want to look at en.wikipedia.org/wiki/Cross_product. Although, calculating the normal from your mesh is going to make your shading look not as smooth compared to calculating your normal from the actual equation of the thing you are approximating. This course udacity.com/course/cs291 also has more info.
– Steven Gubkin
Dec 9 '13 at 14:19
Face normals are easy to compute, per Omnomnomnom's answer. Vertex normals can then be obtained through a weighted average of the face normals; see e.g. Max's paper.
– J. M. is not a mathematician
Dec 27 '16 at 5:33
add a comment |
You may want to look at en.wikipedia.org/wiki/Cross_product. Although, calculating the normal from your mesh is going to make your shading look not as smooth compared to calculating your normal from the actual equation of the thing you are approximating. This course udacity.com/course/cs291 also has more info.
– Steven Gubkin
Dec 9 '13 at 14:19
Face normals are easy to compute, per Omnomnomnom's answer. Vertex normals can then be obtained through a weighted average of the face normals; see e.g. Max's paper.
– J. M. is not a mathematician
Dec 27 '16 at 5:33
You may want to look at en.wikipedia.org/wiki/Cross_product. Although, calculating the normal from your mesh is going to make your shading look not as smooth compared to calculating your normal from the actual equation of the thing you are approximating. This course udacity.com/course/cs291 also has more info.
– Steven Gubkin
Dec 9 '13 at 14:19
You may want to look at en.wikipedia.org/wiki/Cross_product. Although, calculating the normal from your mesh is going to make your shading look not as smooth compared to calculating your normal from the actual equation of the thing you are approximating. This course udacity.com/course/cs291 also has more info.
– Steven Gubkin
Dec 9 '13 at 14:19
Face normals are easy to compute, per Omnomnomnom's answer. Vertex normals can then be obtained through a weighted average of the face normals; see e.g. Max's paper.
– J. M. is not a mathematician
Dec 27 '16 at 5:33
Face normals are easy to compute, per Omnomnomnom's answer. Vertex normals can then be obtained through a weighted average of the face normals; see e.g. Max's paper.
– J. M. is not a mathematician
Dec 27 '16 at 5:33
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
If you're creating a polygon mesh, presumably you'll want normal vector given a particular triangular face.
First of all, definitions: a normal on some point of a surface is a vector that points perpendicular to that surface at that point. Since each surface (locally) has two sides, you have two valid directions of normal-vectors: one side on which the vector would point towards the surface, and one side on which the vector would point away from the surface.
Now, suppose you have a triangle determined by the three points $a = (a_1,a_2,a_3), b = (b_1,b_2,b_3),$ and $c = (c_1,c_2,c_3)$. Define
$$
v_ab=(b_1-a_1,b_2-a_2,b_3-a_3)\
v_bc=(c_1-b_1,c_2-b_2,c_3-b_3)
$$
In order to find a normal vector, calculate $v_abtimes v_bc$ or, for the opposite orientation, $v_bc times v_ab$, where "$times$" here denotes the cross-product.
Let me know if I can explain anything above more thoroughly
– Omnomnomnom
Dec 9 '13 at 14:19
how would you create (approx) a sphere? considering that the minimum surface unit given is a triangle? in other words, how would you triangular mesh a sphere? (here the sphere is taken as an example for any object)
– Anonymous
Jun 25 '17 at 5:11
@Anonymous you should post a new question about that.
– Omnomnomnom
Jun 25 '17 at 6:05
I think I got it, $A_i = r(theta_i, phi_i) ; B_i = r(theta_i, phi_i +Deltaphi) ; C_i = r(theta_i +Deltatheta, phi_i)$ where $vecr=(costhetasinphi,sinthetasinphi,cosphi)$ and then iterate $0 leq theta leq 2pi$ and $0leq phi leq pi$ as $theta_i = theta_i-1+Deltatheta$
– Anonymous
Jun 25 '17 at 6:21
so in general, parametrize the surface with 2 variables, and to triangular mesh vary each variable.
– Anonymous
Jun 25 '17 at 6:22
|
show 3 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
If you're creating a polygon mesh, presumably you'll want normal vector given a particular triangular face.
First of all, definitions: a normal on some point of a surface is a vector that points perpendicular to that surface at that point. Since each surface (locally) has two sides, you have two valid directions of normal-vectors: one side on which the vector would point towards the surface, and one side on which the vector would point away from the surface.
Now, suppose you have a triangle determined by the three points $a = (a_1,a_2,a_3), b = (b_1,b_2,b_3),$ and $c = (c_1,c_2,c_3)$. Define
$$
v_ab=(b_1-a_1,b_2-a_2,b_3-a_3)\
v_bc=(c_1-b_1,c_2-b_2,c_3-b_3)
$$
In order to find a normal vector, calculate $v_abtimes v_bc$ or, for the opposite orientation, $v_bc times v_ab$, where "$times$" here denotes the cross-product.
Let me know if I can explain anything above more thoroughly
– Omnomnomnom
Dec 9 '13 at 14:19
how would you create (approx) a sphere? considering that the minimum surface unit given is a triangle? in other words, how would you triangular mesh a sphere? (here the sphere is taken as an example for any object)
– Anonymous
Jun 25 '17 at 5:11
@Anonymous you should post a new question about that.
– Omnomnomnom
Jun 25 '17 at 6:05
I think I got it, $A_i = r(theta_i, phi_i) ; B_i = r(theta_i, phi_i +Deltaphi) ; C_i = r(theta_i +Deltatheta, phi_i)$ where $vecr=(costhetasinphi,sinthetasinphi,cosphi)$ and then iterate $0 leq theta leq 2pi$ and $0leq phi leq pi$ as $theta_i = theta_i-1+Deltatheta$
– Anonymous
Jun 25 '17 at 6:21
so in general, parametrize the surface with 2 variables, and to triangular mesh vary each variable.
– Anonymous
Jun 25 '17 at 6:22
|
show 3 more comments
up vote
0
down vote
If you're creating a polygon mesh, presumably you'll want normal vector given a particular triangular face.
First of all, definitions: a normal on some point of a surface is a vector that points perpendicular to that surface at that point. Since each surface (locally) has two sides, you have two valid directions of normal-vectors: one side on which the vector would point towards the surface, and one side on which the vector would point away from the surface.
Now, suppose you have a triangle determined by the three points $a = (a_1,a_2,a_3), b = (b_1,b_2,b_3),$ and $c = (c_1,c_2,c_3)$. Define
$$
v_ab=(b_1-a_1,b_2-a_2,b_3-a_3)\
v_bc=(c_1-b_1,c_2-b_2,c_3-b_3)
$$
In order to find a normal vector, calculate $v_abtimes v_bc$ or, for the opposite orientation, $v_bc times v_ab$, where "$times$" here denotes the cross-product.
Let me know if I can explain anything above more thoroughly
– Omnomnomnom
Dec 9 '13 at 14:19
how would you create (approx) a sphere? considering that the minimum surface unit given is a triangle? in other words, how would you triangular mesh a sphere? (here the sphere is taken as an example for any object)
– Anonymous
Jun 25 '17 at 5:11
@Anonymous you should post a new question about that.
– Omnomnomnom
Jun 25 '17 at 6:05
I think I got it, $A_i = r(theta_i, phi_i) ; B_i = r(theta_i, phi_i +Deltaphi) ; C_i = r(theta_i +Deltatheta, phi_i)$ where $vecr=(costhetasinphi,sinthetasinphi,cosphi)$ and then iterate $0 leq theta leq 2pi$ and $0leq phi leq pi$ as $theta_i = theta_i-1+Deltatheta$
– Anonymous
Jun 25 '17 at 6:21
so in general, parametrize the surface with 2 variables, and to triangular mesh vary each variable.
– Anonymous
Jun 25 '17 at 6:22
|
show 3 more comments
up vote
0
down vote
up vote
0
down vote
If you're creating a polygon mesh, presumably you'll want normal vector given a particular triangular face.
First of all, definitions: a normal on some point of a surface is a vector that points perpendicular to that surface at that point. Since each surface (locally) has two sides, you have two valid directions of normal-vectors: one side on which the vector would point towards the surface, and one side on which the vector would point away from the surface.
Now, suppose you have a triangle determined by the three points $a = (a_1,a_2,a_3), b = (b_1,b_2,b_3),$ and $c = (c_1,c_2,c_3)$. Define
$$
v_ab=(b_1-a_1,b_2-a_2,b_3-a_3)\
v_bc=(c_1-b_1,c_2-b_2,c_3-b_3)
$$
In order to find a normal vector, calculate $v_abtimes v_bc$ or, for the opposite orientation, $v_bc times v_ab$, where "$times$" here denotes the cross-product.
If you're creating a polygon mesh, presumably you'll want normal vector given a particular triangular face.
First of all, definitions: a normal on some point of a surface is a vector that points perpendicular to that surface at that point. Since each surface (locally) has two sides, you have two valid directions of normal-vectors: one side on which the vector would point towards the surface, and one side on which the vector would point away from the surface.
Now, suppose you have a triangle determined by the three points $a = (a_1,a_2,a_3), b = (b_1,b_2,b_3),$ and $c = (c_1,c_2,c_3)$. Define
$$
v_ab=(b_1-a_1,b_2-a_2,b_3-a_3)\
v_bc=(c_1-b_1,c_2-b_2,c_3-b_3)
$$
In order to find a normal vector, calculate $v_abtimes v_bc$ or, for the opposite orientation, $v_bc times v_ab$, where "$times$" here denotes the cross-product.
answered Dec 9 '13 at 14:18
Omnomnomnom
124k786174
124k786174
Let me know if I can explain anything above more thoroughly
– Omnomnomnom
Dec 9 '13 at 14:19
how would you create (approx) a sphere? considering that the minimum surface unit given is a triangle? in other words, how would you triangular mesh a sphere? (here the sphere is taken as an example for any object)
– Anonymous
Jun 25 '17 at 5:11
@Anonymous you should post a new question about that.
– Omnomnomnom
Jun 25 '17 at 6:05
I think I got it, $A_i = r(theta_i, phi_i) ; B_i = r(theta_i, phi_i +Deltaphi) ; C_i = r(theta_i +Deltatheta, phi_i)$ where $vecr=(costhetasinphi,sinthetasinphi,cosphi)$ and then iterate $0 leq theta leq 2pi$ and $0leq phi leq pi$ as $theta_i = theta_i-1+Deltatheta$
– Anonymous
Jun 25 '17 at 6:21
so in general, parametrize the surface with 2 variables, and to triangular mesh vary each variable.
– Anonymous
Jun 25 '17 at 6:22
|
show 3 more comments
Let me know if I can explain anything above more thoroughly
– Omnomnomnom
Dec 9 '13 at 14:19
how would you create (approx) a sphere? considering that the minimum surface unit given is a triangle? in other words, how would you triangular mesh a sphere? (here the sphere is taken as an example for any object)
– Anonymous
Jun 25 '17 at 5:11
@Anonymous you should post a new question about that.
– Omnomnomnom
Jun 25 '17 at 6:05
I think I got it, $A_i = r(theta_i, phi_i) ; B_i = r(theta_i, phi_i +Deltaphi) ; C_i = r(theta_i +Deltatheta, phi_i)$ where $vecr=(costhetasinphi,sinthetasinphi,cosphi)$ and then iterate $0 leq theta leq 2pi$ and $0leq phi leq pi$ as $theta_i = theta_i-1+Deltatheta$
– Anonymous
Jun 25 '17 at 6:21
so in general, parametrize the surface with 2 variables, and to triangular mesh vary each variable.
– Anonymous
Jun 25 '17 at 6:22
Let me know if I can explain anything above more thoroughly
– Omnomnomnom
Dec 9 '13 at 14:19
Let me know if I can explain anything above more thoroughly
– Omnomnomnom
Dec 9 '13 at 14:19
how would you create (approx) a sphere? considering that the minimum surface unit given is a triangle? in other words, how would you triangular mesh a sphere? (here the sphere is taken as an example for any object)
– Anonymous
Jun 25 '17 at 5:11
how would you create (approx) a sphere? considering that the minimum surface unit given is a triangle? in other words, how would you triangular mesh a sphere? (here the sphere is taken as an example for any object)
– Anonymous
Jun 25 '17 at 5:11
@Anonymous you should post a new question about that.
– Omnomnomnom
Jun 25 '17 at 6:05
@Anonymous you should post a new question about that.
– Omnomnomnom
Jun 25 '17 at 6:05
I think I got it, $A_i = r(theta_i, phi_i) ; B_i = r(theta_i, phi_i +Deltaphi) ; C_i = r(theta_i +Deltatheta, phi_i)$ where $vecr=(costhetasinphi,sinthetasinphi,cosphi)$ and then iterate $0 leq theta leq 2pi$ and $0leq phi leq pi$ as $theta_i = theta_i-1+Deltatheta$
– Anonymous
Jun 25 '17 at 6:21
I think I got it, $A_i = r(theta_i, phi_i) ; B_i = r(theta_i, phi_i +Deltaphi) ; C_i = r(theta_i +Deltatheta, phi_i)$ where $vecr=(costhetasinphi,sinthetasinphi,cosphi)$ and then iterate $0 leq theta leq 2pi$ and $0leq phi leq pi$ as $theta_i = theta_i-1+Deltatheta$
– Anonymous
Jun 25 '17 at 6:21
so in general, parametrize the surface with 2 variables, and to triangular mesh vary each variable.
– Anonymous
Jun 25 '17 at 6:22
so in general, parametrize the surface with 2 variables, and to triangular mesh vary each variable.
– Anonymous
Jun 25 '17 at 6:22
|
show 3 more comments
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f599803%2fcalculating-normals-for-a-polygon-mesh-3d-computer-graphics%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
You may want to look at en.wikipedia.org/wiki/Cross_product. Although, calculating the normal from your mesh is going to make your shading look not as smooth compared to calculating your normal from the actual equation of the thing you are approximating. This course udacity.com/course/cs291 also has more info.
– Steven Gubkin
Dec 9 '13 at 14:19
Face normals are easy to compute, per Omnomnomnom's answer. Vertex normals can then be obtained through a weighted average of the face normals; see e.g. Max's paper.
– J. M. is not a mathematician
Dec 27 '16 at 5:33