Archived

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

FeveZ

dumb question - VB's and scaling

Recommended Posts

I''m going to kick myself when i get an answer to this one i know it!. (im writing my code in Visual Basic 6 btw ). Simple scenario: 1. I have a Vertex buffer. with a quad made up of 6 vertices. (3 for each triangle... I know, I know... 2 more than i need but besides the point). 2. I simply want to scale this along each of the XYZ coords. how do i do it? I''ve done this before but i cant remember how. Free goldfish to the first person to humiliate me :D FEv

Share this post


Link to post
Share on other sites
Hmm...

What i intend to do is copy a polygon to a temporary vertex buffer... scale it in there somehow then copy the modified vertex buffer back to a ''main'' VB which is the one DX renders the geometry from.

Is it actually possible to do this at this stage or do i have to actually scale everything as they are drawn? :|

Ideally i want to get the scaling correct initially and then just draw everything after that.. instead of faffing around with the polys each frame. :D

Any help/examples would be much appreciated.:D

Fev :]

Share this post


Link to post
Share on other sites
I think you can either lock the VB and then scale the "internal" vertices yourself, or you can just embed the scaling matrix into world transform matrix and let D3D pipeline do that for you.

Share this post


Link to post
Share on other sites
Thanks for the tip ''gamelife''.

although how is this actually done? Is this done with a call to d3dxmatrix scaling or is this going to involve some ''manual maths'' on my part?

[beginning to feel like a complete newbie now ROFL] :D

Fev

Share this post


Link to post
Share on other sites
Create a scaling matrix by hand, go through all your vertices, multiply them one by one with the scaling matrix, and write them back.

Or even easier, just multiply each component (x,y,z) with an appropriate scalar scale factor. That's 3 multiplies per vertex. Pretty much the easiest way to do it. Will symetricallky scale the model relative to the origin.

[edited by - Yann L on March 20, 2003 6:55:35 PM]

Share this post


Link to post
Share on other sites