Thread: Sphere backdrop problems

  1. #1
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607

    Sphere backdrop problems

    Ok I got the sphere working, but I have some problems.

    I really need a geosphere instead of a mathematical sphere. The mathematical sphere crunches my universe backdrop at the poles and looks ugly.

    Here is a screenshot of what I have so far.

    The mouse works as well and I think I've got the acceleration just about perfect. It really acts as though you are floating in space.

    My project is far too large to attach here. I will give out demos to those who have me on msn, however or those who PM me and would like to test it.

    So far the zipped up exe and associated graphics are 1.29MB. Way above the board limit. I wish we could post larger files.
    Last edited by VirtualAce; 09-24-2004 at 03:26 AM.

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Here is a sample of the ugly artifacts at one of the pole's of the sphere.

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Here is a shot of the sphere in wireframe mode - you can easily see why the graphics get jumbled at the poles.

  4. #4
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    I've either gone crazy or need a new monitor.. .The first 2 seem to be nothing but black.

    EDIT: Ok, I cranked the brightness and gamma up via nvidia display crap and could see it.
    Last edited by Vicious; 09-24-2004 at 10:13 AM.
    What is C++?

  5. #5
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    It is dark here cuz the board is white - but in-game you can see just fine.

    I cannot use a lot of light or it does not look right for a space scene.

  6. #6
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Here is another shot with a different space backdrop. Hopefully you can see this one.

  7. #7
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Here is another one with more ambient light in the universe.

  8. #8
    ---
    Join Date
    May 2004
    Posts
    1,379
    well done bubba
    you dont need me to say you are an excellent programmer

  9. #9
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Well thanks for the compliment but I'm still having some problems. Mouse cursor not appearing and such. Planets and sun to come very soon.

    Here is another shot - this shot makes it look like the sector is much bigger. I just wrapped the texture 8.0f/Faces - on my sphere.

    I may dump the sphere and go with a simple skybox. After all that is a lot of vertexes for just the background. I'm sure a cube would give just about the same effect.
    Last edited by VirtualAce; 09-25-2004 at 04:04 AM.

  10. #10
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704
    I'm just wondering- How come you are actually drawing a sphere when you could just be drawing a curved patch/mesh. Then, instead of rotating the sphere simply rotate the texture coordinates. this way you dont have to worry about polar distortion.


    Just thought I'd ask to see if you've considered doing it that way and ruled it out or something.
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

  11. #11
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Cannot draw a curved patch because when you rotate the texture coordinates you will see the textures pop over the edges of the triangles.

    This shot uses spherical texture mapping based on normals of the vertices.
    Last edited by VirtualAce; 09-25-2004 at 01:48 PM.

  12. #12
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Yet another screenie. This is the same sphere code only translated and changed a bit. So you get a planet. This one rotates although I can't show that here obviously.

    Obviously I've got the specular a bit high in this shot as well as the ambient light. Tonight I'll get that fixed. I'm still having the normal flitting problem - normals seem to flitter about like mad at lighted/non-lighted tri borders. I'm normalizing normals so I'm not sure why this is happening.

    You can also see distortion in the planet on the tris that have nearly flat surfaces - this is a direct side effect of the algo I'm using to texture the sphere.

    This sphere was created with D3DXCreateSphere, cloned with texture coords and normals, and then re-constructed as my own mesh. The previous sphere's were all hand-coded using mathematics. However, they got the same result so I dumped the code.
    Last edited by VirtualAce; 09-25-2004 at 02:11 PM.

  13. #13
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    I wish I had magical coding powers... you and prelude could save the world with a program....

    EDIT:
    Or destroy it.
    What is C++?

  14. #14
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Ok, here is the first planet w/o atmosphere. Now you can fly through the universe - coming together quite nicely.

  15. #15
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    This shows some of the lighting effects. Not using a per pixel light scheme yet but I'm writing the pixel shader for one.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. No clue how to make a code to solve problems!
    By ctnzn in forum C Programming
    Replies: 8
    Last Post: 10-16-2008, 02:59 AM
  2. C Pointers Problems
    By mhelal in forum C Programming
    Replies: 8
    Last Post: 01-10-2007, 06:35 AM
  3. Rendering problems (DirectX?)
    By OnionKnight in forum Tech Board
    Replies: 0
    Last Post: 08-17-2006, 12:17 PM
  4. Sphere code not working
    By VirtualAce in forum Game Programming
    Replies: 2
    Last Post: 10-03-2004, 07:29 AM
  5. What am I doing wrong? Help please...
    By SprinterSteve in forum C Programming
    Replies: 9
    Last Post: 04-17-2003, 09:35 PM