[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/sci/ - Science & Math


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


hey, so I've been making a 3d editing software. I've been stuck on face extrusion for a day or so.
when I extrude a face (move it in a given direction and connect it with new polygons) some of the new quads end up facing the wrong direction (inwards). how can I detect this mathematically?

You can do the cross product to determine the quad's normal vector, but I honestly have no clue how to tell if the normal is correct. (of course visually it's quiet obvious when it's flipped) I tried taking the angle between the normal and the extrude direction but its always at 90 degrees, (never -90) so that's a dead end. you can check if the normal facing towards the 'center' of the shape or away. but that won't work for concave shapes
>>
>>16146039
compute normals of adjacent polys and set new polys' normals such that they have an inner product that is positive. if you interpret the new polys as a ribbon, then you only have to do the preceding calculation once for the first poly and then set the order of the points in the ribbon so that new polys have a normal consistent with the first one
>>
>>16146039
dot product between the original face normal and the new face normals - positive, pointing in the same direction as the original
>>
>>16146039
this is not science or math gtfo.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.