|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I was writing a kind of Povray Material Editor for JPatch, but thought
that this might be useful as an applet too.
http://3dgallery.dhs.org/raytracing/
Ok, this applet is a (very simple) realtime-raytracer. It tries to
emulate POV-Rays lighting model (but it does not support procedural
textures). You can change 15 parameters by moving some sliders and the
result is being raytraced in realtime. It can also create a POV-SDL texture.
It might help new Povray users to get a feeling of what impact the
different parameters have.
The result isn't 100% what POV-Ray does, I'll have to read through the
POV-Ray sourcecode to get better "compatibility"...
Source is available, let me know your comments/questions/suggestions
Have fun...
-sascha
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
sascha schrieb:
> I was writing a kind of Povray Material Editor for JPatch, but thought
> that this might be useful as an applet too.
Thank you for sharing this. It's very interesting for me, because it
gives me a little insight into Java3D.
> Source is available, let me know your comments/questions/suggestions
I would change the behaviour of the mouse dragging. In your version the
scene rotates to the left when the mouse is dragged to the right and
vice versa. I don't know whether this was intended or not.
I would change two lines in the mouseDragged method:
public void mouseDragged(MouseEvent event){
int dx = event.getX() - iMouseX;
int dy = event.getY() - iMouseY;
iMouseX = event.getX();
iMouseY = event.getY();
/* old: fRotX += (float)dy/150f;*/
fRotX += (float)-dy/150f;
/* old: fRotY -= (float)dx/150f;*/
fRotY -= (float)-dx/150f;
fRotX = (float)Math.min(0.15f,fRotX);
fRotX = (float)Math.max(-Math.PI/2,fRotX);
repaint();
}
Just my 2 eurocents.
So long,
Bonsai
--
<--------------------------->
___ __ __ _ ___ ___ _
| _ ) \ \( ) _) _ )( )
| _ \() |\ \ |\ \/ _ \| |
|___/__/_)\__)___)/ \_)_)
www.b0n541.net
<--------------------------->
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Bonsai wrote:
> because it gives me a little insight into Java3D.
Actually it's got nothing to do with Java3D (expect from using the
vecmath classes for basic vector and matrix math) - Java3D is built
ontop OpenGL or DirectX and uses hardware Z-Buffer rendering - this
applet uses raytracing and therefore is quite slow (I get approx. 10
frames per second @ 80 x 80 pixel)
> the scene rotates to the left when the mouse is dragged to the right
It was meant to move the camera to the right, but I might change it :-)
-sascha
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
This is really cool. Very handy for creating textures, probably.
I also agree that the mouse control feels like the opposite of what it
should be (both vertically and horizontally).
The center pixel sometimes appears black. I suspect you have a division by
zero error in your ray-sphere intersection test.
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Slime wrote:
> I also agree that the mouse control feels like the opposite of what it
> should be (both vertically and horizontally).
You just haven't played enough "Flight Simulator" to know that up
actually means down ;-)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
sascha schrieb:
> Actually it's got nothing to do with Java3D
Oh, I thougt it's based on Java3D, because I had to install Java3D to
compile your applet. I should have looked on the code more intensively.
:-) But anyway the applet is a nice help to create simple textures.
So long,
Bonsai
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |