This site requires JavaScript, please enable it in your browser!
Greenfoot back

Comments for 3D ROOM

Return to 3D ROOM

Very impressive! What kind of methods are you using to render the room? Is the light being calculated dynamically or are the walls simply textures?
Kim2YulKim2Yul

2012/9/27

I used global illumination model. Three point lights are attached on the ceiling of the room (the light can be anywhere though), and each wall is made of 20*20*2 triangles, calculating colors on three points of triangles. You may see some cracks when too close to walls. I missed some exceptions when drawing triangles. Once it fixed, I am going to release source code.
Are you drawing the triangles using any pre-built methods, or are you using custom triangle interpolating algorithms?
Kim2YulKim2Yul

2012/9/27

By interpolating algorithms. The only pre-built method I used is getImage().setColorAt(int, int, Color).
Very nice! Might there be an option to turn off interpolation so we can view the room at a higher framerate? Probably using the default drawPolygon methods as well for speed?
MatheMagicianMatheMagician

2012/9/27

If you make the window smaller (kinda like builderboy's scenarios) that would increase speed as well. If you do manage to speed it up, I will like it.
MatheMagicianMatheMagician

2012/9/27

The scenario that is, I already like the idea.
darkmist255darkmist255

2012/9/27

Great work! If you can optimize it you could really go somewhere with this idea! Maybe try caching the results of the lighting calculations so they don't reload, but I don't know how you've coded it so all I can offer is a thought. Nevertheless, incredible!
Kim2YulKim2Yul

2012/9/28

@BuilderBoy2005 I confused the term 'local illumination' with 'global illumination', which are very different.... Anyway, I have to correct it. I used LOCAL illumination. GL is not appropriate for real-time programming.
Kim2YulKim2Yul

2012/9/28

and can I draw triangle with gradation by drawPolygon? I'm new to Greenfoot and Java, so I don't know so much about basic methods.
Kim2YulKim2Yul

2012/9/28

@MatheMagician I missed that thing. I'm gonna make it smaller on the next time.
MatheMagicianMatheMagician

2012/9/28

You cannot use graduation with getImage().drawPolygon(). However, you can with java.awt.Graphics2D, so you could creates a buffered image, use Graphics2D to draw your graduated triangle on it, and then draw the buffered image on your actor/world's image.
AceticAcidAceticAcid

2012/10/4

민수야 ㅋㅋㅋㅋ