Role drawing method, role drawing device, role drawing equipment and computer readable storage medium

文档序号:1709973 发布日期:2019-12-13 浏览:23次 中文

阅读说明:本技术 角色绘制方法、装置、设备及计算机可读存储介质 (Role drawing method, role drawing device, role drawing equipment and computer readable storage medium ) 是由 曾鵾程 聂欣 于 2019-09-12 设计创作,主要内容包括:本公开提供一种角色绘制方法、装置、设备及计算机可读存储介质,包括:获取画面中播放的模型动画的帧标识;根据模型动画的帧标识获取模型对应的预设骨骼矩阵集合;根据预设骨骼矩阵集合、模型的静态贴图绘制模型对应的模型角色。本公开提供的方法、装置、设备及计算机可读存储介质,通过将模型动画分割为多个画面帧,并预先存储每帧画面模型对应的预设骨骼矩阵集合,从而可以根据当前需要播放的帧标识,获取模型对应的预设骨骼矩阵集合,并直接使用获取的矩阵集合绘制模型对应的角色,无需实时计算模型的骨骼状态,再基于计算结果绘制模型对应的角色,从而能够降低角色绘制过程中的性能开销。(The present disclosure provides a role drawing method, apparatus, device and computer-readable storage medium, including: acquiring a frame identifier of a model animation played in a picture; acquiring a preset skeleton matrix set corresponding to the model according to the frame identification of the model animation; and drawing the model role corresponding to the model according to the preset skeleton matrix set and the static mapping of the model. According to the method, the device, the equipment and the computer readable storage medium, the model animation is divided into a plurality of picture frames, and the preset skeleton matrix set corresponding to each frame of picture model is stored in advance, so that the preset skeleton matrix set corresponding to the model can be obtained according to the frame identifier needing to be played at present, the role corresponding to the model is drawn by directly using the obtained matrix set, the skeleton state of the model does not need to be calculated in real time, and the role corresponding to the model is drawn based on the calculation result, so that the performance overhead in the role drawing process can be reduced.)

1. A method for drawing a character, comprising:

acquiring a frame identifier of a model animation played in a picture;

Acquiring a preset skeleton matrix set corresponding to the model according to the frame identification of the model animation;

and drawing a model role corresponding to the model according to the preset skeleton matrix set and the static map of the model.

2. The method of claim 1, wherein obtaining a preset skeleton matrix set corresponding to a model according to the frame identifier of the model animation comprises:

And acquiring a preset skeleton matrix corresponding to each skeleton identifier in the model according to the frame identifier of the model animation.

3. The method according to claim 2, wherein the mapping the model role corresponding to the model according to the preset skeleton matrix set and the static map of the model comprises:

In the preset skeleton matrix set, acquiring a related skeleton matrix of each vertex according to a related skeleton identifier corresponding to each vertex in a static map of the model, and acquiring a weight value of the related skeleton identifier influencing the vertex;

Determining the current position of the vertex according to the incidence skeleton matrix and the weight value, and drawing a corresponding model role in the picture according to the current position;

wherein the vertices in the static map are pre-set according to the bone model corresponding to the model.

4. the method of claim 3, wherein said determining a current location of said vertex from said correlated skeleton matrix, said weight values comprises:

And determining the current position of the vertex according to the preset position of the vertex, the associated skeleton matrix and the weight value.

5. the method of claim 3, further comprising:

And determining bone identifications associated with the vertexes in the static map and weight values of the vertexes influenced by bones corresponding to the bone identifications.

6. a character rendering apparatus, comprising:

the frame identification acquisition module is used for acquiring the frame identification of the model animation played in the picture;

The matrix acquisition module is used for acquiring a preset skeleton matrix set corresponding to the model according to the frame identification of the model animation;

And the drawing module is used for drawing the model role corresponding to the model according to the preset skeleton matrix set and the static mapping of the model.

7. the apparatus of claim 6, wherein the rendering module comprises:

the obtaining unit is used for obtaining a relevant bone matrix of each vertex according to a relevant bone identifier corresponding to each vertex in a static mapping of the model, and obtaining a weight value of the relevant bone identifier influencing the vertex;

And the drawing unit is used for determining the current position of the vertex according to the associated skeleton matrix and the weight and drawing the corresponding model role in the picture according to the current position.

8. the apparatus of claim 7, wherein the rendering module comprises:

An obtaining unit, configured to obtain, in the preset skeleton matrix set, a correlated skeleton matrix of each vertex according to a correlated skeleton identifier corresponding to each vertex in a static map of the model, and obtain a weight value that affects the vertex by the correlated skeleton identifier;

The drawing unit is used for determining the current position of the vertex according to the associated skeleton matrix and the weight value and drawing the corresponding model role in the picture according to the current position;

Wherein the vertices in the static map are pre-set according to the bone model corresponding to the model.

9. a character rendering device, comprising:

A memory;

A processor; and

A computer program;

Wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any of claims 1-5.

10. a computer-readable storage medium, having stored thereon a computer program,

The computer program is executed by a processor to implement the method according to any of claims 1-5.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种线条动画绘制方法及其设备、存储介质、电子设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!