hololens render tradeoff

1. On-board GPU rendering

  • update position on screeen real-time when user head move
  • low power of mobile CPU and GPU
  • low visual fidelity but good framerate

2. Remote rendering

  • send user head position to Server
  • get pre-rendered image via low bandwidth wifi (802.11ac, 1.3 gigabits per second)
  • has latency -> positioning of virtual object is unstable

avatar pointing note

จะทำ avatar ให้ชี้ที่วัตถุได้แบบ แม่นยำ

ที่เห็นในโปรแกรม smartbody ก็คือ ทำ animation ทิ้งไว้หลายๆอัน ชี้ซ้ายขวา ขึ้นลง สูงต่ำ  ประมาณ40กว่าอัน

เสร็จแล้วก็มี ฟังก์ชัน pointing(ใส่วัตถุที่จะชี้) ซึ่งมันจะหา animation ที่มีตำแหน่งของมือที่ชี้ อยู่ใกล้ ตำแหน่งจริงที่จะชี้ มากที่สุด

แต่ว่า พอของที่จะชี้ มันอยู่ไกล…animationที่โปรแกรมเลือกมาให้เลยชี้ไม่ตรงของที่จะให้ชี้ (ไม่ตรงแบบเหมือนชี้มั่ว…หรือมันหา animation ให้ไม่ได้เลย random เอานะ?)

เห็นว่าถ้าเป็นฟังก์ชัน grab(ใส่วัตถุที่จะจับ) โปรแกรทก็จะเลือก animation ที่ใกล้ๆมาให้ แล้วก็ทำ inverse kinematic เพื่อยืดมือออกไปจับของอะนะ (แต่ไม่ได้ลองว่าถ้าของอยู่ไกลเกินมือเอื้อมจะเป็นยังไงแฮะ)

**

เราเลยพบว่า การเตรียม animation ทิ้งไว้นั้น ลำบาก เสียเวลา แถมยังชี้ไม่ตรงอีก(หรือไม่ก็ต้องมีanimationเตรียมไว้เยอะมากๆ)

เลยจะเสนอ algorithm สำหรับ pointing…ซึ่งมันก็คือ inverse kinematic 2 ข้อต่อ (ของคนอื่นเค้าเขียนทิ้งให้ใช้ฟรี….)

พอเอามาลองใช้แล้ว ก็เจอว่า แขนมันบิดผิดรูป กับ มือไม่แผ่มาหาทาง user (แบบว่าเวลาจะแนะนำอะำร มือมันควรจะหันออกมาทางคนที่กำลังพูดด้วย)

ตอนนี้ลอง fix องศาหมุนมือให้หันกาuserอยู่ แต่ก็ดูไม่สมจริงนิดนึง

กับถ้า เปลี่ยนตำแหน่ง avatar องศาที่fixไว้ มันใช้ไม่ได้ กลายเป็นชี้มั่วแขนบิดไปเลย…

กับอีกอันคือ ชี้มือขวา หรือมือซ้าย น่าจะทำให้มัน auto ได้นะ….

***

ยังมีัเรื่องของ ตำแหน่งของ avatar พอจะให้มันเดินหลบ หรือเดินตาม user ได้..

คือถ้าเขยิบนิดๆก็okอยู่…แต่พอต้องเขยิบมากๆ อยู่ใกล้ user เกินไป  , user เดินไปอีกทางละ จะเดินตามอะไรยังไงตอนไหนดี….

virtual agent stuff

1.ใช้โปรแกรม makehuman สร้าง humanoid model แล้วเอาเข้าไป animate posture ใน unity

http://nw.tsuda.ac.jp/lec/unity5/index-en.html

 

makehuman มันก็มี free model data ให้เลือกโหลดมาใส่ได้อยู่

http://www.makehumancommunity.org/clothesgallery.html

แต่เจอปัญหารองเท้าส้นสูงกับเท้ามันใส่ไม่เข้า เห็นว่าต้องไปดัดเท้าเองใน blender …

 

2. ใช้โปรแกรม mixamo สร้าง animation posture

https://www.mixamo.com/

คือมันจะมี character กับ animation ให้เราเลือก จะ upload character ของตัวเองขึ้นไปแล้วใส่ animationที่มีอยู่ก็ได้

แต่ลอง upload unitychan ไม่ได้อ่า…

แล้วก็ animation มัน fix ท่าทางมาละ ถ้าจะให้ชี้นู่นนี่ได้อิสระ น่าจะต้องเขียนโค๊ด ให้มันหมุนไหล่หมุนแขนเองแฮะ

 

3.โปรแกรม smartbody http://smartbody.ict.usc.edu/

โปรแกรมนี้มี example character มาให้ละ ใช้ python เขียนสั่ง bml ให้character ทำท่าทางอะไร มองไปทางไหน พูด lipsyn ได้

ฟังก์ชัน pointing นั่นจะ คำนวณตำแหน่งสิ่งที่ชี้ กับ animationที่จะให้ตำแหน่งของนิ้วอยู่ใกล้วัตถุมากที่สุด

animation ในการยกแขนชี้นู่นนี่มีอยู่ 39 ไฟล์ ถ้าของอยู่ใกล้จะสั่งให้หยิบแตะของนั้นก็ได้ ถ้าของอยู่ไกลตัวเหมือนจะคำนวณพังกลายเป็นชี้มั่วเลย

4.โปรแกรม vitual human toolkit https://confluence.ict.usc.edu/display/VHTK/vhtoolkitUnity

อันนี้เป็น โปรแกรมที่รวม smartbody + npc editor + gui +etc เข้าไปให้ใช้งานง่ายขึ้น เหมือนเป็นโปรแกรมทำ animation ตัวนึง…แต่ยังใช้ยากอยู่ดี…

ข้อดีคือ มันมี unity plugin ว่าจะลองใช้ดู

ก็ download ตัว indow installer 3.9Gb มา(ข้างในมี 3rd party installerให้แล้ว)

พอ installเสร็จ ให้ import

  • vhAssetsPackage
  • vhAssetsTestScenePackage

จากโฟลเดอร์ C:\vhtoolkit\bin\VHAssets  เข้าไปไว้ใน unity 2017.1.0f3 project…ก็จะใช้ vhtoolkitใน unity ได้ละ

Duality

Transportation problem is defind as (Primal model)

  • we have muktiple factory and multiple customer
  • each factory has a capacity amount of items
  • each customer place an order amount of items
  • there are a different cost of sending 1 item from factoryABC to customerABCD
  • To minimize transportation cost,
    • which factory should send item to each customer
    • and how many items do that factory send.

In another view of problem (Duality model – provide vital economic interpretations)

  • If we want to expand a factory (to increase a capacity per factory), How much cost will be reduced.
  • If customers order more items, How much profit we will get.

shadow price  :the optimal values of dual variables associate with each constraint

  • is a price that paid for 1 unit of resource.

reduced cost : associate with each decision variable. defined as the change in objective function value

  • is also called opportunity cost.

Mathematical Optimization

Mathematical Optimization = finding the best solution base on a given ojective function

Objective function = maximize or minimize

 

https://ampl.com/resources/the-ampl-book/chapter-downloads/

https://media.readthedocs.org/pdf/scipbook/latest/scipbook.pdf

 

Linear optimization (a1x1+a2x2+…+anxn) : most basic

– Integeroptimization: more complicate (NP-class)
Ex. find maximum number of chicken and rabbit, while theare are 5 heads and 16 feet.

Non-linear optimization : difficult to solve

-Quadric optimization (x^2+xy) polinomial up to 2 : able to solve by using SCIP (especially if convex function)

 

To solve

1. define mathematical fomular

  • variables :
    • x1
    • x2
  • objective function :
    • maximize 25×1+30×2
  • contraints :
    • 0<=x1<=6000
    • 0<=x2<=4000
    • x1/200+x2/140<=40

2. write  AMPL code from mathematical formular

var XB;
var XC;
maximize Profit: 25 * XB + 30 * XC;
subject to Time: (1/200) * XB + (1/140) * XC <= 40;
subject to B_limit: 0 <= XB <= 6000;
subject to C_limit: 0 <= XC <= 4000;

 

 

using Apache ActiveMQ

Apache ActiveMQ is a queue management software.

1. install jre environment
http://www.oracle.com/technetwork/java/javase/downloads/jre10-downloads-4417026.html

2. download Apache ActiveMQ
http://activemq.apache.org/download.html
extract at C:\apache-activemq-5.15.4

3. check java version
runcmd as administrator type : java -version

4. install ActiveMQ service
change directory in cmd to C:\apache-activemq-5.15.4\bin\win64
or C:\apache-activemq-5.15.4\bin\win32

type: InstallService.bat

5. type “services” in windows search box, then open services window

6. right click at ActiveMQ > Start

7. open web browser to see queue
goto http://127.0.0.1:8161
click Manage ActiveMQ broker
Login: admin
Password: admin

Python notebook + amplpy

1. download anaconda python 3.6 version (python 2.7 version also work!)

Downloads

2. cmd at c:\Anaconda3
install amplpy by typing : python -m pip install amplpy –pre –upgrade
we need to install the lastest amplpy 0.6

install pandas : python -m pip pandas bokeh

3. download ampl
https://ampl.com/try-ampl/download-a-free-demo/
then extract file at C:\ampl_mswin64

4.calls ampl in python with specify path:
from amplpy import AMPL, Environment, DataFrame
ampl = AMPL(Environment(r’C:\ampl_mswin64′))
ampl.setOption(‘solver’, r’C:\ampl_mswin64\gurobi’)
ampl.read(r’C:\ampl_mswin64\kcenter.mod’)

lecture

Empirical Research Methods in Information Science
https://course.ccs.neu.edu/is4800sp15/schedule.htm

Human-Computer Interaction
https://course.ccs.neu.edu/is4300f15/schedule.htm

Posted in web

my 2d game

http://mionzlab.bumbleplay.com/WebglGame/

internal ก็คือ public แค่ว่าไม่สามารถเรียกฟังก์ชันนี้จากข้างนอกโปรแกรมได้

Animation rigging unity

http://nw.tsuda.ac.jp/lec/unity5/index-en.html

https://medium.com/unity3danimation/create-your-own-ik-in-unity3d-989debd86770

https://www.udemy.com/mastering-3d-animation-in-unity/