Coder Social home page Coder Social logo

k210_mmd's Introduction

MMD test for k210

how to

Using latest toolchain(development branch) and standalone sdk to compile and build, and then use kflash.py to flash.

Makefile is written for PC testing, not for K210

model file name is model.pmd, make sure that texture images must be RGB565 format bmp file.

motion file name is motion.vmd.

All these file are placed in root of your SD card.

test files.

初音ミク@七葉1052式 Ver20090309(MMD model file) each texture file is converted by using ffmpeg. wavefile (MMD motion file)

convert your texture bmp file to RGB565 format

BMP file must be RGB565 color format, you can convert bmp file by using ffmpeg.

$ ffmpeg -vcodec bmp -i <input>.bmp -vcodec bmp -pix_fmt rgb565 <texturename>.bmp

License

My source code is distributed under the MIT license. Other file is distributed under each license, see each source code for detail.

performance test result

environment

2450 triangles, window size is 320x240

esp32, dual core, 240MHz(on screen, but it's almost cpu limit, reference only)

22fps, 54ktps(K triangles per seconds; 22*2450=54k)

k210, single core, 400MHz(off screen test)

45fps,110ktps

k210, dual core, 400MHz(off screen)

71fps, 173ktps

k210, dual core, 600MHz(Off screen, overvoltage)

107fps, 262ktps

k210(Onscreen, overvoltage)

100fps, 245ktps

note that performance is also depends on your model's ik bone count.

k210_mmd's People

Contributors

elect-gombe avatar vowstar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

k210_mmd's Issues

k210_mmd implement to rt-thread k210

k210_mmdは結局、うまく動作しました。SDカードアクセスについてはrt-threadのdfsを使い読み書きするようにしました。sdcard.cによるfat32アクセスでも動作できましたが、やはりrtthreadのdfsがいいと判断。一番苦労したのはk210.cの中のこの関数です→register_core1(core1_function, 0);こんなものはrtthreadでは動きませんので別の方法でrt_thread_create方式に書き換えました。大概の関数はrtthread/k210に実装されたkendryte_sdkライブラリが使えました。

VMD file parse eror,Count = 0!

Hi,
I'm trying this very amazing project, but I seem to have encountered a problem.
I use A-EYE hardware,I have modified the pins of the LCD and SD card for A-EYE board.Model file it seem can be parse right,but the motion file can not be parse right(count always is 0),did I miss something?
I use PC it can be works well!
Log:

Core 0 Hello world                                   
core 1 registering...                                
Core 1 Hello world
sd init 0
card info status 0
CardCapacity:31914983424
CardBlockSize:512
mount sdcard:0
count:0
ik=7

How does it work?

Im getting soon a Maix-bit and im trying to understand how does this code works,
do you convert the 3d mmd into bmp files and play it as video?
Thanks!

Add runtime loader

Add motion, model and camera motion file loader.

todo

  • reconstruct data structures. (change less memory usages into easily understandable structures; readable code)
  • file load by using PC.
    • impl model loader
    • motion data compiler(reordering)
  • integrate to k210.

link

M5Stack_MMD renderer, M5stack fire version

Runtime texture loader implementation

Part of #4

Implement texture loader.

Considering image file format

  • bmp (without alpha channel, transparent color?)
  • png (Complessed)
    • without alpha channel
    • with alpha channel and implement alpha test.

Alpha channel support needs implementation of png or bmp with transparent color, and alpha test for no conflict with other polygons.

Algorithm

  1. Test z value, whether the pixel is beyond this model?
  2. Test texture alpha channel whether if it is transparent or not?
  3. then, write back the z value.

initialization issue ( window_height / pll_set_freq )

Nice work !!

There seems to be some initialization issue related to height and frequency !?

window_height = 220; // above 220 unstable, can't get it to work on 240

below unstable
sysctl_pll_set_freq(SYSCTL_PLL0, 480000000UL);

fix texture display bug

テクスチャ表示が化けるのを直す。
原因として考えられるのが、テクスチャ座標の計算のオーバフローだと思うんだが実際わからん

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.