Wednesday, December 30, 2020
Unity's GUI, Editor and GUILayout and EditorLayout
Difference between GUILayout and EditorLayout in Unity.
What is difference between GUI and GUILayout?
GUI uses fixed layout which means every gui elements needs specific positions for their's position. so API look like GUI.Button(new Rect(...))
GUILayout uses automatic layout which means we don't need to specifiy positions for their's position. Layout logic will determine gui element's position automatically so API look like GUILayout.Button(...)
What is difference between GUILayout and EditorLayout?
Do not expect EditorLayout is a super set of GUILayout. Actually GUILayout and EditorLayout are totally different. Each classes has different kind of features so we can choose everything where it needs.
Monday, December 7, 2020
in a perspective projection, make a plane to fill the whole screen.
public class fillPlane : MonoBehaviour
{
public Camera camera = null;
void Update()
{
if ( camera != null)
{
float fov = camera.fieldOfView;
float pos = camera.nearClipPlane;
transform.position = camera.transform.position + camera.transform.forward * pos;
float yn = Mathf.Tan(Mathf.Deg2Rad * fov / 2.0f) * pos * 2;
transform.localScale = new Vector3(yn * camera.aspect, yn, 1);
}
}
}
Tuesday, November 24, 2020
Monday, September 7, 2020
Sunday, September 6, 2020
use case of decorator function in python
def layer(func):
def layer_decorated(self):
print('func is wrapped');
func(self)
return self
return layer_decorated
class Network(object):
data = 0
def __init__(self):
self.data = 1024
# conv = layer(conv)와 같은 의미
@layer
def conv(self):
print('conv is called')
Saturday, September 5, 2020
Tuesday, August 11, 2020
Subscribe to:
Posts (Atom)
Task in UnrealEngine
https://www.youtube.com/watch?v=1lBadANnJaw
-
Unity released very good FPS example for people and I decided to analysis how they make this. Personally I wanted to show you how I analys...
-
Because nature of rotation angle, when we interpolate angles we could have some problems. For instance we have angle A0 and A1. A0 is -...
-
For instance I have 45 degree rotation quaternion p. and if I take p ^ (1/3) then I'll get 15 degree rotation quaternion. This is geomet...




