Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualAnddos

Posted 27 January 2013 - 11:41 PM

I am following a book and this is how they set up the vertex for the radar
//vertex.h
struct VertexPT
{
VertexPT()
:pos(0.0f, 0.0f, 0.0f),
tex0(0.0f, 0.0f){}
VertexPT(float x, float y, float z,
float u, float v):pos(x,y,z), tex0(u,v){}
VertexPT(const D3DXVECTOR3& v, const D3DXVECTOR2& uv)
:pos(v), tex0(uv){}

D3DXVECTOR3 pos;
D3DXVECTOR2 tex0;

static IDirect3DVertexDeclaration9* Decl;
};



//main code
HR(gd3dDevice->CreateVertexBuffer(6*sizeof(VertexPT), D3DUSAGE_WRITEONLY,
0, D3DPOOL_MANAGED, &mRadarVB, 0));
// Radar quad takes up quadrant IV. Note that we specify coordinate directly in
// normalized device coordinates. I.e., world, view, projection matrices are all
// identity.
VertexPT* v = 0;
HR(mRadarVB->Lock(0, 0, (void**)&v, 0));
v[0] = VertexPT(0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
v[1] = VertexPT(1.0f, 0.0f, 0.0f, 1.0f, 0.0f);
v[2] = VertexPT(0.0f, -1.0f, 0.0f, 0.0f, 1.0f);
v[3] = VertexPT(0.0f, -1.0f, 0.0f, 0.0f, 1.0f);
v[4] = VertexPT(1.0f, 0.0f, 0.0f, 1.0f, 0.0f);
v[5] = VertexPT(1.0f, -1.0f, 0.0f, 1.0f, 1.0f);
HR(mRadarVB->Unlock());

which part is setting the idenitity in that vertex declaration?

picture

pic01s.jpg

#3Anddos

Posted 27 January 2013 - 11:41 PM

I am following a book and this is how they set up the vertex for the radar
//vertex.h
struct VertexPT
{
VertexPT()
:pos(0.0f, 0.0f, 0.0f),
tex0(0.0f, 0.0f){}
VertexPT(float x, float y, float z,
float u, float v):pos(x,y,z), tex0(u,v){}
VertexPT(const D3DXVECTOR3& v, const D3DXVECTOR2& uv)
:pos(v), tex0(uv){}

D3DXVECTOR3 pos;
D3DXVECTOR2 tex0;

static IDirect3DVertexDeclaration9* Decl;
};



//main code
HR(gd3dDevice->CreateVertexBuffer(6*sizeof(VertexPT), D3DUSAGE_WRITEONLY,
0, D3DPOOL_MANAGED, &mRadarVB, 0));
// Radar quad takes up quadrant IV. Note that we specify coordinate directly in
// normalized device coordinates. I.e., world, view, projection matrices are all
// identity.
VertexPT* v = 0;
HR(mRadarVB->Lock(0, 0, (void**)&v, 0));
v[0] = VertexPT(0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
v[1] = VertexPT(1.0f, 0.0f, 0.0f, 1.0f, 0.0f);
v[2] = VertexPT(0.0f, -1.0f, 0.0f, 0.0f, 1.0f);
v[3] = VertexPT(0.0f, -1.0f, 0.0f, 0.0f, 1.0f);
v[4] = VertexPT(1.0f, 0.0f, 0.0f, 1.0f, 0.0f);
v[5] = VertexPT(1.0f, -1.0f, 0.0f, 1.0f, 1.0f);
HR(mRadarVB->Unlock());

which part is setting the idenitity in that vertex declaration?

picture

pic01s.jpg

#2Anddos

Posted 27 January 2013 - 11:18 PM

I am following a book and this is how they set up the vertex for the radar
//vertex.h
struct VertexPT
{
VertexPT()
:pos(0.0f, 0.0f, 0.0f),
tex0(0.0f, 0.0f){}
VertexPT(float x, float y, float z,
float u, float v):pos(x,y,z), tex0(u,v){}
VertexPT(const D3DXVECTOR3& v, const D3DXVECTOR2& uv)
:pos(v), tex0(uv){}

D3DXVECTOR3 pos;
D3DXVECTOR2 tex0;

static IDirect3DVertexDeclaration9* Decl;
};



//main code
HR(gd3dDevice->CreateVertexBuffer(6*sizeof(VertexPT), D3DUSAGE_WRITEONLY,
0, D3DPOOL_MANAGED, &mRadarVB, 0));
// Radar quad takes up quadrant IV. Note that we specify coordinate directly in
// normalized device coordinates. I.e., world, view, projection matrices are all
// identity.
VertexPT* v = 0;
HR(mRadarVB->Lock(0, 0, (void**)&v, 0));
v[0] = VertexPT(0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
v[1] = VertexPT(1.0f, 0.0f, 0.0f, 1.0f, 0.0f);
v[2] = VertexPT(0.0f, -1.0f, 0.0f, 0.0f, 1.0f);
v[3] = VertexPT(0.0f, -1.0f, 0.0f, 0.0f, 1.0f);
v[4] = VertexPT(1.0f, 0.0f, 0.0f, 1.0f, 0.0f);
v[5] = VertexPT(1.0f, -1.0f, 0.0f, 1.0f, 1.0f);
HR(mRadarVB->Unlock());

which part is setting the idenitity in that vertex declaration?

#1Anddos

Posted 27 January 2013 - 11:07 PM

I am following a book and this is how they set up the vertex for the radar

 

 

// Radar quad takes up quadrant IV.  Note that we specify coordinate directly in
    // normalized device coordinates.  I.e., world, view, projection matrices are all
    // identity.
    VertexPT* v = 0;
    HR(mRadarVB->Lock(0, 0, (void**)&v, 0));
    v[0] = VertexPT(0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
    v[1] = VertexPT(1.0f, 0.0f, 0.0f, 1.0f, 0.0f);
    v[2] = VertexPT(0.0f, -1.0f, 0.0f, 0.0f, 1.0f);
    v[3] = VertexPT(0.0f, -1.0f, 0.0f, 0.0f, 1.0f);
    v[4] = VertexPT(1.0f, 0.0f, 0.0f, 1.0f, 0.0f);
    v[5] = VertexPT(1.0f, -1.0f, 0.0f, 1.0f, 1.0f);
    HR(mRadarVB->Unlock());
 
which part is setting the idenitity in that vertex declaration?

PARTNERS