Ovis_3D_Area_Texture_Set()

Abstract

Specifies a texture to be applied to a 3D area.

Syntax

Ovis_3D_Area_Texture_Set (area_dec_ptr, texture_dir, texture_file, tile_count)
Argument Type Description
area_dec_ptr OvisT_3D_Area * Area of interest
texture_dir const char * Directory path for the texture file
texture_file const char * Name (including extension) of the texture file
tile_count unsigned int Tiling division to be used (see Details)

Return Type

OvisT_Compcode

OvisC_Compcode_Success if the texture is set; OvisC_Compcode_Failure otherwise.

ovis_decoration.h

Details

A texture is a graphical file that is mapped into a 3D Area. The file can be in any of the following graphics formats:

  • JPEG (.jpg)
  • Microsoft Windows bitmap (.bmp)
  • PNG (.png)
  • Silicon Graphics bitmap (.rgb)
  • TIFF (.tif)

The texture file is mapped to the defined area in an n x n pattern of tiled images, where n is specified by tile_count. Thus, if tile_count is 1, one copy of the texture is mapped to the entire area. If tile_count is 2, four texture copies are mapped to the area in a 2 x 2 grid (as shown in Figure 9), and so on.

Figure 9: Example of Texture Tiling for 3D Areas

Example of Texture Tiling for 3D Areas

A texture overrides any other options specified for the area, such as a fill pattern or transparency.

Note: Applying a texture to an area is an expensive operation.

Example

OvisT_3D_Area      * area;
OvisT_Compcode       status;

/* … area created at some point */

status = Ovis_3D_Area_Texture_Set (area, "c:\textures", "my_texture.tif", 2);

Errors

  • Decoration is NIL.
  • Tile count should be greater than 0.
  • Decoration is not a 3D area.

Reference

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com