Monday, September 18, 2017

SLEPR in Vector

For this week, my goal is to finish all the functions by using c++ code. Most functions are not so complex, but when I tried to write the SLERP function in vector part, I had a problem. SLERP stand for spherical linear interpolation. The purpose of the function is to let the position move smoothly between two points. Usually, this would use on the camera position.

The problem was that when I tried to write this function with two points, there will be no way to know how the route is. In quaternion part, it also has SLERP function. However, it doesn’t have this problem because the quaternions which will use in this function are normalized quaternions, and the route will refer the angle between two quaternions and the origin. Thus, I need to find the other way to write SLERP in vector part.


After researching, I find the thing called spline. It has the similar purpose with SLERP, but it will refer 4 points to decide the route, and the closest spline with our demand is Catmull-Rom spline. It refers 4 points and 1 coefficient to draw the curve. The curve will be drawn between the second and third point, and the first and fourth point is the control points. The coefficient will between 0 and 1 as the ratio.

Sunday, September 17, 2017

The chaos before the storm

Continuing my adventures on the treacherous CMake lands, progress was real, the end of the road was in view, but the dark forces never rest, and now Irma was on the way... which was worse than it sounds.

The toolchain I previously found proved to be useful after various tweaks; it was last updated for CMake versions close to 2.8, which is about 10 versions old, but works nonetheless. I have managed to obtain a iOS build system created but I still have some issues to fix, there seems to be some linker issues, but hopefully it's not something too complicated... hope has not been an ally in this journey though. The process involved generating an iOSSetup shell script to attach the toolchain to CMake and setting up some variables to let know CMake where to look. Other CMake specifics have been isolated.

Then Irma came (or at least was "said to come this way.") The forces of evil that I have been fending off were not happy with my progress, they were angry. This halted my work as I prepared for the storm and helped out friends and family to prepare. At this point I still did not believe it was going to come this way or that a category 1ish would not do much harm, i was a fool. I was stopped in my tracks for 3 days straight after the full might of the evil horde (of wind gusts) that left me in darkness and hampered my ability to move, I was stranded in with no power, transport and with a bunch of yummy treats and water (but no soda.) After the storm passed I had to continue my work on my side hustle (aka PCP online class) in which my fellowship had disbanded (apparently they don't care for a few points of teamwork) I understand tho... they were making us do weird stuff.

Now it is time to fully charge into the end of the road, and see what lies there.

Revenge of the iOS deployment

After the unix wars, there was supposed to be calm times, little did I know that Irma had plans for me, especially before it arrived. The iOS conundrum was not over, it was only beginning, as confusion led to worse problems, the purpose was to release to the App Store... the war never ended. I started research on the project and did some progress, until I reached a dead stop; this required a new layer of complexity that I had not dealt before; certain legal requirements that brought me to a dead stop. The battle was lost. I did do some testing on the app that surfaced some important bugs like menu problems with actions and responses, text misspellings, and other functional issues. Bugs were reported, hopefully someone will look at them before its too late.

After this I continued my work with the iOS CMake build system. I found some supporting works that were already on the works that might prove useful. These were based on a deprecated and abandoned project that aimed to give CMake full functionality on iOS, but was abandoned long ago. Luckily someone continued this work, although it still seems to be old enough to be useless. Time will tell.

Monday, September 11, 2017

Unit Test and Modification

After Listing all interfaces, I need to connect my library with CMake so CMake can compile my library. Thus, I need to add my library name in the CMakeList file. The other thing which I did in last week was to create the unit test file. So far, my functions are not doing anything. They just turn false because I should check that project can run my unit test, and the most effective way is to let all test functions only return false.


This part did not take me so long to finish it, but there were some things that Lari wanted me to modify and add to my library. Lari wanted me to add some constants and Macro code in my library. Those things will make me easier to write my code and make my code look more organized. Lari also wanted me to modify my vector, matrix and quaternion struct. Using union in my struct could let the structs more flexible. The struct will not only have one form. Users could specifically edit the data of the struct.

Monday, September 4, 2017

Listing Interfaces

This is the second month of the final project. For this month, my goal is to finish the UnitTest of math library. However, the code will be temporarily written in c++, and the next month I will start to change the c++ codes into the low-level language, such as Assembly or SIMD, for improving the speed.

The first week, I was working on listing all my interfaces. In math library, I separated it into three parts which are vector, matrix and quaternion. Most functions are the basic calculations. The complex functions will leave to the physics and collision library. When I listed all interfaces, I also needed to comment those interface to explain the functions to users. Thus, that cost most time when I did this work.


When I listed all interfaces, I also found some functions which I listed last month for research paper were needed to modify. For example, the addition and subtraction function could be concentrated to one function. Also, there are some functions which I missed last month, such as LERP and SLERP functions for vector and quaternion.