Archived

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

worldcraft .map file and 4. coordinate

This topic is 5820 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

The following data is from a worldcraft .map file. It describes a cube (16x16x16). How do i calculate the 4. coordinate so I can draw a polygon?
  
(  8,  8,  8 ) (  8, -8,  8 ) ( -8, -8,  8 ) //front

(  8, -8, -8 ) (  8,  8, -8 ) ( -8,  8, -8 ) //back

( -8, -8,  8 ) ( -8, -8, -8 ) ( -8,  8, -8 ) //left

(  8, -8, -8 ) (  8, -8,  8 ) (  8,  8,  8 ) //right

( -8,  8,  8 ) ( -8,  8, -8 ) (  8,  8, -8 ) //top

( -8, -8, -8 ) ( -8, -8,  8 ) (  8, -8,  8 ) //bund


glBegin(GL_POLYGON);
  //front

  glVertex3f( 8, 8, 8);
  glVertex3f( 8,-8, 8);
  glVertex3f(-8,-8, 8);
  glVertex3f(??,??,??);
glEnd();
  
Edited by - soreno on January 10, 2002 4:45:01 AM

Share this post


Link to post
Share on other sites
glBegin(GL_POLYGON);
//front
glVertex3f( 8, 8, 8);
glVertex3f( 8,-8, 8);
glVertex3f(-8,-8, 8);
glVertex3f(-8, 8, 8);
glEnd();

I''m not sure, but:

x y
+ +
+ -
- -
- + <-- isn''t it a logical idea

Share this post


Link to post
Share on other sites
let me try


CVector v1,v2,v3,v4;

v1=CVector( 8.f, 8.f, 8.f);
v2=CVector( 8.f,-8.f, 8.f);
v3=CVector(-8.f,-8.f, 8.f);
v4=(v1+v3)*0.5f + ( (v1+v3)*0.5f - v2 );

/*
x4=(x1+x3)*0.5f + ( (x1+x3)*0.5f - x2 );
y4=(y1+y3)*0.5f + ( (y1+y3)*0.5f - y2 );
z4=(z1+z3)*0.5f + ( (z1+z3)*0.5f - z2 );
*/
this would be the way I''d do it. (hope there are no bugs)

Share this post


Link to post
Share on other sites
Could it be the following ?

Vertex A : xa, ya, za
Vertex B : xb, yb, zb
Vertex C : xc, yc, zc
Vertex D : xc+xb-xa, yc+yb-ya, zc+zb-za

so that AB = DC (vectors I mean).

Share this post


Link to post
Share on other sites
There is an "Export to .MAP" option in file pull-down menu. However, save your levels in progress as RMF format since WorldCraft''s MAP is quite buggy.
Oztan.

Share this post


Link to post
Share on other sites
tisk tisk tisk abandoning a project just because of a few bumps along the road. It took me 3 days to modify my terrain engine for triangle strips and to get textures to work properly. Don''t stop finish it.

Share this post


Link to post
Share on other sites
I 100% understand your comment, and would probably have made some similar comment if I was you. However I feel the need to defend myself and will do so..
Actually it''s only that part of the project that''s cancled. Mainly because schools is though this semester, but also because I figured it''s tooo damn early in my process of learning gl to use worldcraft as an editor. There are still some more basic stuff to be learned..

Share this post


Link to post
Share on other sites