不同气候条件的颜色编码背景 [英] Color Coding background for different climate conditions

查看:153
本文介绍了不同气候条件的颜色编码背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在使用DirectX 8.1在Visual Studio 2003下的C ++应用程序上工作,该DirectX使用3D图形显示各种元素.例如:我在阳光明媚的日子里有个沙滩球.我可以使用图形绘制球,但是我有兴趣使用任何可用的颜色代码或执行此操作所需的任何其他输入来绘制晴天背景.目前,我已经在代码中实现了基本的彩色背景,就像我可以获得从Black(0,0,0)到white(255,255,255)的基本颜色一样.使用DirectX 8.1通过代码执行和渲染气候背景(如晴天,黑夜,阴天)的最佳方法是什么?希望有人可以在这里提供帮助.

Hello,

I am working on a C++ application under Visual Studio 2003 using DirectX 8.1 that uses 3D graphics to displays various elements. For Eg: I have a beach ball on a sunny day. I am able to draw the ball using graphics, but I am interested in drawing the sunny day background using any available color code, or any other input I can have in order to execute this. At the moment, I have basic colored backgrounds implemented in my code, like I can get the basic colors from Black(0,0,0) to white(255,255,255). What would be the best way to go about this executing and rendering the climate background (like sunny day, dark night, cloudy day) through the code using DirectX 8.1? Hope someone can help here.

推荐答案

我不能帮助您使用8.1,但是使用9+时,过程是这样的

将位图加载到纹理中

使用GetBackBuffer
获取背板的大小
使用D3DXVECTOR4并将w设置为1.0
,创建一个方形纹理背板(顶点格式= D3DFVF_XYZRHW | D3DFVF_TEX1)
在渲染功能中,首先绘制的是背板

D3DRS_ZENABLE OFF
绘制背板
D3DRS_ZENABLE ON


唯一需要注意的是,您必须调整窗口大小并重新生成背板纹理
I can''t help you with 8.1, but with 9+ the process is this

Load your bitmap into a texture

Get the size of the backplane using GetBackBuffer

Create a square textured backplane (vertex format = D3DFVF_XYZRHW | D3DFVF_TEX1), using D3DXVECTOR4 with w set to 1.0

In your render function, the first thing you draw is your backplane

D3DRS_ZENABLE OFF
Draw backplane
D3DRS_ZENABLE ON


The only caveat is you have to catch a window resize, and regenerate your backplane texture


这篇关于不同气候条件的颜色编码背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆