1.DirectX åºç¡
2.易航智能——专注量产的自动驾驶解决方案供应商
DirectX åºç¡
// DemoLight.cpp:
//
#include <windows.h>
#include <d3dx9.h>
#include <mmsystem.h>
//#pragma comment (lib, "d3d9.lib")
//#pragma comment (lib, "d3dx9d.lib")
//#pragma comment (lib, "winmm.lib")
//#pragma comment (lib, "d3dxof.lib")
//#pragma comment (lib, "dxguid.lib")
struct CUSTOMVERTEX {
D3DXVECTOR3 position;
D3DXVECTOR3 normal;
};
#define D3DFVF_CUSTOMVERTEX ( D3DFVF_XYZ | D3DFVF_NORMAL)
LPDIRECT3D9 d3d9;
LPDIRECT3DDEVICE9 d3ddev;
LPDIRECT3DVERTEXBUFFER9 d3dvb;
void InitD3D( HWND hwnd)
{
d3d9 = Direct3DCreate9( D3D_SDK_VERSION);
D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory( &d3dpp, sizeof( d3dpp));
d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
d3dpp.EnableAutoDepthStencil = true;
d3dpp.AutoDepthStencilFormat = D3DFMT_D;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.Windowed = true;
d3d9->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &d3ddev);
d3ddev->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE);
d3ddev->SetRenderState( D3DRS_ZENABLE, true);
}
void InitGeometry()
{
CUSTOMVERTEX* pVertices;
d3ddev->CreateVertexBuffer( * 2 * sizeof( CUSTOMVERTEX), 0, D3DFVF_CUSTOMVERTEX, D3DPOOL_DEFAULT, &d3dvb, NULL);
d3dvb->Lock( 0, 0, ( void**)&pVertices, 0);
for( int i=0; i<; i++) {
float theta = 2 * D3DX_PI * i / ;
pVertices[2 * i].normal = D3DXVECTOR3( sinf( theta), -1.0f, cosf( theta));
pVertices[2 * i].position = D3DXVECTOR3( sinf( theta), 0.0f, cosf( theta));
pVertices[2 * i + 1].normal = D3DXVECTOR3( sinf( theta), 1.0f, cosf( theta));
pVertices[2 * i + 1].position = D3DXVECTOR3( sinf( theta), 0.0f, cosf( theta));
}
d3dvb->Unlock();
}
void SetupMatrix()
{
D3DXMATRIXA matWorld;
D3DXMatrixIdentity( &matWorld);
D3DXMatrixRotationX( &matWorld, timeGetTime() / .0f);
d3ddev->SetTransform( D3DTS_WORLD, &matWorld);
D3DXVECTOR3 vEyePt( 0.0f, 0.0f, -5.0f);
D3DXVECTOR3 vLookatPt( 0.0f, 0.0f, 0.0f);
D3DXVECTOR3 vUpVec( 0.0f, 1.0f, 0.0f);
D3DXMATRIXA matView;
D3DXMatrixIdentity( &matView);
D3DXMatrixLookAtLH( &matView, &vEyePt, &vLookatPt, &vUpVec);
d3ddev->SetTransform( D3DTS_VIEW, &matView);
D3DXMATRIXA matProj;
D3DXMatrixIdentity( &matProj);
D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI / 4, 1.0f, 1.0f, .0f);
d3ddev->SetTransform( D3DTS_PROJECTION, &matProj);
}
void SetupLights()
{
D3DMATERIAL9 mtrl;
ZeroMemory( &mtrl, sizeof( mtrl));
mtrl.Ambient.a = mtrl.Diffuse.a = 1.0f;
mtrl.Ambient.b = mtrl.Diffuse.b = 0.0f;
mtrl.Ambient.g = mtrl.Diffuse.g = 1.0f;
mtrl.Ambient.r = mtrl.Diffuse.r = 1.0f;
d3ddev->SetMaterial( &mtrl);
D3DLIGHT9 light;
ZeroMemory( &light, sizeof( light));
light.Type = D3DLIGHT_DIRECTIONAL;
light.Position = D3DXVECTOR3( -5.0f, 0.5f, -5.0f);
light.Direction = D3DXVECTOR3( 0.0f, 0.0f, 0.0f);
light.Ambient.r = light.Diffuse.r = 1.0f;
light.Ambient.g = light.Diffuse.g = 1.0f;
light.Ambient.b = light.Diffuse.b = 0.0f;
light.Range = .0f;
d3ddev->SetLight( 0, &light);
d3ddev->LightEnable( 0, true);
d3ddev->SetRenderState( D3DRS_AMBIENT, 0x);
}
void Render()
{
d3ddev->Clear( 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB( 0, 0, ), 1.0f, 0);
d3ddev->BeginScene();
SetupMatrix();
SetupLights();
d3ddev->SetStreamSource( 0, d3dvb, 0, sizeof( CUSTOMVERTEX));
d3ddev->SetFVF( D3DFVF_CUSTOMVERTEX);
d3ddev->DrawPrimitive( D3DPT_TRIANGLELIST, 0, );
d3ddev->EndScene();
d3ddev->Present( NULL, NULL, NULL, NULL);
}
void Cleanup()
{
d3dvb->Release();
d3ddev->Release();
d3d9->Release();
}
LRESULT CALLBACK windowProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch( msg) {
case WM_DESTROY:
Cleanup();
PostQuitMessage( 0);
return 0;
}
return DefWindowProc( hwnd, msg, wParam, lParam);
}
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
WNDCLASSEX wce;
wce.cbClsExtra = 0;
wce.cbSize = sizeof( wce);
wce.cbWndExtra = 0;
wce.hbrBackground = ( HBRUSH) GetStockObject( WHITE_BRUSH);
wce.hCursor = LoadCursor( NULL, IDC_ARROW);
wce.hIcon = LoadIcon( NULL, IDI_APPLICATION);
wce.hIconSm = wce.hIcon;
wce.hInstance = hInstance;
wce.lpfnWndProc = &windowProc;
wce.lpszClassName = L"DemoLight";
wce.lpszMenuName = NULL;
wce.style = CS_HREDRAW | CS_VREDRAW;
RegisterClassEx( &wce);
HWND hwnd = CreateWindowEx( 0, wce.lpszClassName, L"Light", WS_OVERLAPPEDWINDOW, , , , , NULL, NULL, hInstance, NULL);
InitD3D( hwnd);
InitGeometry();
ShowWindow( hwnd, SW_SHOWNORMAL);
UpdateWindow( hwnd);
MSG msg;
ZeroMemory( &msg, sizeof( msg));
while( msg.message != WM_QUIT) {
if ( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE)) {
TranslateMessage( &msg);
DispatchMessage( &msg);
} else
Render();
}
return 0;
}
易航智能——专注量产的自动驾驶解决方案供应商
北京易航远智科技有限公司自年成立以来,致力于自动驾驶系统的自主研发,成为中国首批自动驾驶创业公司之一。公司获得了包括经纬中国、源码资本、明势资本等知名创投机构的仿微信红包源码支持,以及北汽产投、广汽资本和理想汽车等主机厂的战略投资。
易航智能自年起便涉足自动驾驶Tier1量产项目,至今已拥有万辆整车量产经验,积累了超过亿公里的驾驶数据。公司拥有感知、决策规划控制、软硬件开发、测试标定等全栈自研能力,网络在线小说源码并率先实现了NOA行泊一体、城市全场景FSD等高阶功能。
易航智能团队在感知、决策、控制、故障诊断等核心算法方面拥有深厚的技术实力。公司主营自动驾驶解决方案(ADAS、闪赚otc源码NOA、FSD)、域控制器、摄像头模组、驾驶算法与软件等产品,并在北京、苏州设有研发中心和工厂,国外论坛源码排名固安设有测试基地。主要客户包括理想汽车、北汽集团、江铃雷诺、上汽大通、一汽大众、威马汽车等主机厂。新华棋牌源码网站
易航智能汇集了汽车行业精英和计算机视觉、深度学习领域专家,硕士及以上学历人员占比超过一半。团队成员主要来自国内外主机厂、Tier 1供应商、国内外顶尖科研机构和伯克利、剑桥、清华、北大、北航等知名院校。
苏州平方米的一期生产工厂已建成并投入使用,拥有全球领先的智能化、自动化自动驾驶专用摄像头及域控制器生产线,产品已在多款车型中前装量产。
公司还建立了全球领先的摄像头调试和测试实验室,产线可进行AA和内参标定,已量产1M、2M、8M前视、侧视、环视摄像头,FOV覆盖°-°。
易航智能已通过IATF 、ISO、ISO 、ISO等国际认证。