Source Codes of Gallery Files - "Orb"


This page contains the source code for the "Transparent Orb with Colliding Spheres" .vobj file.

This source code may be edited in any text editor and saved as a .vobj file.

Please feel free to edit this source code to see the effects of changes. You can try changing color values, animation speeds, or whatever else you'd like to explore.

Copy the ScriptV code below into a text editor. Once you've finished editing the code, save it as a new file with a ".vobj" extension. Click here for instructions on running the edited file.



// Transparent Orb
// The file was originally created by the Visviva Authoring Studio.
// Comments are added for readability.
// Texture images are not included.
object OrbParticles:Perspective
{
    width=128p;		//128 pixels
    height=128p;		//128 pixels
    view_angle=45;		// angle of the field of view
    eye_position=(0,10,100);
    orientation=(0,1,0);
    view_near=10;		// the distance between eye and the near clip plane
    view_far=1000;		// the distance between eye and the far clip plane
    style=(Use3DAcc);	// use 3D accelerator
    bkg_color=(0, 0, 0, 14);	// background color. Set the alpha value 
			// (the fourth number) to a low value to 
			// enable a motion blur effect
    object default_light:DirectionalLight
    {
	color=(255, 255, 255);
    };
    object :ParticleEmitter
    {
	max_gen=1;		// maximum number particles per emission
	min_gen=1;		// mininum number particles per emission
	style=(Infinite,ParticleCollision,AutoStart);
				// Infinite emission, enable particle 
				// collision detection, and start 
				// emission automatically
	interval=0:0:0:20;		// intervals between two frames (20ms)
	min_life=0:0:9;		// shortest life (9 seconds)
	max_life=0:0:9;		// longest life (9 seconds)
	attraction=1;		// attraction force
	resistance=0.001;		// Resistance of the air
	collision="ParticleShield";	// The group name where the objects
				// obstruct particles 
	direction=(0,1,0);		// emission direction
	direction_shift=(200,200,200);	// emission direction variation
	speed=50;			// initial speed
	speed_shift=20;		// initial speed variation
	object particle:Shape3D	// the particle description
	{
	    object surface:Sphere	// the surface is a sphere
	    {
		r=2.33803;	// radius
		i_num=8;		// number of longitudinal divisions 
		j_num=8;		// number of latitudinal divisions 
	    };
	    object material:Material 	// the material of the particle
	    {
	        diffuse=(204, 255, 102, 255);
	        ambient=(9, 12, 0, 255);
	        specular=(142, 178, 4, 255);
	        shininess=0.07812;
	    };
	};
    };
    object :Shape3D // the particle shield object
    {
	draw_style=(GrabMouse); // grabs mouse when it is pressed
	group="ParticleShield";	//it is in the ParticleShield group
	object surface:Sphere	// the surface is a sphere
	{
	    r=30;
	    i_num=16;
	    j_num=16;
	};
	object material:Material	// the material of the shield
	{
	    diffuse=(255, 255, 255, 255);
	    emission=(127, 127, 127, 255);
	    transparency=0.9;	// transparency: 0=full opacity, 
				// 1=full transparency
	    object diffuse_map:TextureImage
	    {
		pixmap="green_dot.png";	// the texture of the material
		u_number=16;		// tile number in longitude
		v_number=16;		// tile number in latitude
	    };
	};
	object sensor:SensorRotate	// rotation sensor is added so 
				// the object can be dragged to
				// rotate
	{
	    style=KeepMotion;	// maintain rotation speed after the drag action
	    active=True;		// the sensor is enabled
	    speed_factor =0.1;	// the factor of the rotation 
				// speed in relation to the dragging speed
	};
    };
};


Return to Hall of Animated Amusements

    Copyright © 1998, 1999, 2000,2001 Visviva Software, Inc. All rights reserved. Last revised: February 20, 2001
    This site is best viewed in 16-bit or true color display mode.