495 - Sprint 1

Bootleg Studios - Programmer Sprint 1


Interpolating Interactable Selections

Interpolating selections is a unique technique in game development to create seamless transitions from one point to another. In our project, I implemented this technique to smoothly transition between different interactable objects in our scene such as the OrderWindow, Still, Computer, and Backyard, in all one smooth transition using Interpolation.


Interpolating Camera With Button Clicks()

This process was very straight foward to me. With my IEnumerator function I just attach the function that has the coroutine onto to button click. So whenever you press and click which object you want to go to, there will be buttons around your pov to transitions to other areas (mainArea, orderWindow,etc). I can show some examples on how I did this process down below.


Some problems I encountered on the way were definitely starting off and thinking how do i go about creating a clickable selection? Or upon clicking have my camera transition towards that object smoothly? My professor demonstrated linear interpolation to the class a few semesters ago and I gathered references from our lab projects. Here's some snippets of codes that I'll explain my thought process of creating a interpolations transition.


Inside of this while loop I am using Vector3.Lerp function so the camera’s position will gradually move from its original location towards the target position, then for the rotation we use a Quaternion.Slerp for it’s rotation. The float acts as an offset distance between the camera and object you would click on.

Inside this while loop I am having my  Vector3.Lerp smoothly change the camera's position from its original position to the targetPosition based on the time progress of t. Along with Quaternion.Slerp I am interpolating the camera's rotation from its original rotation (similar to lerp, instead it’s rotation instead of position) to the targetRotation based on the progress t. By doing this we can smoothly move and rotate our camera.



Lastly, this function HandleSceneTransitions() checks if the mouse button is clicked. Then, it casts a virtual line from the camera to where the mouse clicked. If this line hits something in the scene, it checks the tag of the object it hit. Depending on the tag, it triggers an interpolation transition as in the given pictures below.



In this picture, this functions starts to hide all listed objects.Then after I reference a target position to transition towards to and set variables to it’s original position and rotation. After I have a for loop that unhides certain buttons through a list, after I click on an object I still have the option to go back to other areas due to buttons, and whenever i transition to another place all buttons hide and certain buttons show so you don't get lost.





In the end progress this is how we set up the transition from the camera's original position and rotation to the target position and then back to it's original position.


This week's first sprint I entered in pretty nervous about starting on how to shift and transition the cameras pov due to this being a senior make or break class but as I went along I feel like i structured a pretty good format on how to transition the camera based on what you click, and what button to click to navigate around the area.

Comments

Popular posts from this blog

CAGD Portfolio

SevenSeasToGlory - Programmer Sprint 6