Skip to main content
gamedev.net
🔒 Locked

moving vertices

Started by ligalize 7 replies 600+ views
Original Post
ligalize
ligalize
I'm very beginner in game programming and programming itself. I want to move my vertices from one position to another... is there special functions in DX or i have to creat my own. If DX8 has a function for that then can somebody show me some code example or progam. Best wishes to all programmers!!! Edited by - furby100 on December 24, 2001 10:47:45 AM
steg
steg
If you are using untransformed vertices you can use the world translation matrix to move your vertices from object space to world space, you would pass in x,y,z world offsets as part of your world matrix - see matrix translations / world transformations in the DX8 docs.

Reg''ds,
sTeVe


If it isn't working, take a bath, have a think and try again...
HDATA
HDATA
Hi Mr.Steve,
Can you explain to me how can i rotate or move ONLY my object, and no world matrix ?
Sebo
Sebo
You can''t.
If you want to rotate Objects without changing the matrix, you have to move every vertex itself.
This takes a lot of math and work.
You can rotate everything with changing the matrix.
For Objects, which don''t have to move, you can set an Identity Matrix.
That''s all, and it''s all really simple so why don''t using matrices?

Sebo
Shadows
Shadows
not sure if I understand what you''re after ligalize, with saying that you don''t want to move the world matrix do you mean that you don''t want to translate everything but a single object? If that''s the case then you can use multiple matrices for different objects. Otherwise it''s exactly as Sebo said alot of math and work when matrices are so easy.

// Shadows
DrunkenHyena
DrunkenHyena
G''day!

The World Matrix is used to transform a mesh from Model Space to World Space. You use it to rotate, scale, translate (move) your vertices. Each object can have it''s own World Matrix, you don''t set one per scene.

If you go to:
http://www.drunkenhyena.com/docs/d3d_tutorial.phtml

You''ll find some tutorials to walk you through the beginning stages of D3D8.


Stay Casual,

Ken
Drunken Hyena
Stay Casual,KenDrunken Hyena</FON
Sebo
Sebo
I don''t think this is 100 % correct
right, every Object can have its own matrix.
But there is only ONE World Matrix, you give the othe matrices to the worldmatrix
Well, this is how I think
DrunkenHyena
DrunkenHyena
quote:
Original post by Sebo
I don''t think this is 100 % correct
right, every Object can have its own matrix.
But there is only ONE World Matrix, you give the othe matrices to the worldmatrix
Well, this is how I think


G''day!

Same thing, just a different way of looking at it. Each object has it''s own Model to World transformation matrix, D3D is a state machine, so you set which one is currently active.

In my view there can be an infinite number of World matrices, but only one is active at any given time.


Stay Casual,

Ken
Drunken Hyena
Stay Casual,KenDrunken Hyena</FON
rileyriley
rileyriley
I use stacks of matrices to keep track of all of the different world matrices I''m using. When I want a new one, I just push the current one down, transform the object I''m currently drawing, and pop the old one back up when I''m done.

-----
Riley Lark
"Drinking more Dr. Pepper before 9 AM than most people drink by 9:30."
--Riley

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.