ganimtron_10's Blog

Week 1 - Laying the Foundation of DrawPanel UI

ganimtron_10
Published: 06/29/2022

This week we started with our first technical meeting in which the weekly tasks were assigned. So I had to start with some background or canvas and draw a line using mouse clicks.


What did you do this week?

I started with a simple Panel2D (which is basically a movable rectangle on which we can add other UI elements) as a background and then assigned its mouse click callback to print “Clicked!” to verify the event triggering.

Then I modified the event callback to create a Rectangle2D at that current mouse position(Now you would ask, Why Rectangle2D?? We wanted to change the width of the line, which wasn't possible with the regular line). This would create a rectangle at that point but it had size.
So I had to then calculate the distance between the first point where the mouse was clicked and the current position to resize it accordingly. 

This thing creates a Rectangle, not a line. So I had to think of some other approach.
The first thing that came to my mind was to keep the width of the rectangle constant and apply some rotation to the rectangle according to the mouse position and this worked!

As previously we created an interactive rectangle(unintentionally), I thought it would be great if I could add different modes for creating different shapes(ie. line, rectangle, circle as these shapes already existed in the UI System).

Considering this I implemented a class to create and manage these shapes and a panel to select which shape is to be drawn along with a TextBlock2D to show the current mode.

DrawPanel UI:

PR #599


Did you get stuck anywhere?

I was facing issues with implementing the rotation. I scanned the utils to find some method to do the same but there wasn't any for Actor2D. Then I read some docs and tried out various functions.
At last, I decided to implement it by the most general method which is to calculate the new rotated points by multiplying them with the rotation matrix and that seemed fine for now!!


What is coming up next?

Deletion of the shapes is to be implemented along with tests and tutorials. 

View Blog Post

My Pre-GSoC '22 Journey

ganimtron_10
Published: 06/28/2022

Hello Guys!! I am Praneeth Shetty, currently pursuing a Bachelor of Engineering in Computer Engineering, and here is my journey from where I started to the selection into GSoC22.

 

The Beginning of Programming


My programming journey started way back in 7th std when we had a subject called Information Technology in which the last two lessons were based on HTML and Javascript. I loved to create simple pages in HTML but was struggling to learn Javascript as it felt a bit complex at the start.
I would practice these programs in our computer lab whenever we would have our practical lab (once or twice a month).
Next year I received a laptop from my cousin's brother(which I still use). While setting up the things he started enquiring about my academics and asked me to create an HTML code. He was happy to see that I could do that so to explain to me the usage of javascript he created a small program. He executed it and gave it to me, where it was written: “Enter your Name?” I typed Praneeth and pressed Enter. A new page was loaded with a Text stating “Hello Praneeth!! How are you??” I was amazed to see the output. How could that machine know me and greet me?? Is Javascript such a powerful tool?? Can I make the computer talk using Javascript?? These questions flooded my mind. That day I realized that, If I had a good command of Javascript, I could control the whole computer and can make it do whatever I want. Because of this, I started giving more attention to Javascript.


Interest in Game Development and Animation


Around one and a half years after this, I was able to code basic javascript programs. During my vacation, while I was searching for a gameplay video on Youtube, A video titled “How to Make a Game” by Brackeys grabbed my attention and made me click on it. I watched the whole video but was unable to understand most of the things ie transform, rigid body, mesh, collider, etc. But it generated an internal feeling that I can also create a game. I tried to replicate the process in the video but when I went on to the Official Website of Unity(Game Engine) the whole package size was around 1.5 Gigabytes which was a huge sum at that time(the time when 2G ruled and 100 Megabytes was for 10 INR). So I was unable to work on it. But still, some unknown inspiration motivated me to watch the whole How to Make a Game playlist of 10 videos. As I moved ahead some concepts were getting cleared and I had a surface-level idea of how to make things work in-game(Not how games actually worked). As I was pretty much immersed in game development my feeds started showing “How to create a 3D character”, and “How to Animate” videos which led me to discover Blender, 3Ds Max, etc. animation software.
I downloaded Blender as it was a lightweight free package and started messing around with things in it. But after a few months, Blender made some remarkable changes and brought version 2.80 which required a few system specifications which my laptop didn't satisfy.
By this time I used to spend some extra hours in my College learning Unity and created my first Game which was an exact copy of the Brackeys Game Series. I was very happy to successfully create a game all on my own and used to think about what all new features can be added to it.


Intro to Opensource


While finding alternatives to Unity and Blender, I found a lightweight software called Godot and I was surprised to see the whole game engine was just around 100 Megabytes(which compared to Unity and Unreal is 10/20 times smaller). I tried searching about How and Why is Godot so Small and one of the reasons I found was, that it is open-source software. I had heard this term before while working with blender but still was unable to clearly understand what it is. Another answer I received is an extended application of the previous one which stated most features are implemented from scratch by various contributors in open source software whereas other big software libraries are used a lot for very minimalistic features too which makes it dependent and bulky. Around this time I had also switched to Python and was working on some mini projects and games using it. It also helped me in working with Godot, which has its own language called GDScript which resembles python.


GSoC - 21


As I was drowning in the oceans of Open Source, I read some blogs which mentioned some of the programs and events related to it viz. Google Summer of Code (GSoC), Hacktoberfest, GirlScript Summer of Code(GSSoC), etc.
I was excited to participate in these events but wasn’t getting proper guidance. I used to watch interviews and best practices for these events due to which I found out that for GSoC we have to select the organizations and then apply and this would be the basic flow of the program. So taking this into consideration I started searching for organizations on GSoC archives.

Firstly I was looking for any Javascript-related project as I had better command of it than python and there I found out about p5.js which was a creative coding library. I forked their repo, cloned it, and then tried to build it on my local machine but after many attempts, I was still unsuccessful to build it locally. I raised a question in their community and also mailed an old GSoC student but they too were unable to solve the query. This disappointed me a lot and kind of I was going to end my open source journey here but just thought of giving it a try again. While searching through the organizations I found lots of known projects regarding which I had no idea that those too were open source. While searching I found Python Software Foundation in the organization list and thought why not consider python. After looking into the organization I found out that PSF was an umbrella project for many sub-projects in which FURY(Free Unified Rendering in pYthon) suited me the most because I was a beginner and didn’t have any idea regarding the data analysis, API formation, and the other stuff. But because of my prior experience and interest in Game Dev, I was comfortable with FURY. I again forked, cloned, and tried to execute the first tutorial on it, it took a few minutes to run then a few more minutes to download some required files and then a black box appeared but with nothing on it, I thought there would be some error with something so re-executed it and it took few minutes and the first Earth Animation tutorial was successfully executed. I was fascinated by viewing the visuals of the Earth with the orbiting moon and the satellite animation (I had doubts whether my laptop will be able to handle these computations or not, but till now It hasn’t proved me wrong in most of the cases). I checked the code then and within 200 lines of code, all this was all possible. That made me understand the real power of FURY.

After this I checked for some of the good first issues but as it was the GSoC period most of the issues were under process so I tried to learn more about the tutorials and the code. There I found a few documentation errors which I fixed as my first PR. I also pointed out some issues which I faced while working with FURY. FURY has a great discord community that engages newbies and solves most of their issues. After two months GSoC Contributors Applications started and I also tried to apply for the same. I created a proposal on Improving the UI system but due to lack of experience and as I was unable to prove my coding skills, I was rejected. But this didn’t disengage me from FURY. I loved the simplicity by which each part was created. Then as time passed I worked on some of the issues and created some more PRs.


GSoC - 22


Again this year GSoC Started with new rules, and new energy and with more enthusiasm I too prepared to participate in it. Five new ideas were posted for GSoC in which I again chose the UI improvement as I had a good understanding of the existing UI system in FURY. Last year's experience helped me a lot in creating the proposal. This time I was also prepared(compared to last time) as I had made some contributions and also had spent time on the code base to understand it. Days passed and lastly, the result day arrived, and anxiety was at its peak. I had set an alarm to remind me to keep checking the mail for the result, refreshing and changing tabs. Exactly at 11:32 PM IST, a mail dropped with the subject “Congratulations, your proposal with Python Software Foundation has been accepted!” and my happiness had no bound.

View Blog Post