Skip to Main Content
A Hitchhiker's Guide to Virtual Reality
book

A Hitchhiker's Guide to Virtual Reality

by Karen McMenemy, Robin Stuart Ferguson
July 2007
Beginner to intermediate content levelBeginner to intermediate
604 pages
17h 36m
English
A K Peters/CRC Press
Content preview from A Hitchhiker's Guide to Virtual Reality
i
i
i
i
i
i
i
i
15.6. Playing Movies or Live Video into Textures 425
HRESULT UpdateMappingD3D( LONG lActualW, LONG lTextureW,
LONG lActualH, LONG lTextureH ){
HRESULT hr = S_OK;
if(0 == lTextureW || 0 == lTextureH) return E_INVALIDARG;
FLOAT tuW = (FLOAT)lActualW / (FLOAT)lTextureW;
FLOAT tvH = (FLOAT)lActualH / (FLOAT)lTextureH;
// Alter the texture coordinates to comply with image map dimensions that
// are powers of two
CUSTOMVERTEX
*
pVertices; // get a pointer to the vertex data
if (FAILED(hr = g_pVB->Lock(0, 0, (void
**
)&pVertices, 0))) return E_FAIL;
for(DWORD i=0; i<nGrid; i++){ // go throug every vertex in grid
pVertices[2
*
i+0].tu = tuW
*
((FLOAT)i)/((FLOAT)nGrid-1.f); ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Developing Virtual Reality Applications

Developing Virtual Reality Applications

Alan B. Craig, William R. Sherman, Jeffrey D. Will
Virtual Reality Blueprints

Virtual Reality Blueprints

Charles Palmer, John Williamson
Step into the Metaverse

Step into the Metaverse

Mark van Rijmenam

Publisher Resources

ISBN: 9781568814773