Advertisement

Structure Problem

Started by October 16, 2001 12:19 PM
1 comment, last by Leyder Dylan 23 years, 4 months ago
Hi, I''ve this structure : VECTOR 3D vPolygone[4]; My problem is that with this structure, I''ve only one polygone. I would like to make another structure for calling more that one polygone. Ex : Polygone[0].vPolygone[4]; // Polygone 1 Polygone[1].vPolygone[4]; // Polygone 2 Polygone[2].vPolygone[4]; // Polygone 3 etc ... Thanks in advance. ======================== Leyder Dylan http://ibelgique.ifrance.com/Slug-Production/
========================Leyder Dylan (dylan.leyder@slug-production.be.tf http://users.skynet.be/fa550206/Slug-Production/Index.htm/
A very simple and quick solution would be to use a structure (or class) of "polygon's".

For example just create a structure like this in C++:


struct POLYGON
{
VECTOR3D vertex[4];
};


Then create an array of POLYGON's:


POLYGON polygons[NUM_POLYGONS];


then you can access the polygon's in the way you specified in your post:


polygons[0].vertex[0].x = 15; // for example


You should use a class if you also need associated methods.
I hope that helps.


Edited by - drown on October 16, 2001 1:37:10 PM
http://www.freewebs.com/somebodyshootme/
Advertisement
Thanks a million.

========================
Leyder Dylan
http://ibelgique.ifrance.com/Slug-Production/
========================Leyder Dylan (dylan.leyder@slug-production.be.tf http://users.skynet.be/fa550206/Slug-Production/Index.htm/

This topic is closed to new replies.

Advertisement