Solved

Direct 3d 4th Vector

Posted on 2006-06-25
2
305 Views
Last Modified: 2013-12-26
Hi,

I'm trying to parse an old valve .map file for educational purposes

Here is a cube...

( 0 64 64 ) ( 64 64 64 ) ( 64 0 64 ) 0 0 0 1 1.000000 1.000000
( 0 0 0 ) ( 64 0 0 ) ( 64 64 0 ) 0 0 0 1 1.000000 1.000000
( 0 64 64 ) ( 0 0 64 ) ( 0 0 0 ) 0 0 0 1 1.000000 1.000000
( 64 64 0 ) ( 64 0 0 ) ( 64 0 64 ) 0 0 0 1 1.000000 1.000000
( 64 64 64 ) ( 0 64 64 ) ( 0 64 0 ) 0 0 0 1 1.000000 1.000000
( 64 0 0 ) ( 0 0 0 ) ( 0 0 64 ) 0 0 0 1 1.000000 1.000000

Only three vectors are provided per face. Obviously, three points per face doesn't compose the complete square required. Each face of the cube is partial, having one triangle...

Is anyone able to provide me with the correct formula for determining the opposing vertices, completing the partial faces?

Help with this is much appreciated...

Thanks in advance
0
Comment
Question by:HBPROCK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
JoseParrot earned 320 total points
ID: 16987396
Hi,

(   0 64 64 ) ( 64 64 64 )  ( 64   0 64 )  (   0   0 64 )  0 0 0 1 1.000000   1.000000
(   0   0   0 ) ( 64   0   0 )  ( 64 64   0 )  (   0 64   0 )  0 0 0 1 1.000000   1.000000
(   0 64 64 ) (   0   0 64 )  (   0   0   0 )  (   0 64   0 )  0 0 0 1 1.000000   1.000000
( 64 64   0 ) ( 64   0   0 )  ( 64   0 64 )  ( 64 64 64 )  0 0 0 1 1.000000   1.000000
( 64 64 64 ) (   0 64 64 )  (   0 64   0 )  ( 64 64   0 )  0 0 0 1 1.000000   1.000000
( 64   0   0 ) (   0   0   0 )  (   0   0 64 )  ( 64   0 64 )  0 0 0 1 1.000000   1.000000

Notice that in each line one of the tree coordinates ( x  y  z) are the same. For exemple, in line 1, all z's are 64, meaning the plane is at z=64. This is the cube's back face.
Line 2 is the front face, all z's are 0.
Line 3 is left face, all x's are 0.

Seems to be an incomplete information. For exemple, there is no number of vertices, number of edges, number of faces. Maybe the data always refers to polygons. It depends on the software you are using.

Actually the model (in this case, a cube) isn't calculated by formula, but by an algorithm instead. Hope now you watch a cube in your screen.

Jose
0
 

Author Comment

by:HBPROCK
ID: 16988423
It turns out you're right!

Unforunately the algorithm is extremely complicated. It'll be many pages of code later before I can watch a cube.

Many thanks for pointing me in the right direction.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question