Advertisement

Model Question (not how to load them)

Started by August 19, 2000 06:14 PM
9 comments, last by Mike00 24 years, 3 months ago
I added a model of a ship with guns (simple cylinders) to my game using 3dExploration. Now when I look through the code, I can see where it says things like: // Object: Inner Right Gun , {1342,1333,1334 ,409,410,411 ,0,4,6 }, {1343,1342,1334 ,412,409,411 ,8,0,6 }, {1343,1334,1335 ,412,411,411 ,8,6,12 }, {1344,1343,1335 ,412,412,411 ,14,8,12 }, etc but how can I find out the actual coordinates of the end of each gun so that I can make the lasers shoot straight out of them. I don''t want to just translate a little to the right to be somewhat at the location of the right gun. I want the exact location, so when the ship spins, the lasers will still come from the gun. Any ideas? Thanks!
Someone please answer this
Advertisement
just eye it. trust me, nobody''s gonna know the difference. either that,

or you can do this:

for each vertex listed, set the gun emitter to that vertex, compile, run it, and press the fire button. if it''s not the right vertex, just test the next vertex until you find the right one.

i''d go with option 1 if i were you.

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
okay, i figured out a slight better solution to option 2 above. in your 3d modeller program, make sure you mark the values of the vertex where the laser emitter is positioned. after exporting to explorer, scan through all the vertices, and find those coordinates. then after you''ve found it, then count as to how many vertices to that point you get in the vertex array. that will be your index value. then, you''ve found the point.


a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
Well anyone else has any better answer than this????? Plz reply to this post with your answers soon.Coz i also have a ship and i want to know how i can apply the particle effects to my ship''s thrusters so it looks like the thrusters are leaving a jet trail...
Hmm, in the code 3dExploration made, there''s a part like this:

static short face_indicies[3040][9] = {
// Object: Far Left Gun
, {419,418,427 ,9,190,191 ,6,4,0 }, {428,419,427 ,191,9,191 ,8,6,0 },
{420,419,428 ,9,9,191 ,12,6,8 }, {429,420,428 ,191,9,191 ,14,12,8 },
{421,420,429 ,9,9,191 ,18,12,14 }, {430,421,429 ,191,9,191 ,20,18,14 }, etc

One like this:

static GLfloat verticies [1566][3] = {
{0.0658313f,0.455901f,-0.00772106f},{0.0658313f,0.367704f,-0.00772106f},{0.0658313f,0.279507f,-0.00772106f},
{0.0658313f,0.19131f,-0.00772106f},{0.0658313f,0.103113f,-0.00772106f},{0.0658313f,0.0149155f,-0.00772106f},

Like this:

static GLfloat normals [618][3] = {
{0.790939f,0.407294f,0.456648f},{0.853633f,0.16857f,0.492843f},{0.946008f,0.202028f,0.253482f},
{0.858682f,0.457961f,0.230082f},{0.913297f,0.407294f,0.0f},{0.985689f,0.168571f,0.0f},

This:

static GLfloat textures [513][2] = {
{0.08333f,0.0f},{0.08333f,0.0625f},{0.04167f,0.0625f},
{0.04167f,0.0f},{0.0f,0.0f},{1.0f,0.0625f},

(although the texture doesn''t show )

......

I guess you mean do look for the guns in that vertices section..... It''d be impossible to label all of them though...
Does this:
{0.0658313f,0.455901f,-0.00772106f},{
mean the XYZ coordinates of that vertex?

Hmm, any other ideas?

Thanks!
Advertisement
?

Please help
actually, i kinda want to know the solution too, but the way i have it now, is i measured the coordinates of all the points that i want something to do with in my modelling program (i.e. engine exhaust, canopy location, spark emitter, collision points etc.) and then i apply the transformation that i apply to all other points of the model to these "special action" points. that way, whenever the model is rotated, translated, whatever, the action (event) emitter will always come from that point. i''m not really sure if there''s a better solution than this, or the above mentioned method.

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
or how about this: this is a visual example, but still quite tedious:

    //initializestatic int testvalue = 0;float point[3];//increment on keypressif(GetAsyncKeyState(''SOMEKEY''))testvalue++;//assign new value to pointpoint[0] = verticies[testvalue][0];point[1] = verticies[testvalue][1];point[2] = verticies[testvalue][2];//render point on meshglPointSize(3.0);  //make a good sizeglBegin(GL_POINTS);  glVertex3d(point[0],point[1], point[2]);glEnd();    


this will cycle through all points on the mesh, and will highlight the point that the value is set to.

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
The way I do it is,
My world has an ObjectList like the CObjlist in MFC.
Now the object list holds pointers to all the objects in the world. Each object has it''s own position, textures and so on...
Now when you fire a gun(an object), it will shoot out allright and then my viewing transformations would decide the actual line of the fire.

So much for this crappy idea..
Neo.

This topic is closed to new replies.

Advertisement