OBB-puun generoiminen Unity Enginessä
Tuohino, Jere (2021)
Tuohino, Jere
2021
All rights reserved. This publication is copyrighted. You may download, display and print it for Your own personal use. Commercial use is prohibited.
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:amk-2021120122945
https://urn.fi/URN:NBN:fi:amk-2021120122945
Tiivistelmä
Tässä opinnäytetyössä kehitetään Unity-pelimoottoriin työkalu, jonka tarkoituksena on luoda OBB-puun teorian mukainen törmäytin annetulle mallille. OBB-puulla pyritään saavuttamaan tarkempaa mallin mukaista törmäytintä, kuin mitä esimerkiksi konveksipeitteellä saadaan konkaavin mallin kanssa.
OBB-puu generoituu jakamalla alkuperäistä OBB-rajausaluetta ja siitä tulleita jakoja. Tätä jatketaan, kunnes yhdessäkään jaossa mallin syvyys alueen sisällä ei muutu annetun raja-arvon ylitse.
Opinnäytetyössä OBB-puun generoimisessa käytetään pohjana Chuhua Xian, Hongwei Lin ja Shuming Gaon kehittämää tutkimusta nimeltä Automatic cage generation by improved OBBs for mesh deformation. Tässä tutkimuksessa OBB-puun teko toteutetaan OBB-puun perinteisellä teorialla, poiketen OBB:n jakamisvaiheessa. Perinteisen jakosäännön sijaan tutkimuksessa toteutetaan monimutkaisempi algoritmi, jolla saavutetaan puhtaampi lopputulos.
Opinnäytetyön alussa käydään lävitse työkaluun liittyvät yleiset termit ja käytänteet, kuten rajausalueet, törmäyttimet ja vokselit. Myöhemmin opinnäytetyössä käydään OBB-puun luomisen prosessi askel askeleelta lävitse, avataan sen teoria tarkemmin ja päätetään kertomalla lopputulos, mihin opinnäytetyötä tehdessä päästiin, mitä ongelmakohtia tuli vastaan ja mikä on työkalun tulevaisuus.
Lopputuloksena opinnäytetyöstä koostuu työkalu, jolla pystyy jakamaan testimallina esitetyn 3D-mallin käsipainosta loogisesti kolmeen laatikkoon. This thesis develops a tool for game development within Unity Engine. The purpose for the developed tool is to generate a collider from an OBB-tree. The goal for using an OBB-tree for the generation of a collider is to achieve a more accurate one than what a mesh collider would offer.
An OBB-tree is generated by dividing the original mesh’s OBB and its divisions. This dividing process is continued till no mesh’s depth within the divisions changes over a given threshold.
For the generation of the OBB-tree, this thesis follows a study created by Chuhua Xian, Hongwei Lin and Shuming Gao called Automatic cage generation by improved OBBs for mesh deformation. The study follows the traditional method of generating an OBB-tree, but differs in the splitting part, where they introduce a new way of splitting the OBBs, which produces more clean results than the traditional way.
The beginning of the thesis focuses on defining the general terms and methods used in the tool, such as bounding boxes, colliders, and voxels. After the theory section the focus shifts toward the development of the tool, going through the steps one by one, and explains the theory a bit more in detail. The last section of the thesis goes through the result, where it can be utilized at that point and what is the future of the tool.
The result from the thesis is a tool that can divide a given 3D-model of a weight logically into three different bounding boxes.
OBB-puu generoituu jakamalla alkuperäistä OBB-rajausaluetta ja siitä tulleita jakoja. Tätä jatketaan, kunnes yhdessäkään jaossa mallin syvyys alueen sisällä ei muutu annetun raja-arvon ylitse.
Opinnäytetyössä OBB-puun generoimisessa käytetään pohjana Chuhua Xian, Hongwei Lin ja Shuming Gaon kehittämää tutkimusta nimeltä Automatic cage generation by improved OBBs for mesh deformation. Tässä tutkimuksessa OBB-puun teko toteutetaan OBB-puun perinteisellä teorialla, poiketen OBB:n jakamisvaiheessa. Perinteisen jakosäännön sijaan tutkimuksessa toteutetaan monimutkaisempi algoritmi, jolla saavutetaan puhtaampi lopputulos.
Opinnäytetyön alussa käydään lävitse työkaluun liittyvät yleiset termit ja käytänteet, kuten rajausalueet, törmäyttimet ja vokselit. Myöhemmin opinnäytetyössä käydään OBB-puun luomisen prosessi askel askeleelta lävitse, avataan sen teoria tarkemmin ja päätetään kertomalla lopputulos, mihin opinnäytetyötä tehdessä päästiin, mitä ongelmakohtia tuli vastaan ja mikä on työkalun tulevaisuus.
Lopputuloksena opinnäytetyöstä koostuu työkalu, jolla pystyy jakamaan testimallina esitetyn 3D-mallin käsipainosta loogisesti kolmeen laatikkoon.
An OBB-tree is generated by dividing the original mesh’s OBB and its divisions. This dividing process is continued till no mesh’s depth within the divisions changes over a given threshold.
For the generation of the OBB-tree, this thesis follows a study created by Chuhua Xian, Hongwei Lin and Shuming Gao called Automatic cage generation by improved OBBs for mesh deformation. The study follows the traditional method of generating an OBB-tree, but differs in the splitting part, where they introduce a new way of splitting the OBBs, which produces more clean results than the traditional way.
The beginning of the thesis focuses on defining the general terms and methods used in the tool, such as bounding boxes, colliders, and voxels. After the theory section the focus shifts toward the development of the tool, going through the steps one by one, and explains the theory a bit more in detail. The last section of the thesis goes through the result, where it can be utilized at that point and what is the future of the tool.
The result from the thesis is a tool that can divide a given 3D-model of a weight logically into three different bounding boxes.