Modify vertex data during rendering 
Author Message
 Modify vertex data during rendering

Hi all,
I'm afraid the answer to this is terribly simple but
reading the sdk and scanning mboards has not driven the
light into my skull yet. I have a basic program which
reads in a POV raw triangle file and puts the data into a
DXvertexBuffer for rendering as a triangle list with my
D3DDevice.
Problem is , I want to modify the color of the vertices
without having to basically reinitialize the whole process.

Reading the documentation the only clue I saw was the
D3DVertexBuffer8SetData function, but if I read that
correctly it is actually 3 functions and would have to be
called for each element in the buffer (which I'm not even
going to contemplate unless a guru whacks me with an idiot
stick).

Any help would be greatly appreciated!

Thanks,
Zach McCain (my first dx program, be gentle)



Tue, 22 Feb 2005 10:58:52 GMT  
 Modify vertex data during rendering

BTW: DX8.1



Tue, 22 Feb 2005 23:14:06 GMT  
 Modify vertex data during rendering
lock the vb, get the memory pointer. then walk the memory, and modify the
data. then unlock the vb.

then you can use it to submit a DrawPrim request.

--
Phil Taylor
PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D screensavers, and a
few more bits and bobs.
http://msdn.microsoft.com/directx
This posting is provided "AS IS" with no warranties, and confers no rights.

Quote:
> Hi all,
> I'm afraid the answer to this is terribly simple but
> reading the sdk and scanning mboards has not driven the
> light into my skull yet. I have a basic program which
> reads in a POV raw triangle file and puts the data into a
> DXvertexBuffer for rendering as a triangle list with my
> D3DDevice.
> Problem is , I want to modify the color of the vertices
> without having to basically reinitialize the whole process.

> Reading the documentation the only clue I saw was the
> D3DVertexBuffer8SetData function, but if I read that
> correctly it is actually 3 functions and would have to be
> called for each element in the buffer (which I'm not even
> going to contemplate unless a guru whacks me with an idiot
> stick).

> Any help would be greatly appreciated!

> Thanks,
> Zach McCain (my first dx program, be gentle)



Fri, 04 Mar 2005 09:23:56 GMT  
 Modify vertex data during rendering
Are you creating the VertexBuffer yourself filling it with your own custom
vertices?
If you only need to set the values once, you can specify a vertex format
that includes diffuse color, then set the values in your vertices before
saving them to the VertexBuffer.

If you do it after the fact, you'll have to use Philip's method of locking
the buffer, etc.

-nerseus


Quote:
> Hi all,
> I'm afraid the answer to this is terribly simple but
> reading the sdk and scanning mboards has not driven the
> light into my skull yet. I have a basic program which
> reads in a POV raw triangle file and puts the data into a
> DXvertexBuffer for rendering as a triangle list with my
> D3DDevice.
> Problem is , I want to modify the color of the vertices
> without having to basically reinitialize the whole process.

> Reading the documentation the only clue I saw was the
> D3DVertexBuffer8SetData function, but if I read that
> correctly it is actually 3 functions and would have to be
> called for each element in the buffer (which I'm not even
> going to contemplate unless a guru whacks me with an idiot
> stick).

> Any help would be greatly appreciated!

> Thanks,
> Zach McCain (my first dx program, be gentle)



Sun, 26 Jun 2005 05:08:35 GMT  
 Modify vertex data during rendering

Whoops - I sorted my newsgroup on "From" instead of date. Sorry to answer
such an old post :)

-Nerseus


Quote:
> Are you creating the VertexBuffer yourself filling it with your own custom
> vertices?
> If you only need to set the values once, you can specify a vertex format
> that includes diffuse color, then set the values in your vertices before
> saving them to the VertexBuffer.

> If you do it after the fact, you'll have to use Philip's method of locking
> the buffer, etc.

> -nerseus



> > Hi all,
> > I'm afraid the answer to this is terribly simple but
> > reading the sdk and scanning mboards has not driven the
> > light into my skull yet. I have a basic program which
> > reads in a POV raw triangle file and puts the data into a
> > DXvertexBuffer for rendering as a triangle list with my
> > D3DDevice.
> > Problem is , I want to modify the color of the vertices
> > without having to basically reinitialize the whole process.

> > Reading the documentation the only clue I saw was the
> > D3DVertexBuffer8SetData function, but if I read that
> > correctly it is actually 3 functions and would have to be
> > called for each element in the buffer (which I'm not even
> > going to contemplate unless a guru whacks me with an idiot
> > stick).

> > Any help would be greatly appreciated!

> > Thanks,
> > Zach McCain (my first dx program, be gentle)



Sun, 26 Jun 2005 05:38:36 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Best Method For Rendering Vertices

2. Rendering Modified HTML in WebBrowser Control

3. Rendering Modified HTML in WebBrowser Control

4. Rendering Modified HTML in WebBrowser Control

5. Can't modify code during runtime anymore?

6. modifying the where clause during runtime in crystal reports 8.5

7. HW vertex processing vs. SW vertex processing optimizations...

8. data changed error during compact

9. VBA Word, data stored in strings during runtime, and after closing

10. Tag data gets lost during copy and paste

11. error generated during data.refresh, familiar to anyone?

12. Need help changing Data Control Recordsource during runtime

 

 
Powered by phpBB® Forum Software