POV-Ray : Newsgroups : povray.general : Raytracing applet Server Time
4 Aug 2024 06:14:54 EDT (-0400)
  Raytracing applet (Message 1 to 6 of 6)  
From: sascha
Subject: Raytracing applet
Date: 31 Jul 2003 08:09:31
Message: <3f2906fb$1@news.povray.org>
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

From: Bonsai
Subject: Re: Raytracing applet
Date: 31 Jul 2003 10:31:12
Message: <3f292830$1@news.povray.org>
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

From: sascha
Subject: Re: Raytracing applet
Date: 31 Jul 2003 11:05:18
Message: <3f29302e$1@news.povray.org>
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

From: Slime
Subject: Re: Raytracing applet
Date: 31 Jul 2003 11:54:22
Message: <3f293bae@news.povray.org>
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

From: sascha
Subject: Re: Raytracing applet
Date: 31 Jul 2003 12:07:26
Message: <3f293ebe$1@news.povray.org>
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

From: Bonsai
Subject: Re: Raytracing applet
Date: 31 Jul 2003 15:37:19
Message: <3f296fef$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.