#### Archived

This topic is now archived and is closed to further replies.

# Vertex buffer question

This topic is 6249 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I''m using a vertex buffer to render primitives to the screen, and a matrix to move them around. However, I''d like to render another primitive to the screen, without it being moved around by the matrix. I was thinking of creating a different vertex buffer to hold those primitives. Is this the best way to go about it? Does having 2 vertex buffers cause a significant performance loss? Thanks.

##### Share on other sites
Whoops... it turns out that creating a vertex buffer still doesn't solve the problem- the matrix effects both. So how do I make the matrix's transformations apply to only one? I don't need another D3D Device, do I? Thanks.

Edited by - Oddball on August 9, 2001 8:56:48 PM

##### Share on other sites
Hey there,

Your problem is relatively easy to fix.

You can either:

- Set the matrix.
- Render the first primitive.
- Render the Second Primitive.

* Or *

- Render the Second Primitive.
- Set the Matrix.
- Render the First Primitive.

A matrix doesn''t effect just the object you are rendering. It effects the whole world. After moving your first object according to the matrix, you have to reset the matrix to its default position; or set a new position, before rendering your next polygon.

I hope that wasn''t too confusing. Just ask if you need more help.

Derek Sauer
dereksauer@hotmail.com

##### Share on other sites
SetTransform(...);
DrawPrimitive(...);
SetTransform(...);
DrawPrimitive(...);

If you''re drawing 2 of the same object, then you can just render it twice. If there are 2 different objects you can either use multiple vertex buffers, or a single vertex buffer and multiple index buffers.

1. 1
2. 2
3. 3
frob
20
4. 4
Rutin
19
5. 5

• 32
• 13
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
632558
• Total Posts
3007077

×