Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
RTRenderer.cpp
Package: solidgraph_sources.zip [view]
Upload User: kairuinn
Upload Date: 2009-02-07
Package Size: 2922k
Code Size: 1k
Category:
Graph program
Development Platform:
Visual C++
- #include <stdafx.h>
- #include "..//Drawer.h"
- #include "RTRenderer.h"
- class CDefaultTexture : public sgRayTracingTexture::sgCSolidTexture
- {
- public:
- float m_red;
- float m_green;
- float m_blue;
- float m_alpha;
- virtual void GetColor(sgRayTracingTexture::RT_COLOR& col) const
- {
- col.m_red = m_red;
- col.m_green = m_green;
- col.m_blue = m_blue;
- col.m_alpha = m_alpha;
- }
- };
- class CDefaultMaterial : public sgCMaterial
- {
- public:
- CDefaultTexture m_def_texture;
- virtual const sgRayTracingTexture::sgCTexture* GetTexture() const {return &m_def_texture;};
- };
- static CDefaultMaterial default_material;
- int MyRenderer::GetWidth()
- {
- return m_draw_sizes.cx;
- }
- int MyRenderer::GetHeight()
- {
- return m_draw_sizes.cy;
- }
- sgCMaterial* MyRenderer::GetMaterial(const sgCObject* ooo)
- {
- sgC3DObject* obj3D = (sgC3DObject*)(ooo);
- const float* obj_col = Drawer::GetColorByIndex(ooo->GetAttribute(SG_OA_COLOR));
- default_material.m_def_texture.m_red = obj_col[0];
- default_material.m_def_texture.m_green = obj_col[1];
- default_material.m_def_texture.m_blue = obj_col[2];
- default_material.m_def_texture.m_alpha = 0.0f;
- return &default_material;
- };