Re: [hlcoders] VALVe : map to dxf...

2002-10-13 Thread Cortex
Hi, (answer at bottom)

David Speyrer [EMAIL PROTECTED] said :

 This code assumes that every vertex in the solid can be referred to
 by a unique index, so a rectangular solid would have 8 verts with
 indices from 0 to 7. CreatePointIndexList fills out an array with the
 indices of verts on the given face in clockwise winding order.
 GetConnectionVertex returns the vertex between the two given edges.
 The code for CreatePointIndexList is below.

OK, I don't understand two things :( Now, I've managed to add the triangular
faces that are not referenced in the.map file and I only need to get the
CreatePointIndexList loop working...

As I've understood, all the vertices have an unique ID (set arbitrarly).
Then, the CreatePointIndexList returns the indexes of the vertices on the
face in clockwise winding order.

I've two questions...
- how do I set the indexes of the vertices ? Is there a specifical
order ?
- why is there a GetConnectionVertex function ?? As I've
understood, the edges are the extremity of the face. So, they are vertices
too ! And why would it be vertices BETWEEN them ?

Thanks for your answer(s) ;)

 - Cortex : HL Albator coder and mapper ( www.hlalbator.fr.st )
 - email : [EMAIL PROTECTED]ICQ : 71548738



___
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders




RE: [hlcoders] VALVe : map to dxf...

2002-10-09 Thread Chris Bokitch

The resource (linked below) has been updated with this information.

http://coding.valve-erc.com/?alias=map2dxf

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of David Speyrer
Sent: Wednesday, October 09, 2002 1:51 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [hlcoders] VALVe : map to dxf...


This code assumes that every vertex in the solid can be referred to by a
unique index, so a rectangular solid would have 8 verts with indices from 0
to 7. CreatePointIndexList fills out an array with the indices of verts on
the given face in clockwise winding order. GetConnectionVertex returns the
vertex between the two given edges. The code for CreatePointIndexList is
below.

Hope this helps!
-- David

//
// Create point list, but return indices instead of vertices.
//
PINT CSSolid::CreatePointIndexList(CSSFace face, PINT piPoints)
{
PINT pts;
int nPts = 0;

if (piPoints)
pts = piPoints;
else
pts = new int[face.nEdges+1];

SSHANDLEINFO hi;

for (int i = 0; i  face.nEdges; i++)
{
// calc next edge so we can see which is the next clockwise
point
int iNextEdge = i+1;
if (iNextEdge == face.nEdges)
iNextEdge = 0;

CSSEdge *edgeCur = (CSSEdge*) GetHandleData(face.Edges[i]);
CSSEdge *edgeNext = (CSSEdge*)
GetHandleData(face.Edges[iNextEdge]);

SSHANDLE hVertex = GetConnectionVertex(edgeCur, edgeNext);
ASSERT(hVertex);

GetHandleInfo(hi, hVertex);
pts[i] = hi.iIndex;
}

return pts;
}


-Original Message-
From: Cortex [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 1:11 PM
To: [EMAIL PROTECTED]
Subject: [hlcoders] VALVe : map to dxf...


Hello,

I'm trying to create a map to dxf converter, using the code that Valve gave
gratefully (http://www.coding.valve-erc.com) ;) But I don't understand the
LAST (!!) loop :( Here's the malicious piece of code :) :

   // triangulate each face and write
   for(i = 0; i  m_nFaces; i++)
   {
  CSSFace face = m_Faces[i];
  PINT pVerts = CreatePointIndexList(face);

  for(int v = 0; v  face.nEdges; v++)
 pVerts[v]++;

  for(v = 0; v  face.nEdges-2; v++)
  {
 fprintf(stream, 0\nVERTEX\n8\n%s\n10\n0\n20\n0\n30\n
0\n70\n128\n71\n%d\n72\n%d\n73\n%d\n, szName,
v == 0 ? pVerts[0] : -pVerts[0],
pVerts[v+1],
v == (face.nEdges-3) ? pVerts[v+2] : -pVerts[v+2]
);
  }
   }

I only need more informations about the CSSFace class (the members), the
CreatePointIndexList and the calculation of the nEdges member of CSSFace
:) Then, I'll be able to understand what gets done, and be able to merge it
to my code.

Thanks to anyone who could help me ;)

 - Cortex : HL Albator coder and mapper ( www.hlalbator.fr.st )
 - email : [EMAIL PROTECTED]ICQ : 71548738



___
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
___
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

___
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders




RE: [hlcoders] VALVe : map to dxf...

2002-10-09 Thread Chris Bokitch

btw - if anyone makes anything cool with this code, let me know and i'll
link to it from this resource. :)

-Original Message-
From: Chris Bokitch [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 09, 2002 5:16 PM
To: [EMAIL PROTECTED]
Subject: RE: [hlcoders] VALVe : map to dxf...


The resource (linked below) has been updated with this information.

http://coding.valve-erc.com/?alias=map2dxf

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of David Speyrer
Sent: Wednesday, October 09, 2002 1:51 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [hlcoders] VALVe : map to dxf...


This code assumes that every vertex in the solid can be referred to by a
unique index, so a rectangular solid would have 8 verts with indices from 0
to 7. CreatePointIndexList fills out an array with the indices of verts on
the given face in clockwise winding order. GetConnectionVertex returns the
vertex between the two given edges. The code for CreatePointIndexList is
below.

Hope this helps!
-- David

//
// Create point list, but return indices instead of vertices.
//
PINT CSSolid::CreatePointIndexList(CSSFace face, PINT piPoints)
{
PINT pts;
int nPts = 0;

if (piPoints)
pts = piPoints;
else
pts = new int[face.nEdges+1];

SSHANDLEINFO hi;

for (int i = 0; i  face.nEdges; i++)
{
// calc next edge so we can see which is the next clockwise
point
int iNextEdge = i+1;
if (iNextEdge == face.nEdges)
iNextEdge = 0;

CSSEdge *edgeCur = (CSSEdge*) GetHandleData(face.Edges[i]);
CSSEdge *edgeNext = (CSSEdge*)
GetHandleData(face.Edges[iNextEdge]);

SSHANDLE hVertex = GetConnectionVertex(edgeCur, edgeNext);
ASSERT(hVertex);

GetHandleInfo(hi, hVertex);
pts[i] = hi.iIndex;
}

return pts;
}


-Original Message-
From: Cortex [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 1:11 PM
To: [EMAIL PROTECTED]
Subject: [hlcoders] VALVe : map to dxf...


Hello,

I'm trying to create a map to dxf converter, using the code that Valve gave
gratefully (http://www.coding.valve-erc.com) ;) But I don't understand the
LAST (!!) loop :( Here's the malicious piece of code :) :

   // triangulate each face and write
   for(i = 0; i  m_nFaces; i++)
   {
  CSSFace face = m_Faces[i];
  PINT pVerts = CreatePointIndexList(face);

  for(int v = 0; v  face.nEdges; v++)
 pVerts[v]++;

  for(v = 0; v  face.nEdges-2; v++)
  {
 fprintf(stream, 0\nVERTEX\n8\n%s\n10\n0\n20\n0\n30\n
0\n70\n128\n71\n%d\n72\n%d\n73\n%d\n, szName,
v == 0 ? pVerts[0] : -pVerts[0],
pVerts[v+1],
v == (face.nEdges-3) ? pVerts[v+2] : -pVerts[v+2]
);
  }
   }

I only need more informations about the CSSFace class (the members), the
CreatePointIndexList and the calculation of the nEdges member of CSSFace
:) Then, I'll be able to understand what gets done, and be able to merge it
to my code.

Thanks to anyone who could help me ;)

 - Cortex : HL Albator coder and mapper ( www.hlalbator.fr.st )
 - email : [EMAIL PROTECTED]ICQ : 71548738



___
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
___
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

___
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders




Re: [hlcoders] VALVe : map to dxf...

2002-10-08 Thread Skyler York

[ Converted text/html to text/plain ]

A lot of the meaning depends directly on the format of the DXF format, and I
personally am not familiar with it :(  For example, the loop that increments
each index doesn't make any sense out of context, and neither do the sign
changes.  However, the indices seem to be printed in a fan-like manner,
starting from the first one, if that has any significance.
From: Cortex
Reply-To: [EMAIL PROTECTED]
To:
Subject: [hlcoders] VALVe : map to dxf...
Date: Mon, 7 Oct 2002 22:11:17 +0200

Hello,

I'm trying to create a map to dxf converter, using the code that Valve gave
gratefully (http://www.coding.valve-erc.com) ;) But I don't understand the
LAST (!!) loop :( Here's the malicious piece of code :) :

 // triangulate each face and write
 for(i = 0; i  m_nFaces; i++)
 {
 CSSFace face = m_Faces[i];
 PINT pVerts = CreatePointIndexList(face);

 for(int v = 0; v  face.nEdges; v++)
 pVerts[v]++;

 for(v = 0; v  face.nEdges-2; v++)
 {
 fprintf(stream, 0\nVERTEX\n8\n%s\n10\n0\n20\n0\n30\n
 0\n70\n128\n71\n%d\n72\n%d\n73\n%d\n, szName,
 v == 0 ? pVerts[0] : -pVerts[0],
 pVerts[v+1],
 v == (face.nEdges-3) ? pVerts[v+2] : -pVerts[v+2]
 );
 }
 }

I only need more informations about the CSSFace class (the members), the
CreatePointIndexList and the calculation of the nEdges member of CSSFace
:) Then, I'll be able to understand what gets done, and be able to merge it
to my code.

Thanks to anyone who could help me ;)

 - Cortex : HL Albator coder and mapper ( www.hlalbator.fr.st )
 - email : [EMAIL PROTECTED]  ICQ : 71548738



___
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

--
MSN Photos is the easiest way to share and print your photos: Click Here[1]

===References:===
  1. http://g.msn.com/1HM1ENUS/c156??PI=44364

___
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders




[hlcoders] VALVe : map to dxf...

2002-10-07 Thread Cortex

Hello,

I'm trying to create a map to dxf converter, using the code that Valve gave
gratefully (http://www.coding.valve-erc.com) ;) But I don't understand the
LAST (!!) loop :( Here's the malicious piece of code :) :

   // triangulate each face and write
   for(i = 0; i  m_nFaces; i++)
   {
  CSSFace face = m_Faces[i];
  PINT pVerts = CreatePointIndexList(face);

  for(int v = 0; v  face.nEdges; v++)
 pVerts[v]++;

  for(v = 0; v  face.nEdges-2; v++)
  {
 fprintf(stream, 0\nVERTEX\n8\n%s\n10\n0\n20\n0\n30\n
0\n70\n128\n71\n%d\n72\n%d\n73\n%d\n, szName,
v == 0 ? pVerts[0] : -pVerts[0],
pVerts[v+1],
v == (face.nEdges-3) ? pVerts[v+2] : -pVerts[v+2]
);
  }
   }

I only need more informations about the CSSFace class (the members), the
CreatePointIndexList and the calculation of the nEdges member of CSSFace
:) Then, I'll be able to understand what gets done, and be able to merge it
to my code.

Thanks to anyone who could help me ;)

 - Cortex : HL Albator coder and mapper ( www.hlalbator.fr.st )
 - email : [EMAIL PROTECTED]ICQ : 71548738



___
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders