Jump to content
  • Advertisement

Archived

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

Duekiller

Wtf i cant loop vertecies

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

how come this peice of code doesnt work CustomVertex Vertex[]= { for(float location;location<100;location++) { { location, 50.0f, 0.5f, 0x000000, }, { location, 250.0f, 0.5f, 0x000000, } } };

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
quote:
Original post by superpig
Sorry, but I''m not even going to begin to touch this one...


y not, is it really that bad?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hmmm....

What do you get when you use the REF device?

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
Hmmm....

What do you get when you use the REF device?


LMAO, AP

Duekiller: try this code:

CustomVertex Vertex[100];
for(int location; location<100; location+=2)
{
Vertex[location].x = location;
Vertex[location].y = 50.0f;
Vertex[location].z = 0.5f;
Vertex[location].diffuse = 0x00000000;

Vertex[location+1].x = location;
Vertex[location+1].y = 250.0f;
Vertex[location+1].z = 0.5f;
Vertex[location+1].diffuse = 0x00000000;
}



Richard "Superpig" Fine
Smoother than a greased baby
[TBRF|GP&T|Enginuity1|Enginuity2|Enginuity3|Enginuity4|Enginuity5]

Share this post


Link to post
Share on other sites
Or, duekiller, to answer your question:

If you''re declaring something like a customvertex array, you can not have a for loop, or ANY loop at all for that matter, in the declaration. You can only have numbers. YOu have to declare it, then loop like superpig did.

Share this post


Link to post
Share on other sites
quote:
Original post by shadowman13131
Or, duekiller, to answer your question:

If you''re declaring something like a customvertex array, you can not have a for loop, or ANY loop at all for that matter, in the declaration. You can only have numbers. YOu have to declare it, then loop like superpig did.

Just to make sure the OP understands *why* he can''t have loops. The reason is that the compiler has to determine the contents of that array at compile-time, and it can''t evaluate loops or whatever and use their output to fill it.

Muhammad Haggag

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!