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!
In short, if you use triangle strip to reprensent cube, how you assign the normal to each vertex in lights?
Thanks!
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.
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...
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...
Of course. I can't think of any solution then :(
(cheat) load the square into the .X file viewer and output a triangle strip with normals.
Afternoon, Inya.
You can't.
As you mentioned yourself, in a trianglestrip two vertices share the same normal.
Cheers,
Scronty
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
Thanks all, I am a newcomer and I really like the atmosphere here...Happy coding~~~~~~~~~~~
:o)
Regards
Inya
:o)
Regards
Inya
btw, bitRAKE , you mention .X file viewer...would you plz tell me where I can find it?
Afternoon, Inya.
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
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
btw, bitRAKE , you mention .X file viewer...would you plz tell me where I can find it?
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.
I got it and thanks...!!
Best regards
Inya
Best regards
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.