[MDX] [C#] Ray Picking and Point list brightness issues

Posted on 2006-05-08
Last Modified: 2013-12-08
Rather than ask 2 questions, I'll stick them both in here.

Problem #1 (for 250 points):

I have a space station, I have a camera. I am trying to pick the distance of the station from the camera and the space station face being looked at, mostly for docking purposes. This was working brilliantly (detected distance perfectly and showed the right face number). However, when I decided to move the space station 1000 units in an arbitary direction, the total distance became the camera distance to the space station + the distance from the space station to the origin. Now this could probably be solved with pythagoras, but I'd rather find the problem in my code if there is one.

Problem #2 (for 125 point bonus):

I have a skybox, a pointlist, and my camera. Lighting is disabled. I have coded the pointlist to flicker in intensity (higher values of grey to white). The skybox and the pointlist are rendered whilst the z-buffer is disabled, and the skybox is rendered BEFORE the pointlist. The problem is that when the skybox is enabled the pointlist is all black, I can tell this because I can see a few of the points in the bright patches of my skybox texture. I tested rendering only 1 subset of my skybox and the points all appear blue, and flicker in intensity. When the skybox is disabled the points all appear perfect and flickering grey-white. I need to find out why my skybox is influencing my pointlist.

Does anyone have any ideas? If people provide really good answers, I'll consider dumping more points on this question.

Question by:Knossos
    LVL 3

    Accepted Solution

    #1, could you please post your distance finding code. If you are using  Mesh.Intersect, the intersect information gleaned by it has a distance property that most likely should be utilized by your distance finding code.

    #2, My thought is not exactly consistent with your issue, but I'll throw it out there so you can see if it offers you a clue. Your Skybox most likely utilizes PositionedTextured vertices, which like you say, is fine with lighting disabled. But if the vertices in your point list are PositionedColored, then they do require lighting to be enabled to see them properly. If this is the case, just before you render the pointlist, you could insert a device.renderstate.lightinh = true; and when done, toggle it back to off for the skybox draw.

    Without seeing your code, the above is a kind of shot in the dark but I hope it helps.

    LVL 1

    Author Comment

    I managed to solve #1, but #2 is still causing grief.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
    Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now