POV-Ray : Newsgroups : povray.general : Pov 4.00 question : Re: Pov 4.00 question Server Time
7 Aug 2024 01:23:56 EDT (-0400)
  Re: Pov 4.00 question  
From: Alessandro Coppo
Date: 30 Jan 2002 16:47:00
Message: <3c5869d4@news.povray.org>
What about something like this:

------------------------------------------------------------------------
BEGIN or REAL Java code
------------------------------------------------------------------------
package samples.basic; 
 
import jxl.num.linalg.DoubleVector3; 
import jxl.graphics.color.*; 
import jpovapi.base.*; 
import jpovapi.pigments.*; 
import jpovapi.normals.*; 
import jpovapi.finishes.*; 
import jpovapi.textures.*; 
import jpovapi.lights.*; 
import jpovapi.objects.*; 
import jpovapi.atmosphere.*; 
import jpovapi.renderers.*; 
 
public class test { 
    public static void main(String[] args) { 
        Scene scn = new Scene();                               
 
        PerspectiveCamera cam = new PerspectiveCamera(); 
        cam.setAngle(70); 
        cam.setAspectRatio(4. / 3.); 
        cam.setLocation(new DoubleVector3(0, 4, -3)); 
        cam.setLookAt(new DoubleVector3()); 
        scn.setCamera(cam); 
 
        scn.add(new PointLight(new DoubleVector3( 20, 20, 20), new 
ColorDef(1., 1., 1.))); 
        scn.add(new PointLight(new DoubleVector3(-20, 20, 20), new 
ColorDef(1., 1., 1.))); 
        
        Finish f  = new Finish(); 
        f.setDiffuse(.9); 
        f.setAmbient(new ColorDef(.1, .1, .1)); 
  
        Texture t0 = new Texture(new SolidPigment(new ColorDef(1., 0., 
0.)), null, f); 
        Texture t1 = new Texture(new SolidPigment(new ColorDef(0., 1., 
0.)), null, f); 
 
        Sphere s = new Sphere(); 
        s.setTexture(t0); 
        s.setCenter(new DoubleVector3(0, .5, 0)); 
        s.setRadius(1); 
        scn.add(s); 
         
        Plane p = new Plane(); 
        p.setTexture(t1); 
        p.setNormal(DoubleVector3.Y); 
        p.setDistance(0); 
        scn.add(p); 
 
        RenderOptions ro = new RenderOptions(); 
 
        POVRayGenerator.generate(scn, ro); 
    } 
}

--------------------------------------------------------------------------------
END OF JAVA CODE
--------------------------------------------------------------------------------

Well?

Bye!!!
        Alessandro Coppo
        a.c### [at] REMOVEiolit

P.S.:
        A red sphere on a green plane with two lights.... ;-)


Post a reply to this message

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