Need help with line normals July 20, 2011 03:17AM | Registered: 13 years ago Posts: 363 |
Re: Need help with line normals July 20, 2011 09:35AM | Registered: 13 years ago Posts: 99 |
// heres what I do , RenderModelMinimalHardNorms is the method you are currently using. void Render3D::RenderModelMinimal(HashLabel ModelName, Mtx& ModelView) { //soft edges GX_LoadPosMtxImm(ModelView, GX_PNMTX0); Mtx mat; guMtxInverse(ModelView,mat); guMtxTranspose(mat,ModelView); GX_LoadNrmMtxImm(ModelView, GX_PNMTX0); DisplayListInfo& Info( m_DispayListContainer[ModelName] ); GX_CallDispList(Info.m_dispList,Info.m_dispSize); } void Render3D::RenderModelMinimalHardNorms(HashLabel ModelName, Mtx& ModelView) { //hard edges GX_LoadPosMtxImm(ModelView, GX_PNMTX0); GX_LoadNrmMtxImm(ModelView, GX_PNMTX0); DisplayListInfo& Info( m_DispayListContainer[ModelName] ); GX_CallDispList(Info.m_dispList,Info.m_dispSize); }
Re: Need help with line normals July 20, 2011 02:11PM | Registered: 13 years ago Posts: 363 |
Re: Need help with line normals July 21, 2011 07:53PM | Registered: 13 years ago Posts: 2 |
GX_Begin(...) //Draw edges of top face GX_End(); GX_Begin(...) //Draw edges of bottom face GX_End(); ...
Re: Need help with line normals July 21, 2011 07:55PM | Registered: 13 years ago Posts: 99 |
void CalcNormal(guVector* InVec1, guVector* InVec2, guVector* InVec3, guVector* OutVec) { guVector Tempv1,Tempv2; guVecSub(InVec3, InVec1, &Tempv1); guVecSub(InVec3, InVec2, &Tempv2); guVecCross(&Tempv2,&Tempv1,OutVec); guVecNormalize(OutVec); }
Re: Need help with line normals July 21, 2011 10:57PM | Registered: 13 years ago Posts: 363 |
Re: Need help with line normals July 22, 2011 10:01AM | Registered: 13 years ago Posts: 99 |
Re: Need help with line normals July 22, 2011 10:35AM | Registered: 13 years ago Posts: 2 |
what i wanted to say is that you have to draw each edge twice. otherwise you dont know wich normal you have to assign to the vertices of the edge. have a look at how glut does it. (Link).Quote
You are drawing the edges of the cube and not the faces of the cube