Jump to content
  • Advertisement

limesX

Member
  • Content Count

    7
  • Joined

  • Last visited

Everything posted by limesX

  1. limesX

    possible normals problem

    Finally I think it is working. And suddenly even my old normal calculations work. I think when I was cleaning my code I had some mistake with setting stride size prior rendering but I am not sure anymore. Here are the screenshots. I think its lighting the cube the way it should be now. If someone need code for this, I will post it. Thank you guys for your help...... And the screenshots..... Green vertex normals and red face normals.....
  2. Hi guys. Trying to solve this for a few days now but getting nowhere. I am having trouble with correctly displaying model when using diffuse and ambient light combination. In the picture you can see 2 larger cubes, top one using only ambient light, and bottom one using ambient + diffuse combination Smaller cube is just for showing where light is located. Can someone help me understand why is cube rendered the way it is? I was thinking problems with normals. I tried several different normal calculations and none of them work. Or maybe its not problem with the normals? I didnt want to post any code until maybe someone just give me a clue what might be happening? thanx
  3. limesX

    possible normals problem

    Hi. As you can see in the screen shot the normals are the problem. I tried all calculations I could found online and cant get correct results. Maybe can you help. I tried different model formats and different parsers for them. I will post here the .x file format for my model exported from blender. Mesh { // Cube mesh 8; 1.000000; 1.000000;-1.000000;, 1.000000;-1.000000;-1.000000;, -1.000000;-1.000000;-1.000000;, -1.000000; 1.000000;-1.000000;, 1.000000; 0.999999; 1.000000;, 0.999999;-1.000001; 1.000000;, -1.000000;-1.000000; 1.000000;, -1.000000; 1.000000; 1.000000;; 12; 3;0,3,1;, 3;4,5,7;, 3;0,1,4;, 3;1,2,5;, 3;3,7,2;, 3;4,7,0;, 3;3,2,1;, 3;5,6,7;, 3;1,5,4;, 3;2,6,5;, 3;7,6,2;, 3;7,3,0;; MeshNormals { // Cube normals 12; -0.000000;-0.000000;-1.000000;, 0.000000; 0.000000; 1.000000;, 1.000000; 0.000000;-0.000000;, -0.000000;-1.000000;-0.000000;, -1.000000; 0.000000;-0.000000;, 0.000000; 1.000000; 0.000000;, 0.000000;-0.000000;-1.000000;, 0.000000;-0.000000; 1.000000;, 1.000000;-0.000001; 0.000000;, -0.000000;-1.000000; 0.000000;, -1.000000; 0.000000;-0.000000;, 0.000000; 1.000000; 0.000000;; 12; 3;0,0,0;, 3;1,1,1;, 3;2,2,2;, 3;3,3,3;, 3;4,4,4;, 3;5,5,5;, 3;6,6,6;, 3;7,7,7;, 3;8,8,8;, 3;9,9,9;, 3;10,10,10;, 3;11,11,11;; } // End of Cube normals So, if I got this correct first number 8 defines 8 vertices with x,y,z coordinates. Next number 12 are indexes, like 3;0,3,1;, means 3 vertex, with index 0, 3 and 1 which gives single face(triangle). Then we have mesh normals, 12 normals with x,y,z. Then normal indexes: 12 indexes means 12 faces (triangles). so 3;0,0,0;, means 3 normals for 1 face. so now some help with vertex normal calculation: here is what i do: for every vertex for every face if vertex is in this face vertexnormal += face normal after that i divide each vertex normal with how many time was repeted and normalize it. it doesnt work. help pls.....
  4. limesX

    possible normals problem

    thx for quick info. i try to render everthing in wireframe including normals for each vertex. then I post back with some screenshot. i see that little triangle which apperas to be there, but i think it just "appears" to be there cause of colors. I post back with wireframe and normals....
  5. [color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][background=rgb(250, 251, 252)]hi. my first post.... hope someone can help.[/background] [/font] [color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][background=rgb(250, 251, 252)]i am trying to build my own simulator and i am using some of flightgears methods and concepts.[/background] [/font] [color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][background=rgb(250, 251, 252)]i have trouble understanding something.[/background] [/font] [color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][background=rgb(250, 251, 252)]flight gear uses cartesian coordinate system (The X axis runs along a line from the center of the earth out to the equator at the zero meridian. The Z axis runs along a line between the north and south poles with north being positive. The Y axis is parallel to a line running through the center of the earth out through the equator somewhere in the Indian Ocean). origin is the center of the earth.[/background] [/font] [color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][background=rgb(250, 251, 252)]now, in my program i want my origin to be my camera position (0,0,0).[/background] [/font] [color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][background=rgb(250, 251, 252)]how to convert cartesian to XNA coordinate system?[/background] [/font]
  6. hi. my first post.... hope someone can help. i am trying to build my own simulator and i am using some of flightgears methods and concepts. i have trouble understanding something. flight gear uses cartesian coordinate system (The X axis runs along a line from the center of the earth out to the equator at the zero meridian. The Z axis runs along a line between the north and south poles with north being positive. The Y axis is parallel to a line running through the center of the earth out through the equator somewhere in the Indian Ocean). origin is the center of the earth. now, in my program i want my origin to be my camera position (0,0,0). how to convert cartesian to XNA coordinate system?
  7. limesX

    coordinate system conversion

    My camera is sort of "static". You can just look around with camera, no movement (translation) or rotation. So I think for me is good to have my origin at camera position. The problem is, when I convert my lat,long,altitude position of my camera location to cartesian system the flightgear uses i get some big value(from my head 451322,461325,12453).... I want this to be 0,0,0. And everything else in game positioned relative to my camera.. What are the correct calculations (transformations)?
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!