Worklog for Leon Drake

JavaB3d

Return to Worklogs

Textures(Posted 2011-09-25)
Got basic textures in via brushes, i'll have to make a few functions so you can just add a texture to an entity without using a brush.

package javab3d.examples;

import javab3d.JavaB3DApplet;
import javab3d.brush.JBrush;
import javab3d.brush.JTexture;
import javab3d.entity.JEntity;


public class Hello3DWorld extends JavaB3DApplet {

	public Hello3DWorld() 
	{

		JTexture tex = LoadTexture("C:\\Program Files\\Blitz3D\\samples\\mak\\flag\\b3dlogo.jpg",0);
		
		
		JEntity j = CreateCube(null);
		RotateEntity(j,0.6,0.6,0.6);
		PositionEntity(j,0.5,0.1,-0.6);
	
		JEntity l = CreateLight(1,null);
		PositionEntity(l,-0.5,-0.1,0.6);
		
		JEntity s = CreateSphere(8,null);
		
		JBrush b = CreateBrush(1.0f,0.0f,0.0f);
		JBrush b2 = CreateBrush(0.0f,1.0f,0.0f);
		JBrush b3 = CreateBrush(0.0f,1.0f,1.0f);
		BrushTexture(b,tex,0,0);
		PaintEntity(s,b);
		PaintEntity(j,b2);
		
		JEntity c = CreateCone(8,null);
		RotateEntity(c,0.3,0.3,0.3);
		PositionEntity(c,-0.5,-0.1,-0.6);
		

		
		PaintEntity(c,b3);
	}

 

}




http://www.endsoflegend.com

We have Brushes(Posted 2011-09-25)
Alright got brushes implemented so far, at least for setting diffuse colors, going to add texture and the various other colors you can set ambient, specular etc etc..

code example 2:

package javab3d.examples;

import javab3d.JavaB3DApplet;
import javab3d.brush.JBrush;
import javab3d.entity.JEntity;


public class Hello3DWorld extends JavaB3DApplet {

	public Hello3DWorld() 
	{

		JEntity j = CreateCube(null);
		RotateEntity(j,0.6,0.6,0.6);
		PositionEntity(j,0.5,0.1,-0.6);
	
		JEntity l = CreateLight(1,null);
		PositionEntity(l,-0.5,-0.1,0.6);
		
		JEntity s = CreateSphere(8,null);
		
		JBrush b = CreateBrush(1.0f,0.0f,0.0f);
		
		PaintEntity(s,b);
		
		
		
	}

 

}


we now have a red ball!



http://www.endsoflegend.com

A new hope...(Posted 2011-09-25)
Decided to take the Java3d library and write some wrappers to make coding a 3d applet more like Blitz3d.

currently this is what i have implemented

package javab3d.examples;

import javab3d.JavaB3DApplet;
import javab3d.entity.JEntity;


public class Hello3DWorld extends JavaB3DApplet {

	public Hello3DWorld() 
	{

		JEntity j = CreateCube(null);
		RotateEntity(j,0.6,0.6,0.6);
		PositionEntity(j,0.5,0.1,-0.6);
	
		JEntity l = CreateLight(1,null);
		PositionEntity(l,-0.5,-0.1,0.6);
		
		JEntity s = CreateSphere(8,null);
		
		
		
	}

 

}


which creates this



http://www.endsoflegend.com