Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Ray pixel intersection

4: Adsense

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   

211
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;

        }

 

 

 



#2 Dave Hunt   Members   

4872
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   

211
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.