Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Calculating Vertex normals...

Author
Message
JetFireDX
22
Years of Service
User Offline
Joined: 13th Oct 2003
Location:
Posted: 9th Nov 2003 08:52
Hey all,
I am working on a program to convert a file from one format to a .X file and then load it into DBPro. I can convert everything I need so far just fine, (textures, uv's, vertices, etc...) but one problem I have come across is that the files I am starting with don't contain vertex normals for properly calculating light. Anybody here know a good/easy (easy to do and explain) method for calculating vertex normals? I am completely stuck and have been trying eveything I can find on the net, but I am not really a math person and could easily be misunderstanding the concepts. I know to calculate the surface normals for each of the polygons, and to then average those for every point a polygon meets which results in the vertex normal...but it just isn't coming out right. Any thoughts? Thanks!
JetFireDX
22
Years of Service
User Offline
Joined: 13th Oct 2003
Location:
Posted: 12th Nov 2003 01:01
Hello...anybody?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Nov 2003 08:52
It seems to me that you've got the right method. Just ensure that you don't normalise your vectors until the last step - I usually find I get slightly better results that way
JetFireDX
22
Years of Service
User Offline
Joined: 13th Oct 2003
Location:
Posted: 13th Nov 2003 03:34
Yeah I thought I was doing it right too, but for some reason the lighting comes out all wrong when the model is used. Can you post an example of how to go about doing it so I can stop ripping my hair out trying to figure it out? I'd really appreciate it.

Login to post a reply

Server time is: 2026-07-26 14:30:57
Your offset time is: 2026-07-26 14:30:57