Custom Search

3D programming with Vpython (3)




3D programming with Vpython from linuxgazette.net

By Maxin B. John

"3-Dimensional Programming for Ordinary Mortals"- claims the Vpython project website. Vpython is a python module for 3 Dimensional scientific programming, specifically useful for the people with a Physics background.
Based On A True Story

Almost 3 years back, the Department of Computer Applications , Government Engineering College, Thrissur, India decided to conduct their annual National Seminal Seminar and Programming Contest, known as Renaissance - 2005, in the month of November. The people for Linux (which includes me) convinced the Professors to make the Renaissance 2005 a celebration of Free/Open Source . Our decision was to make it a true celebration of Linux. Almost all the programs were on Linux based technologies.

We conducted regular meetings to ensure the quality of the program. In one such meetings, we faced a small but striking question from one of the participants: How are we going to manage the Introductory Multimedia Presentation? In our college, the "Intro Presentation" was the way to show off the artistic and technical talent of the hosting Department. Most of the other Departments were using "Flash"-based eyecandy presentations as their intro. But we have decided not to depend on "not so open" technologies, and roll one for our own. But we couldn't reach a conclusion on the alternative technology at that time.
Here Comes Vpython



Whenever we had a technical doubt, we always had a door to knock at. Out team has met our beloved guru "Mr. Pramode CE" at his home. On hearing our "little bit strange" requirement, we heard what we wanted to hear. "You people can try Vpython for this purpose. You may integrate the music with your application using gamepy if you want to utilize the multimedia capabilities of python.". Read more






3D programming : Generating Terrain Textures (2)





Generating Terrain Textures from flipcode.com
by Yordan Gyurchev (31 May 2001)



Introduction


Several months ago I was working on a terrain algorithm. When it was implemented, all of a sudden I realized that I needed some textures. At that moment I rushed into this texture generation stuff.

Here I’ve provided the stuff I’ve found on the net, fertilized with my own ideas.


The Theory


There are different types of terrain. You can call them different types of land if you like. There are for example snow, rocks, grass, mud, etc. Those can be found at various places in nature.

The texture synthesis in this paper is based on combining all types of terrain but weighted with factors according to the traits of the specific place. For each terrain type a probability factor is calculated and then used as a weight while calculating the color of the current pixel.

Calculating the weight

Factors defining the influence of a certain type of terrain at the current point:

Elevation

We have snow on the top of mountains and mud/grass in the lower places (take heed that rocks can be found in all elevations). Thus we need a minimum and a maximum elevation value for every type of land.

Thus for a snow land we will have min/max values 200/255 while for mud land these values may be 5/64.

Slope

Imagine the top of a mountain. It has snow at the top but if you take a close look at really steep piece of land there is hardly any snow but rocks although it happens to be in the snow elevation.

Let us introduce the second factor: slope. It will be specified in degrees.

For a snow land we will have minimum slope 0 and maximum 80 degrees. Thus leaving the range from 80-90 degrees for rocks…

This can be explained with grass/rocks, mud/rocks etc.

Note that we will need the normal vector at that very point to enable angle comparison.

There are some factors that modify already specified factors. Read more






3D graphics programming in Java





3D graphics programming in Java, Part 1: Java 3D from javaworld.com

Get a head start with this introduction to the Java 3D API

By Bill Day, JavaWorld.com, 12/01/98
In order to build a true Java platform, Sun realized early on that it needed to fill out the API picture beyond the limited functionality available in the Java 1.0 core platform. Sun has grown the core a great deal with the 1.1 and impending 1.2 releases, but there are still some pieces missing from the Java puzzle.

Sun and its partners developed the Java Media and Communication APIs to provide the missing multimedia programming pieces. Two of the biggest pieces, 2D and 3D graphics, are targeted with the Java 2D and 3D APIs, respectively. Java 2D is a core platform API beginning with Java 1.2, while Java 3D will be released as an Extension API shortly after the 1.2 platform becomes available. We have recently finished a series of columns on Java 2D; now we turn our attention to Java 3D.

Java 3D is meant to give Java developers the ability to write applets and applications that provide three dimensional, interactive content to users. Sun has some heavy competition from other 3D graphics technologies in this arena, and Java 3D has an uphill battle ahead of it if it's to defeat the incumbent graphics standard, OpenGL. GO






button button

Add to Google