Sign in to follow this  

how to animate billboarded grass ?

Recommended Posts

i tried the animate billboard but its sucked, which method i need to use?i did in way by locking unlocking vertex buffer but its continuesly scaled without stopping...i need to set a rest points,may be verlet integration, can you give me some point? void Animate() { BillboardVertex *bvertexdata; BYTE* vertexptr; m_BillboardVb->Lock(0,0,(void**)&vertexptr,0); memcpy(vertexptr,bvertexdata,sizeof(bvertexdata)); int GetState; enum State{step1,step2}; for(int i=0;i<5;i++) { for(int i=0;i<5;i++) { GetState=step1; bvertexdata[i].x+=m_WindDirection.x/10*timeGetTime(); if(m_WindDirection.x=5) GetState=step2; bvertexdata[i].x-=m_WindDirection.x/10*timeGetTime(); } }

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this