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.


Messages - dear_stephen

Pages: [1] 2 3
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 / Re: maxPolysVisible Memory Leak
« on: June 19, 2007, 04:41:44 pm »
Adding...

Code: [Select]
  buffer = null;

... did the trick.

Thanks very much!

4
Bugs / Re: maxPolysVisible Memory Leak
« on: June 19, 2007, 09:55:43 am »
Hi

I added ...
Code: [Select]
if(buffer!=null){
buffer.dispose();
}

... before ...

Code: [Select]
buffer = new FrameBuffer(550, 550, mode);

but unfortunately it didn't help. With Config.maxPolysVisible = 8192; I also got the problem.




5
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

6
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.

7
Feedback / Re: Testing for Microsoft JRE 1.1
« on: June 04, 2007, 07:25:00 pm »
According to my statistics there are 7.33% using JRE1.1.4.

This is enough for me to spend the couple of extra hours required to test my code.

If your code doesn't run on JRE1.1.4 the 7.33% will see a little grey box.

Wouldn't it be better to provide at least and nice error massage that a higher JRE is required? People are then more likely to upgrade.

8
Support / Re: Shinnyness
« on: June 01, 2007, 08:27:14 pm »
I don't mind at all, quite the opposite :-)

9
Support / Re: Shinnyness
« on: June 01, 2007, 06:14:44 pm »
Hi

In the mean time I've got more or less what I was after, by lowering the light and rasing the ambient light.

Have a look at: http://www.fluidforms.at/shop/catalog/product_info-products_id-77.html

10
Support / Re: Texture Flipping
« on: June 01, 2007, 06:12:09 pm »
Hi Guys

Lets say this is my texture.


Then tiled would looke like...


...and flipped like...



However I realise now that tiling gives a better result. With flipping, when the coordinates run toward the ends of the texture uneven stretching can occur. In the worst case two neighbouring verticies can have the same texture  coordinate, resulting in pixels being stretched from on vertex to the next.

It is better to use tiling and to make the textures seamless.



11
Feedback / Re: Members' backgrounds...
« on: June 01, 2007, 05:55:44 pm »
Hi Guys

I am a bit different. I have nothing to do with game programming. Strange you might think?

I studied Computer Science in the 90s and Design in the early 00s. Since then I have be developing products that the consumer can change before purchase. Like mass customisation on speed. I have just launched applets based on JPCT ( http://fluidforms.at ). I have a few bugs at the moment like a memory leak but I'll get to the bottom of them soon.

I've been coding Java for about 5 years on and off. Before JPCT I was using http://www.processing.org but wanted a better 3D renderer.

Im looking forward to see what I can get out of JPCT with a bit more experience with it.




12
Support / Re: Texture Flipping
« on: May 30, 2007, 06:49:00 pm »
I originally had the flipping code working in another graphics engine. However I had strange artifacts in JPCT. I guess it should work as you say though. I was just hoping there might be a method like object.setTextureMode(Object3D.FLIP).

I'll have another look at getting my old code working in JPCT.

Thanks

13
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




14
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

15
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

Pages: [1] 2 3