Jump to content

  • Log In with Google      Sign In   
  • Create Account

Ray pixel intersection


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 football94   Members   -  Reputation: 198

Like
0Likes
Like

Posted 01 July 2013 - 01:43 AM

Hi guys

 

 

I have a ray intersection method(code below) that was created using java and have been trying to convert it to  c#/xna

but Im having trouble trying to find the class equivalent of javas Image and Scene classes if anyone could help

me with this conversion it would be much appreciated. Thankyou

 

 

 Image RayCast(Camera camera, Scene scene, int width, int height)
        {

            Image image = new Image(width, height);

            for (int i = 0; i < width; i++)
            {

                for (int j = 0; j < height; j++)
                {

                    Ray ray = ConstructRayThroughPixel(camera, i, j);

                    Intersection hit = FindIntersection(ray, scene);

                    image[i][j] = GetColor(hit);

                }

            }

            return image;

        }

 

 

 



Sponsor:

#2 Dave Hunt   Crossbones+   -  Reputation: 2458

Like
0Likes
Like

Posted 01 July 2013 - 08:02 AM

XNA has no equivalent to Scene or Camera. The logical equivalent to Image would be Texture2D.



#3 football94   Members   -  Reputation: 198

Like
0Likes
Like

Posted 01 July 2013 - 09:48 AM

Thanks Dave I'll start experimenting right away.

 

                                               Thanks again






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS