What does the drawing out PPM in this task means?
It means drawing an output image in the PPM format.
https://www.wikiwand.com/en/Netpbm_format
okk got that
I mean the task says that it should be black and white surrounded by misses(black). I successfully build this
http://brlcad.org/wiki/Example_Application
So am i suppose to program it in such a way that rays passes through the sphere and shows that...
I mean the task says that it should be black and white surrounded by misses(black). I successfully build this
http://brlcad.org/wiki/Example_Application
So am i suppose to program it in such a way that rays passes through the sphere and shows that...
You have to somehow draw a black pixel if you hit and a white one if you miss
okk...thank you so much
okk...thank you so much
Good luck! I didn’t know the ppm images before but it is very useful and extremely simple to use!
they're a great debugging format since they're a simple text header followed by binary image data just like it's held in memory
i am wondering how to shoot rays horizontaly....for vertically what i thought was to use for loop and add cout<<endl; once the function is executed...Am i going in right direction?
i am wondering how to shoot rays horizontaly....for vertically what i thought was to use for loop and add cout<<endl; once the function is executed...Am i going in right direction?
You only have to shoot a grid of rays in 2D. Imagine it like this: take a sphere, hold it in front of you and light it up with a flashlight, the shadow on the wall will be a circle. That's exactly what you need to do: given a sphere, light it up by shooting rays (like light rays) and output the circle, the shadow on the wall. I don't want to give a too big clue, but you'll need a couple of loops to do it.
what does this function VSET(ap.a_ray.r_dir, 0.0, 0.0, -1.0) do?
Set the ray direction of ap.a_ray to 0.0, 0.0, -1.0
okk
is it ok if write out the image in .pgm format?
I suppose any image format is fine as long as you can see the image.
ok
i am getting circular file but not circular image...cicle.PNG
any ideas?
Read up on how the format works
okk
anyone completed this task?
The usage seems to be correct @Jeff Sieu ....usage.PNG
Did you put the P2 in your file
And the width and height of the image on the next line
Or P<whatever>*
yes..I did
I'm not sure you can put comments in a PPM file, try to erase it
Ah I had not seen that the second one was working, but since it writes an image I suppose that's your code which is wrong... Maybe it doesn't print a black pixel when it should
You may be printing too many per line
Is the number of numbers per line = width
Can you send over the whole file's contents
@Mitesh Can you send the whole file?
Oups didn't see you just asked :)
I think I know the problem here
Also, are you sure you put three numbers for each pixel? I see that in the last line, there are 7 times the number 15
The number of columns may be smaller than the specified width
Causing the image to look like a sort of "staircase", as some of the pixels from the second row are treated as that of the first
Just my guess though
sorry my computer has shutdown... there is some power problem and i don't have that file in my laptop....i will send the file tom asap....Thank you so much
wait it has started... i will send in few moments
here is the file @Jeff Sieu , @Lucas Prieels
I've already seen that there are approximately 61-62 numbers per line and 61 lines, so I think there should be more numbers (I'm not certain because it's not easy to count them :)
But there's definitely a problem with number of 15, it should be a multiple of 3 on each line, and it's not
Forget what I said, I didn't see it was a .pgm file, I used a .ppm one
I found out: re-check you have the right numbers of rows and columns :)
But otherwise, you effectively have a sphere. Just a thing, I don't know if it's important for the task but you should take a bigger resolution and fire more rays
One last thing: try not to place double spaces. Don't know if it can change anything for the .pgm files, but it makes it difficult to read
okk...Thank you so much
Bingo...appleseed task#2 done..thank you so much guys
I think i got a bug... Yesterday when i tried to include header files without .h (like #include "iostream" )suddenly i got errors around 3000
Ok....its not a bug...i just used wrong header files....
and the wrong include pattern -- it should have been #include <iostream>
"" is for local headers, <> is for system headers
Last updated: Jan 10 2025 at 00:48 UTC