Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - dear_stephen

Pages: [1]
1
Support / Disable Ambient Lighting for an Object
« on: September 20, 2007, 11:28:19 am »
I would like to disable lighting for a single object.

I have tried...

Code: [Select]
myObject.setLighting(Object3D.LIGHTING_NO_LIGHTS);
It works for lights added with...
Code: [Select]
world.addLight() ...but not for ambient light.

Is there a way to disable the ambient light for an object?

Cheers,
Stephen

2
Feedback / Version Control
« on: August 06, 2007, 08:15:43 pm »
Hi

Recently I have had a few problems getting jpct.jar versions mixed up.

Do you think in future you could put the version number in the jar file name?

If you don't like this idea you could also write in in the manifest.mf as in...

http://www.rgagnon.com/javadetails/java-0532.html


Cheers,
Stephen

3
Bugs / maxPolysVisible Memory Leak
« on: June 15, 2007, 01:30:54 pm »
Hi

I am using normal sampling when the mouse is down and oversampling when the mouse is pressed.

When recreating the FrameBuffer often I get a memory leak if and only if I use the following line...

Config.maxPolysVisible = 64000;






a "minimal" example...
Code: [Select]
package com.algodes.jpct;

import java.applet.Applet;
import java.awt.Color;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import com.threed.jpct.Camera;
import com.threed.jpct.Config;
import com.threed.jpct.FrameBuffer;
import com.threed.jpct.Object3D;
import com.threed.jpct.Primitives;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.World;

public class TestApplet extends Applet implements MouseListener, Runnable{
FrameBuffer buffer;
World world;
Thread loopThread;
boolean exit = false;
public TestApplet(){
addMouseListener(this);
buffer = changeSampleMode(FrameBuffer.SAMPLINGMODE_NORMAL);

// comment this out to get rid of the memory leak.
Config.maxPolysVisible = 64000;
}
public void run() {
world = new World();
Object3D root = Object3D.createDummyObj();
root.setName("root");
world.addObject(root);
addContent();
setCamera();

while(!exit){
buffer.clear(Color.WHITE);
synchronized (world) {
world.renderScene(buffer);
world.draw(buffer);
buffer.display(getGraphics());
}
buffer.update();
}
}
protected void addContent() {
// world.removeAll();
Object3D obj = Primitives.getBox(10, 10);
Object3D root = world.getObjectByName("root");

world.addObject(obj);

root.addChild(obj);

world.buildAllObjects();
world.addLight(new SimpleVector(150, 150, -450), 95, 95, 95);
world.setAmbientLight(220, 220, 220);
}

public void start() {
System.out.println("Initializing threads!");
if (loopThread == null) {
loopThread = new Thread(this);
loopThread.start();
}
}


public void destroy() {
System.out.println("destroy applet");
// Object3D.resetObjCount();
exit = true;
super.destroy();
}
private FrameBuffer changeSampleMode(int mode){
// memory leak
buffer = new FrameBuffer(550, 550, mode);
return buffer;
}

public void mouseClicked(MouseEvent event) {
changeSampleMode(FrameBuffer.SAMPLINGMODE_NORMAL);
}
public void mousePressed(MouseEvent event) {}
public void mouseEntered(MouseEvent event) {}
public void mouseExited(MouseEvent event) {}

public void mouseReleased(MouseEvent event) {
changeSampleMode(FrameBuffer.SAMPLINGMODE_OGSS);
}
public void keyTyped(KeyEvent e) {
}


protected void setCamera() {
SimpleVector cameraPosition = new SimpleVector(0, 0, 0);
// cameraPosition = product.getCenter();
cameraPosition.z = cameraPosition.z + 500;
Camera camera = world.getCamera();
camera.setPosition(cameraPosition);
// SimpleVector center = product.getCenter();
SimpleVector center = new SimpleVector(0, 0, 0);

camera.lookAt(center);
camera.setFOV(1.0f);
}

}


cheers,
Stephen

4
Bugs / Dead Link on the Website
« on: June 15, 2007, 10:30:22 am »
On http://www.jpct.net/download.html the link in...

I addition, i made some textures. They are totally free, use them in any way you like.
But first, get them here: Download texture pack

..to...

http://184184.vserver.de/jpct.net/texturepack1.zip


is dead.

5
Feedback / Testing for Microsoft JRE 1.1
« on: May 30, 2007, 06:25:57 pm »
I just found a great way to test for the Microsoft JRE

You can switch between sun JREs and the Microsoft JRE by simply disabling the sun JRE for IE. Then if the Microsoft JRE is installed...

http://java-virtual-machine.net/download.html

... IE will use JRE1.1.

More info to switching JRE can be found at...

http://www.java.com/en/download/help/switchvm.xml




6
Support / Texture Flipping
« on: May 30, 2007, 10:57:08 am »
Hi there!

It appears that textures are tiled by default. How would I go about flipping the texture instead of tiling it as my uv coordinates run over the edges of my texture?


Cheers,
Stephen

7
Support / Replace the Mesh of an Object
« on: May 29, 2007, 01:07:05 pm »
Hi

I would like to change the form of an object in realtime, however in doing so there may be new verticies added.

For this reason I can't use the GenericVertexController.

What actions do I need to additionally perform in order to do something like...

Object3D newObject = getAnObjectWithADifferentForm();
oldObject.setMesh(newObject.getMesh());



Stephen

8
Support / Shinnyness
« on: May 23, 2007, 12:36:46 pm »
Is it possible to set how shiny an object is?

cheers,
Stephen

9
Bugs / JRE 1.1
« on: May 08, 2007, 11:19:40 am »
I have just tested my applet on the microsoft jre 1.1 and I get the following error message...
Code: [Select]
java.lang.NoSuchMethodError: java/awt/Color: method getAlpha()I not found
at com/threed/jpct/FrameBuffer.clear
at com/algodes/jpct/JPCTApplet.init
at com/algodes/jpct/Earth.init
at com/ms/applet/AppletPanel.securedCall0
at com/ms/applet/AppletPanel.securedCall
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.run
at java/lang/Thread.run


It seems that an incompatible function has slipped in.

Is this a bug? Is there a work around?

thanks,
Stephen


10
Support / Image without lighting
« on: March 28, 2007, 03:44:25 pm »
Hi

I would like to display an image in my world. It should be rendered just as it is without any effects of lighting.

I have created a plane, add the image as a texture and am calling...

plane.setLighting(Object3D.LIGHTING_NO_LIGHTS);

The problem is that it is still effected by the worlds ambient light.

How can I prevent this?

cheers

11
Support / Rotate Texture
« on: March 23, 2007, 12:28:04 pm »
Hi

I would like to create an object with a texture mappling as showen in the image below. Projecting an image from the top onto a plain is no problem but I would like to project it from the side. Can someone please tell me what I am missing?

cheers


Pages: [1]