In triangle list, for a triangle, I know how to calculate this normal and then assign it to its three vertices...but when I use triangle strip...as you know...one vertex belongs to two triangle...in other words, one vertex has two normal...how to deal with this ???

In short, if you use triangle strip to reprensent cube, how you assign the normal to each vertex in lights?

Thanks!
Posted on 2003-05-04 02:47:08 by Inya
Perhaps try working out the average of the two normals you have for the vertex. x = (x1 + x2)/2, same for y & z, then normalise x, y & z. Just a thought.
Posted on 2003-05-04 07:00:26 by Eóin
oh,no...
I should not calculate the average normal because it's a cube,not a sphere or so..if i use average normal...it will look strange like a ball surface as you may know...
Posted on 2003-05-04 09:08:21 by Inya
Of course. I can't think of any solution then :(
Posted on 2003-05-04 11:49:35 by Eóin
(cheat) load the square into the .X file viewer and output a triangle strip with normals.
Posted on 2003-05-04 11:52:18 by bitRAKE
Afternoon, Inya.
In short, if you use triangle strip to reprensent cube, how you assign the normal to each vertex in lights?

You can't.

As you mentioned yourself, in a trianglestrip two vertices share the same normal.

Cheers,
Scronty
Posted on 2003-05-04 18:51:47 by Scronty
Thanks all, I am a newcomer and I really like the atmosphere here...Happy coding~~~~~~~~~~~

:o)

Regards
Inya
Posted on 2003-05-05 02:05:26 by Inya
btw, bitRAKE , you mention .X file viewer...would you plz tell me where I can find it?
Posted on 2003-05-05 02:09:52 by Inya
Afternoon, Inya.

I am a newcomer

heh.
I didn't notice that:tongue:

Welcome to the board. Hope you enjoy your stay:alright: .

Feel free to post anything you're having difficulty with, or anything you're not sure of, or (even) anything that's got your interest up;) . This board has quite a few talented members covering practically all related computer fields.

Try to use the Search feature (top/right) when you can (or...whenever you remember about it, like me:tongue: ). However...since the Game Programming forum doesn't get many threads/posts in it, don't worry if you post something that's already been covered.
In most cases, a particular subject would only have been touched upon, and your questions would help expand the boards knowledge base.

Cheers,
Scronty
Posted on 2003-05-05 04:33:50 by Scronty

btw, bitRAKE , you mention .X file viewer...would you plz tell me where I can find it?
The one that comes in the SDK is the only one I've used.
Posted on 2003-05-05 07:15:13 by bitRAKE
Triangle strips are intended for either very flat surfaces, or curvy surfaces (think terrain). To create cubes, you need six triangle strips, one for each side. Not very efficient in terms of # of vertices, but apparently vertices don't take up as much space as, say, textures.
Posted on 2003-05-05 23:29:39 by AmkG
I got it and thanks...!!

Best regards
Inya
Posted on 2003-05-06 07:47:27 by Inya

Perhaps try working out the average of the two normals you have for the vertex. x = (x1 + x2)/2, same for y & z, then normalise x, y & z. Just a thought.

I remember that method was used (some years ago when I checked out some dos-mode 3d stuff) when calculating point-normals or whatever they're called, I mean a normal for each vertice in a triangle. One added up the face normals of all faces the vertice belonged to, and divided by nr of faces belonging to, then normalized IIRC. Then could be used for gouraud or specular-high lights and stuff, it looked wonderful.
Posted on 2003-05-06 07:56:52 by david