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 - Klaudiusz

Pages: 1 [2] 3 4 5
16
Bugs / Wrong normals rotations when object has a parent which is scaled
« on: October 11, 2007, 11:11:29 pm »
Hi Egon,

Please take a look on attached example, it shows how normals are modified when object has a parent and this parent is scaled.

Code: [Select]
import java.awt.Color;

import com.threed.jpct.*;

public class TestSize {

public static void main(String[] args) {
World w = new World();
FrameBuffer fb = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_GL_AA_2X);
fb.disableRenderer(IRenderer.RENDERER_SOFTWARE);
fb.enableRenderer(IRenderer.RENDERER_OPENGL);
Object3D Toy= Primitives.getCube(17);


TextureManager tm = TextureManager.getInstance();
Texture vt = new Texture("blue067.jpg");

tm.addTexture("uv", vt);


TextureInfo ti=new TextureInfo(tm.getTextureID("uv"));

Toy.setTexture(ti);
Toy.setEnvmapped(Object3D.ENVMAP_ENABLED);


Object3D Toy2=Toy.cloneObject();
Toy2.translate(50, 0, 0);
Toy.addChild(Toy2);


w.getCamera().moveCamera(Camera.CAMERA_MOVEOUT, 200);
w.getCamera().moveCamera(Camera.CAMERA_MOVEUP, 50);
w.setAmbientLight(250, 250, 250);
Toy.build();
w.addObject(Toy);
Toy2.build();
w.addObject(Toy2);


while(!org.lwjgl.opengl.Display.isCloseRequested()) {

fb.clear(Color.DARK_GRAY);
w.renderScene(fb);
w.draw(fb);
fb.update();
fb.displayGLOnly();
Toy.scale(1.001f);
Toy.rotateX(0.005f);
w.getCamera().lookAt(Toy2.getTransformedCenter());

try {
Thread.sleep(10);
} catch(Exception e) {}

}
fb.dispose();

}

}

17
Bugs / Re: Bilboarding when object has parent
« on: October 03, 2007, 08:43:02 am »
Works fine. Now i can do some partices magic:) Thanks!

18
Bugs / Re: Bilboarding when object has parent
« on: October 02, 2007, 08:42:35 am »
Something wrong. It goes crazy when parent object is moving (translated).

See attached example:

Code: [Select]
import java.awt.Color;

import com.threed.jpct.*;

public class TestBB {

public static void main(String[] args) {
World w = new World();
FrameBuffer fb = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_GL_AA_2X);
fb.disableRenderer(IRenderer.RENDERER_SOFTWARE);
fb.enableRenderer(IRenderer.RENDERER_OPENGL);
Object3D Toy= Primitives.getCube(10);


TextureManager tm = TextureManager.getInstance();
Texture vt = new Texture("blue067.jpg");

tm.addTexture("uv", vt);


TextureInfo ti=new TextureInfo(tm.getTextureID("uv"));
Toy.calcTextureWrapSpherical();
Toy.setTexture(ti);

Object3D Toy2=Toy.cloneObject();
Toy2.translate(35, 0, 0);
Toy.addChild(Toy2);
Toy2.setBillboarding(Object3D.BILLBOARDING_ENABLED);

w.getCamera().moveCamera(Camera.CAMERA_MOVEOUT, 200);
w.getCamera().moveCamera(Camera.CAMERA_MOVEUP, 50);
w.setAmbientLight(250, 250, 250);
Toy.build();
w.addObject(Toy);
Toy2.build();
w.addObject(Toy2);


while(!org.lwjgl.opengl.Display.isCloseRequested()) {

fb.clear(Color.PINK);
w.renderScene(fb);
w.draw(fb);
fb.update();
fb.displayGLOnly();

Toy.rotateY(-0.02f);
Toy.translate(0.01f,0,0);



try {
Thread.sleep(10);
} catch(Exception e) {}

}
fb.dispose();

}

}

19
News / Re: Version 1.15 has been released!
« on: October 01, 2007, 09:41:24 pm »
Very good job. Thank You!

20
Bugs / Re: Bilboarding when object has parent
« on: October 01, 2007, 09:36:12 pm »
Thx, i'll do this tommorow.

BTW. Maybe could You implement parent functionality also for lights and cameras? It could be usefull.

21
Support / Re: wireframe mode per object/mesh
« on: September 29, 2007, 08:21:33 pm »
I think, everything what You can do is to make a differend World for wireframed objects. You need to disable Curling if You want to show hidden lines. Wireframe drawing should use Z-Buffer. If so, just render the secound World as wireframe after the main World- than if Your object is covered by other - won't be drawn (z-buffer walue will  be bigger). It's a little complicated, but drawWireframe is a World method only.

22
Support / Question regarding the 3DS loading process
« on: September 28, 2007, 03:28:10 pm »
Hi,

While the 3DS file is loaded, some materials and textures are created:

Quote
File head2.3DS loaded...79376 bytes
Processing new material Material #25!
Texture named AFRICAN_.JPG added to TextureManager!
Processing new material Material #26!
Processing new material Material #27!
Processing new material Material #28!
Texture named EYE_DARK.TIF added to TextureManager!
Processing new material Material #29!
Processing new material Material #30!
Processing new material Material #31!
Processing new material Material #32!
Processing new material Material #33!
Processing new material Material #34!
Processing object from 3DS-file: head2
Object 'head2_jPCT0' created using 2880 polygons and 1487 vertices.

I suppose those textures are created as dummy.

How can i remove this creating? (I havy my own texture loader and i'm affraid whether the name of some new texture can be taken by some of the dummies)
What it's "new material Material #**" ? What's that mean in JPCT?

Thank You

23
Bugs / Re: Bilboarding when object has parent
« on: September 27, 2007, 07:48:13 pm »
Thanks:)

24
Bugs / Bilboarding when object has parent
« on: September 27, 2007, 11:28:59 am »
Hello,

Billboarding doesn't work when object has a parent. In documentation is written that object is always faced to the camera.

25
Support / Re: How to set color values in Mesh?
« on: September 26, 2007, 12:21:22 am »
Yes... unfortunatelly. OK, i'll try to find some other solution.

26
Support / How to set color values in Mesh?
« on: September 26, 2007, 12:04:50 am »
Hi,

I'm thinking about something like my own Global Illumination effect, where each point from the Mesh could be classified as little light. Than i could calculate the illumination between all points in the world and add the value to each of them.

Does the current funtionallity od JPCT makes it possible? Can i handly modify the color of each point in Mesh?

Thanks in advice!

27
Support / Re: How can i read some point position from Mesh?
« on: September 24, 2007, 03:13:09 pm »
For example regarding this source:

http://www.jpct.net/forum2/index.php/topic,58.0.html

The oryginal code is:

Code: [Select]
DemoVertexControlerr demoControl = new DemoVertexControlerr();
obj.getMesh().setVertexController(demoControl,IVertexController.PRESERVE_SOURCE_MESH);
obj.setOrigin(new SimpleVector(0, 0, 0));
obj.getMesh().applyVertexController();

i used VertexController twice:

Code: [Select]
DemoVertexControlerr demoControl = new DemoVertexControlerr();
obj.getMesh().setVertexController(demoControl,IVertexController.PRESERVE_SOURCE_MESH);
obj.setOrigin(new SimpleVector(0, 0, 0));
obj.getMesh().applyVertexController();
obj.getMesh().applyVertexController(); //used again

If i understood the documentation correclty, no matter how many times VertexController with option PRESERVE_SOURCE_MESH is used, effects is still the same because source Mesh=oryginal Mesh.

So the object should be the same, but has bigger waves.

28
Support / Re: How can i read some point position from Mesh?
« on: September 24, 2007, 12:51:34 pm »
It's some 28000 points. I would like to use part of them as as particles position.

btw.seems like PRESERVE_SOURCE_MESH doesn't work. It works exactly like ALTER_SOURCE_MESH when used twice.

29
Support / Re: How can i read some point position from Mesh?
« on: September 24, 2007, 12:29:34 pm »
Ok, i got it. It's a bit slow because it's need to copy whole Mesh first, but it works.

Thanks

30
Support / How can i read some point position from Mesh?
« on: September 23, 2007, 07:20:52 pm »
Hi,

I want to read point position from the Mesh. I used VertexController:

Code: [Select]
private class getPointPosition extends GenericVertexController {
 
     int PointNr;
     
     getPointPosition(int Nr) {
       PointNr=Nr;
     }

     public void apply() {
       SimpleVector[] srcMesh=this.getSourceMesh();
       System.out.println(srcMesh[PointNr]);
       }

}

I works, i mean it read the SimpleVector, but i want to return srcMesh[PointNr]. Unfortunatelly apply() can't return anything.

Is there some other way to do this?

Pages: 1 [2] 3 4 5