Posts

M3G - 3D Object Materials

Image
Materials A light can cause different effects. A shiny silver ball reflects the light in a different way than a sheet of paper does. M3G models these material characteristics with the following attributes: Ambient reflection: The light that is reflected by an ambient light source. Diffuse reflection: The reflected light is scattered equally in all directions. Emissive light: An object can send out light to imitate glowing objects. Specular reflection: The light that reflects off objects with a shiny surface. You can set a color for each material attribute. The shiny silver ball's diffused color would be silver and its specular component white. To get the final object color, the material's color mixes with the light's color. If you point a blue light toward the silver ball, it would turn bluish. Listing 9 shows how to use materials: Listing 9. Setting a material // Create appearance and the material. _cubeAppearance = n

Your first 3D object

Image
Your first 3D object As a first example, you'll create a cube as displayed in Figure 1. Figure 1. Sample cube: a) Front view with vertex indices, b) Side view with clipping planes (Front, Side) The cube lives in what M3G defines as a right-handed coordinate system. If you take your right hand and stretch out your thumb, index finger, and middle finger so that each finger is in a right angle to the other two fingers, then the thumb is your x axis, the index finger the y axis, and the middle finger the z axis. Try to align your thumb and index finger with the x and y axis in Figure 1a; your middle finger should then point toward you. I've used eight vertices (the cube's corner points) and placed the cube's center at the coordinate system's origin. As you can see in Figure 1, the camera that shoots the 3D scene looks toward the negative z axis, facing the cube. The camera's position and properties define what the screen later displ

JSR-184 a.k.a. Micro3D a.k.a. Java Mobile 3D

What is Java Mobile 3D? Definition from Sony Ericsson developer site : Java Mobile 3D Graphics (also known as JSR 184 ) is an API tailored for the generation and presentation of 3D content on mobile platforms. This section discusses this API and an alternate 3D implementation, HI Corporation’s Mascot Capsule Micro3D version 3 (also known as Micro3D ). Sony Ericsson has chosen to implement both API sets, allowing Mascot Capsule Micro3D serve as a migration path for 3D applications until Java Mobile 3D-enabled devices become widely available. Here, we’ll also briefly try to address any possible point of confusion related to the two implementations of 3D Java APIs in Sony Ericsson phones . M3G is a fun technology to play around for developers, ever in history 3D developement got so easy (well if compared with Direct3D and OpenGL programming)!
Image
Content Step 1: Install Java Step 2: Install J2ME Toolkit Step 3: Testing Installing JDK ... Firstly, goto "http://java.sun.com" and grab a copy of the latest JDK (notice: only J2RE will only allow you to run java apps, if you are going to developement MUST use a JDK). Unzip it and put it in a folder, here we use "c:/java/j2sdk" as a default directory! Then you have to setup an environment variable in order to make work. Setting up environment variable for Java ... Right click on "My Computer", select "properties"->"Advanced"->"Environment Variables", and you will see stuff like below: JAVA_HOME=C:\java\jdk1.2.4_01 (refer to path where you install the Java sdk) PATH= ... ;C:\java\jdk1.2.4_01\bin Installing J2ME Toolkit ... This may be as simple as it seems, just goto j2me download site , pick a copy of " Sun Java Wireless Toolkit" ... install it and start coding. Note that you may have a few choice eithe

JDBC comes to J2ME finally?

Image
J2ME Brief Introduction J2ME is always comes with limitation, limited memory, limited processing power, limited storage ... . It's made out of MIDP ( M obile I nformation D evice P rofile ) and CLDC ( C onnected L imited D evice C onfiguration ), CLDC as defined by it's term ... represent a limited resource device. It minimum equiped with 128kb Java memory, 32kb heap, low power and low battery, network/wireless connectivity with low bandwidth . In those days, we can't put too much fancy stuffs in these kind of device, like database for instance. A big brother of CLDC , the CDC ( C onnected D evice C onfiguration ) had far more capability than it's little brother (minimum 512kb memory, minimum 256kb heap, network persistent connectivity with high bandwidth ). So where do we see CDC and CLDC ? CLDC is common among any j2me phones, but CDC can only be seen on high-end PDA phones like Nokia S80 series , Sony Ericsson smart phones and others which compliant with JS