Articles on imaj_ashwini's Bloghttps://blogs.python-gsoc.orgUpdates on different articles published on imaj_ashwini's BlogenThu, 03 Sep 2020 20:29:09 +0000Week 14 blog!https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-14-blog/<p>Hi everyone</p> <p>This is the last blog for GSoC 2020. It was an amazing journey and an experience to cherish for lifetime. <br> I would like to thank Google for giving us, students this platform and Python Software Foundation for leading so many sub-organisations and the students towards the world of open source.<br> The mentors I got were amazing, probably I could not have asked for better mentors. </p> <p>My work can be found here: <a href="https://github.com/panda3d/panda3d/pull/950">https://github.com/panda3d/panda3d/pull/950</a></p> <p>Thank you</p> <p>Everyone, stay safe and happy :)</p>cse170001012@iiti.ac.in (imaj_ashwini)Thu, 03 Sep 2020 20:29:09 +0000https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-14-blog/Week 13 Check-in!https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-13-check-in/<p>Hello everyone</p> <p>The coding period of Google Summer of Code 2020 is finally over. In the last week of this program, I made my Pull Request ready to be merged. With the help of mentors, I resolved the merge conflict.<br> Additionally, I implemented a new feature to debug the navigation mesh. I added the cull_calback(), is_renderable() and some other functions to make debugging process a lot more easier. <br> Earlier, the user had to get the geom node as output from NavMesh::draw_nav_mesh_geom() and then attach it to a nodepath in the render graph. Now, the user just has to attach a nodepath to NavMeshNode, lets call it navmeshnodepath, and then call navmeshnodepath.show() to show the navigation mesh and navmeshnodepath.hide() to hide the navigation mesh.<br> I have also added a short implementation in the sample code in panda directory : samples/navigation/main.py</p> <p>So this was it for this week. A wonderful summer has come to an end, but taught me a lot. This summer I was introduced to the world of open source and I will surely keep contributing to open source projects, including Panda3D. I was really fortunate to have 2 great mentors. Both @rdb and @moguri were always available to help me out in whatever problem I stuck in.</p> <p>Thank you everyone and more especially Python Software Foundation and Google for such a great learning experience.</p>cse170001012@iiti.ac.in (imaj_ashwini)Thu, 27 Aug 2020 12:26:03 +0000https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-13-check-in/Week 12 blog!https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-12-blog/<p>Hello everyone</p> <p>This is the final week of the GSoC 2020 Coding Period. It has been a great journey so far and more importantly, I got to learn a lot.<br> As mentioned in the previous blog, the last week was spent in resolving the PR reviews. I was able to resolve most of it.<br> I added docstrings for all the functions in the cxx files, added more properties to be set by the user for building the navigation mesh.<br> I also added a new function add_polygon() for the user to add extra polygons to the input geometry, which would then be processed as vertices and triangles to generate the navmesh. Two overloaded functions have been implemented for the same, one with three LPoint3 input arguments, i.e. a triangle polygon as input, while other with a PTA_LVecBase3 input argument, i.e. a polygon with more than two vertices as input.<br> I removed the unnecessary comments and debug statements from the code, cleaned it up. I used the Panda3d's config to notify, like navigation_cat.error(), navigation_cat.info() etc. Also since panda3d's world units need not be always Z-up, so the mentors suggested to implement a transformation matrix which would convert the points from Panda3D's default coordinate system to Y-up coordinate system (Recast navigation's coordinate system) and then back to Panda3D's default.<br> This week, being the final week, I need to prepare for the code submission and resolve the remaining PR reviews.</p> <p>It was a great summer!<br> Thank you! Stay safe always!<br> Ashwini</p> <p> </p>cse170001012@iiti.ac.in (imaj_ashwini)Thu, 20 Aug 2020 06:14:32 +0000https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-12-blog/Week 11 Check in!https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-11-check-in/<p>Hi everyone</p> <p>Now we are into the second last week of the Official Coding period for GSoC'20 ! The previous week was basically me involved in completing the sample code for navigation.<br> We selected a new environment for the sample with a better license. The previous code of the sample program was almost completely removed and a fresh code was written explaining a lot more features of the navigation and navmeshgen libraries.<br> Raycasting has been implemented in order to find the destination based on the position of a mouse click. So now if a mouse is clicked, then the two-dimensional position of the cursor is then used to find the corresponding three-dimensional position in the panda3d world coordinates, which is then set as new destination. Now the user can change the destination and find a new path even while an actor is already traveling on the previous path. The current position of the actor in the middle of the path will be set as starting point.</p> <p><img alt="" src="/media/uploads/5ae4623c-7496-41b1-ad2e-4114799cad5c.gif"></p> <p>The GIF above shows the dynamic path-finding ability of the sample program. Yellow lines are the output of find_straight_path() while the green ones are output of find_path(). The panda has been programmed to move on the yellow line.</p> <p>This was all for the previous week. This week I am focusing on the PR reviews so that we can have the PR merged as soon as possible.</p> <p>Thank you. Stay Safe!</p>cse170001012@iiti.ac.in (imaj_ashwini)Thu, 13 Aug 2020 01:37:51 +0000https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-11-check-in/Week 10 Bloghttps://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-10-blog/<p>Hello everyone</p> <p>I know I am late for the weekly blog. My apologies for that.<br> The previous week was my first week post my exams. I had mentioned in the last blog that I will be working on the documentation for panda3d.<br> So, just as I mentioned, I was able to complete the documentation part in one week. The documentation includes documentation for both python and c++, the languages supported by panda3d for game development. The appropriate code snippets have been included along with the screenshots of the corresponding output.<br> The challenges were to understand the reStructured text format by Sphinx ans write the code for documentation with proper identation and tags so as to build separate docs for python and c++.<br> You may find the Pull Request here: <a href="https://github.com/panda3d/panda3d-docs/pull/71">#71</a></p> <p>This week I am working on the sample code. Some part of work has been done and hopefully it will be completed by the weekend. I will share more about the same in my next blog.</p> <p>Thank you!</p> <p>Stay Safe!</p>cse170001012@iiti.ac.in (imaj_ashwini)Thu, 06 Aug 2020 21:05:09 +0000https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-10-blog/Week 9 Check In!https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-9-check-in/<p>Hello everyone</p> <p>Another week passed and here I am with another blog.</p> <p>The last week, unfortunately, was not productive as I did not contribute much to the panda3d project due to my university exams, which I mentioned in the last week's blog. I had informed my mentors about this academic situation and they were really supportive to let me focus on my exams for one week. Thanks to them, my exams went well and now I am back to working on the project.<br> After my last blog, I had started working on the documentation and had written some part of python docs in Sphinx's reStructured text format (.rst). I had also got a review on my PR by the mentor. This week I will work on the review, complete the Python Docs and then C++ docs as well. After that, I shall update the sample code as well.</p> <p>See you all next week which should be much more productive than this one. XD<br> Thank you and Stay Safe!</p>cse170001012@iiti.ac.in (imaj_ashwini)Wed, 29 Jul 2020 00:43:58 +0000https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-9-check-in/Week 8 blog!https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-8-blog/<p>Hello everyone.<br> The is week 8 of the Google Summer of Code program. The last week wasn't a lot of work done. I did add some BAM test files, added visualization function to NavMesh class similar to NavMeshBuilder class. So, now draw_nav_mesh_geom() in NavMesh class would work the same way as draw_poly_mesh_geom() in NavMeshBuilder class and can be accessed through even NavMeshNode class.<br> BAM test files can be found in the Tests folder. A BAM object is created and read over in the test functions to test against the original values. So these were two main things I added in the previous week. <br> Along with them, I have started working on the documentation. It uses Sphinx's reStructured text (.rst) format. I have got familiar to it's coding / formatting styles.<br> Also, I have added a new class NavMeshParams in the navigation library. So, the user can add custom vertices and faces to generate the navigation mesh without using the navmeshgen library. Or maybe, the user can get the navigation mesh generated using some other library and then write code to parse it into NavMesh class using NavMeshParams class.</p> <p>This week I have my academic load in form of end semester university exams. So I would not able to do much for the GSoC project. I have informed my mentors regarding the same. So probably I would not have much to write about next week.</p> <p>Still, lets see if I can complete some part of the documentation during my exams. <br> Till then, stay safe :)</p>cse170001012@iiti.ac.in (imaj_ashwini)Thu, 23 Jul 2020 09:51:55 +0000https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-8-blog/Week 7 check-in!https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-7-check-in-1/<p>Hello everyone</p> <p>So we are into Week #7 now. In the last week, we were done with integrating query functions and I had mentioned that next I would be working on BAM serialization.</p> <p>So yes, BAM serialization took me some time to get the feel of, though finally I was able to implement in successfully with the help of mentors. BAM serialization gives the users and game developers ability to save the generated navmesh in their hard disk and load it from there whenever required. This can be really helpful in games as a lot of time and computational power required to generate navmesh will be saved and hence the games would load faster. So, as for this week, this was the major development done. </p> <p>Where did I get stuck? Well, BAM serialization was a totally new concept for me and hence I was stuck in the process of understanding it. Once I understood the concept and how the functions implement it, then it was quite easy to code, though there were moments i got stuck while compiling after implementing BAM serialization. Mentors rescued me there. XD<br> <br> For next week, I have few things on card: Writing Test Files for BAM, sample code and making more user friendly functions so that users do not have to dig deep into objects to use basic API functions. After that, a few more changes as per the PR review.</p> <p>See you next week :) </p> <p>Stay Safe</p>cse170001012@iiti.ac.in (imaj_ashwini)Tue, 14 Jul 2020 23:57:28 +0000https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-7-check-in-1/Week 6 Bloghttps://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-6-blog/<p>Hello everyone!<br> So its the beginning of the sixth week. The first evaluation results are out and fortunately, I made it till here. :D<br> This week I implemented the query functions present in DetourNavMeshQuery class. There are primarily two query functions: <strong>findPath()</strong> and<strong> findStraightPath()</strong>. Both have their own uses. The implementation initially looked to be easy, but got real complex when I started coding. There were many other function calls I had to make in order to implement these two functions, and in process taking care of the variables involved.</p> <p>Both the functions have their usecases. FindPath() returns the polygons present in the path corridor. Then, its over to us how we connect polygons to complete the path. FindStraightPath() directly returns array of vertices. Here I present an example for each path finding query:</p> <p style="text-align: center;"><img alt="" src="/media/uploads/eb051113-9fdd-48ea-a6fa-c6dabc05be78.png"></p> <p style="text-align: center;"><img alt="" src="/media/uploads/8a6a39d8-2994-47e6-b259-6b77100d4f40.png"></p> <p> </p> <p>The green line shows the path in both the above images. The first image makes the findPath() query while the second one makes the findStraightPath() query.<br> Though, on the basis of these two images, you might conclude that findStraightPath() is obviously better among the two, but trust me, you won't always want to use findStraightPath(). You will know when you use it. :P</p> <p>Apart from this, I spent time in dividing the library into 2 separate libraries: navmeshgen and navigation. The <strong>navmeshgen</strong> library provides tool to generate the polygon mesh, detail polygon mesh and navmesh. The <strong>navigation</strong> library provides tool to further process the <em>navmesh</em> and make queries over it. Recast, NavMeshBuilder are included in <strong>navmeshgen</strong> while Detour, NavMesh, NavMeshNode, NavMeshQuery are included in <strong>navigation</strong>.<br> <br> This week I plan to make BAM serialization possible and work on the reviews made by mentor @moguri over my PR at Github.</p> <p>Will return next week with more exciting stuff. Till then, stay safe!</p> <p> </p> <p> </p>cse170001012@iiti.ac.in (imaj_ashwini)Tue, 07 Jul 2020 19:01:53 +0000https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-6-blog/Week 5 Checkin!https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-5-checkin/<p>Hello everyone,</p> <p>This week I worked on the PR.<br> The code was not exactly python ready. So I along with my mentors worked on making the code ready for use in python. Giving PUBLISHED access to exposed functions and members and especially, debugging while compiling the code was challenging. I was stuck many times while compiling the code to make it python ready.</p> <p>Now we can access the recast tools from python environment. This feature especially amazes me. This is the first time I have worked on something where I am writing library in C++, but using it in Python. This felt so good after being successfully done. I wrote sample codes for debugging in both python and C++, but believe me, the experience of using python to call C++ libraries felt so good. It was so easy and smooth.</p> <p>After doing this, I wrote test file in python for the functions coded till now. Also, I wrote a sample code in python to add to the panda3d repository and to explain how does it work.</p> <p>Next task is to implement the query functions. Will complete this week probably. Till then, stay safe !</p> <p> </p>cse170001012@iiti.ac.in (imaj_ashwini)Tue, 30 Jun 2020 20:27:38 +0000https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-5-checkin/Week 4 bloghttps://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-4-blog/<p>Hello everyone,</p> <p>We are into the fourth week now, and closing into the first month. Last week, I rearranged all my functions and classes so that it becomes more readable, organised and clean. Now the main classes and the funtions involved in the integration of recast/detour into Panda3D are:</p> <ul> <li>NavMesh <ul> <li>It stores the navigation mesh generated by NavMeshBuilder class.</li> <li>It can called as an object, or more Panda3D specifically, as PT(NavMesh) object, which is Panda3D's own Pointer declaration.</li> </ul> </li> <li>NavMeshBuilder <ul> <li>It takes the nodepath as input from the user. </li> <li>It builds the polygon mesh, polygon detailed mesh and navigation mesh (which is then stored in class NavMesh).</li> <li>It has a function to draw the polygon mesh generated, which may be helpful for the user for debugging purposes.</li> <li>The user can set the properties of the actor, so that the NavMeshBuilder accounts for it while building the meshes.</li> </ul> </li> <li>NavMeshNode <ul> <li>This class inherits from PandaNode and hence allows handling of relative coordinate system.</li> </ul> </li> <li>NavMeshQuery <ul> <li>This class has the query functions.</li> <li>Query functions are processed over the class NavMesh objects, which contain the generated navigation mesh.</li> <li>Query functions include the following: <ul> <li>Given an input point, a function can return the point nearest to it and on the navigation mesh.</li> <li>Given two input points, a function can return the array of points which form the path between those two points (this function is yet to be added).</li> </ul> </li> </ul> </li> </ul> <p>Apart from these classes, the exposed functions are included as PUBLISHED. This now, I would be working on cleaning up of code for better readability and adjusting to Panda3D's coding style. Also, changes are required in order to make the library available in python environment.</p> <p>For all of this to happen, the mentors have really helped me a lot. So a huge shout out to them. Thank you @rdb and @moguri :D </p> <p>Meet you all next week!</p> <p>Stay safe, Thank you.</p>cse170001012@iiti.ac.in (imaj_ashwini)Mon, 22 Jun 2020 21:48:05 +0000https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-4-blog/Week 3 checkinhttps://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-3-checkin/<p>Hey everyone</p> <p>So 2 weeks have already passed and we are into the third week now. Last week I shared about my progess about polymesh generation. The next step was basically polymesh detail generation, which was pretty simple and did not require much effort. Along with that, I managed to draft a PR, over which the mentors suggested a lot of changes, mostly related to code styling and naming of variables, members, functions and classes. I edited the code, and since there are many variables involved, that process took some time (Yeah, I obviously tried Find and Replace XD).<br> Also, I added functions to generate polymesh as per the properties of the actor/agent. For example, set_actor_height(float h) would generate polymesh such that polygons with verticle space of size less than actor's height 'h' would not be add to the polymesh. Similarly, set_actor_radius(float r) does the same work, but here regarding area covered by the actor. Some other functions included are: set_actor_max_climb(), set_actor_max_slope(), etc... <br> Also, I have started working on off-mesh-connection-tool which would connect separate geometries (example islands). Hopefully, by this week I would be able to complete this feature. Also, I aim to add NavMeshQuery class this week..</p> <p><img alt="" src="/media/uploads/db00dea9-f9c8-4845-99df-d40cf3b26aa5.png"><img alt="" src="/media/uploads/3c0cad75-9a5d-4723-9118-c165ef96887e.png"></p> <p>If you compare both the images, the first is the polymesh generation for actor_height = 1.0 while second is polymesh generation for actor_height = 10.0. As suggested by the red marker in the second image, the space between the roof and floor of the marked part is less than 10 units, so for actor_height = 10, it was not included in the generated polymesh. In a similar way, other functions also affect the polymesh.</p> <p>PS: sorry if you don't like the colours used, I was just having some fun XD. </p> <p>Thank you. Have a great and safe week!</p>cse170001012@iiti.ac.in (imaj_ashwini)Mon, 15 Jun 2020 21:44:21 +0000https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-3-checkin/Week 2 blog!https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-2-blog/<p>Hello everyone,</p> <p>Its me again. Excited to share my progress this week with you all. There was a lot of coding involved this week. I coded three classes in order to generate a polymesh using the recast tools directly through the panda3d interface. First I coded for any .obj file to be loaded into a polymesh, but later changed it to load polymesh from any geometry stored in the NodePath. A lot of time was spent on debugging and stuffs. Properly converting Z-up coordinate system to Y-up coordinate system and vice versa, drawing the output polymesh using GeomNode, understanding how exactly GeomNode and various other Panda3D tools work, proper knowledge of recast library were very essential to get the code compile and run successfully. Here is a 3D model form Panda3D sample directory called roaming-ralph and corresponding output for polymesh (the walkable surface) is shown in red. </p> <p><img alt="" src="/media/uploads/95403737-260c-4fee-9c45-4877faa573a9.png">             <img alt="" src="/media/uploads/073f8511-40cd-4f67-b55c-63c95a002940.png"></p> <p>Apart from the main coding part, building the recast library and my classes with panda3d is also important. This was one place I stuck for a long long time and everytime my mentors helped me out. So, though I might be troubling them for this part, but I got to learn a lot from them. So a big thanks to them for how they helped me this whole week</p> <p>For future work, I have a lot of stuff lined up. I have drafted a PR. My mentors will ask me to do some necessary changes within a day or two. Apart from that, NavMesh generation and Detour integration are main challenges of the journey in the coming weeks. </p> <p>Thanks for reading the blog</p> <p>Stay safe</p>cse170001012@iiti.ac.in (imaj_ashwini)Mon, 08 Jun 2020 19:26:44 +0000https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-2-blog/Week 1 check-inhttps://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-1-check-in-3/<p>Hello</p> <p>Welcome to my blog. I am participating in this year's GSoC program for Panda3D - a suborgansiation under PSF. Today is the start of the coding period. Its 7:00 am in India here and I am starting this memorable day by writing my first blog here on this forum. I have been assigned the task to integrate Recast &amp; Detour tools in Panda3D game engine. Already excited by the project idea, I started playing with the tools of Panda3D during the community bonding period. I did go through a lot of blogs and articles about "recastnavigation", which is the github repository that provides the Recast and Detour tools. Well, this was pretty much what I did in the previous month, but now starts the actual coding period. I plan to start by planning the classes and functions required to bring recast into the Panda3D world.</p> <p>So yeah, I am very much excited to let you guys how all of it unfolds.</p> <p>Let's start the journey! </p>cse170001012@iiti.ac.in (imaj_ashwini)Mon, 01 Jun 2020 01:20:04 +0000https://blogs.python-gsoc.org/en/imaj_ashwinis-blog/week-1-check-in-3/