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

Pages: [1]
1
Support / Re: multiple lights
« on: December 09, 2013, 08:29:00 pm »
So, can I found where is my light source?. I have setposition and getposition method for light. Can I example getposition of light and set this position for object3d, ex cube - samething like marker? But How I can getposition of any object? getTranslation? .. When I add light source and not specify the position, it's in (0 0 0) ?

And other question. I lighting my scene but I haven't shadow. I found "setShadingMode" but I have no idea about this.

Sorry for my very begginer question, and Thanks very much. :)

2
Support / Re: multiple lights
« on: December 08, 2013, 10:42:20 pm »
Ok, it's mayby a other kind of subject, but I'm writing my actual problem.

I built a model of the box, with 6 "walls". This box is empty inside. Im not translate box, and light, so light is inside the box. And the 5 walls is light, but  one of 6 ("ceiling") is completely dark. I tried set a position of light but it's still dark.

It's my light and camera code:
Code: [Select]
Camera cam = world.getCamera();
cam.moveCamera(Camera.CAMERA_MOVEOUT, 50);
cam.lookAt(model.getTransformedCenter()); //w srodku - model, obok - pokoj

SimpleVector sv = new SimpleVector();
sv.set(pokojs.getTransformedCenter());
sv.y = 0;
sv.z = 0;
sv.x = 0;
sun.setPosition(sv);

pokojs = "box"
model = only the horizontal walls, no ceiling and floor

and the screen shot:



3
Support / Re: multiple lights
« on: December 08, 2013, 12:21:47 pm »
I'm surprised. I think that I do not have big demands, so probably something I'm doing wrong. I have to go, but when I get home that I edit this post, I'll post my code and screens. :)

4
Support / Re: multiple lights
« on: December 08, 2013, 12:05:43 pm »
I write what i want. I have a "room" model, which i load to world. I move a camera, and object isn't move. And i want add to room 2 light (ex. one on ceiling, and other to wall). I want 4 options dor this. No lights, 1 lights on, 2 lights on, and 1 and 2 lights on together. So if I think about 2, 3 your proposytion I must have 4 lights map? And where I found samething about writing shader (hmm in open gl? ) and how merge open gl with jpct.
Thanks for your post, but I'm begginer , and I still have no idea.

5
Support / multiple lights
« on: December 08, 2013, 12:24:24 am »
Hello.  :)
I found for solution of my problem but I don't know still. Is it possible samething like "multiple lights" in jpct-ae?
ex:
http://commons.wikimedia.org/wiki/File:Subway_lights_in_tunnel.JPG
or
http://www.creativecrash.com/system/photos/000/174/605/174605/big/Guest_room_001_1.jpg?
I was add two light to world, but I see only one. .

6
Support / Re: Picking the part of object
« on: December 02, 2013, 09:37:38 pm »
hmm I still no idea. I think but I'm close to a solution of picking, but I still don't know how I can split my object to smallest part. Something like: I have a object and this object have ex. 10 triangle. (triangle = poligon??) And I want split my object to 2 object (each of them has to have 5 triangle?). Then I want ex. translate only one of them. ::)

I know that mayby it's easy or writing in documentation, but as you probably can see, my english is poor, so please help me.

7
Support / Picking the part of object
« on: December 02, 2013, 02:50:22 pm »
Hello
I'm try to do something like this: I have a object. I use a "getMaxPolygonID()" and result is 21 part of object. I want click on part of object (something like click on polygon number1, or better click on group of the poligon ex. (polygon1 + polygon2) and do whatever. I think about "Interact2D", "VisList" and "Polygon Menager" , but I have no idea about this. So my question is, How I can realize samething like:

1)Split object into pieces.
2)Group selected pieces to object

Or, maybe it's different way to do this.

PS. It's my four question, and I'm very glad of jpct support in this forum. It's very helpful and quick.

edit: I found a "getPolygonIDs" from CollisionEvent.. hmm it's what I want?

8
Support / Animated 3ds object
« on: November 27, 2013, 03:18:52 pm »
Sorry, my english is low lovel.
Hello, so what i want to do? I want adding to my scene a animation snow/rain effect. I working with "3ds max" and particle flow. Whatever, I generate a animated 3ds model file (*.3DS). When i open it in 3ds max it's working great. So i try load this file to my project. (load "static" 3ds work great). It's compile but no start.

My logout sometimes stop in this place

Code: [Select]
11-27 08:55:16.616: I/jPCT-AE(747): Processing object from 3DS-file: BakedPar38
11-27 08:55:16.636: I/jPCT-AE(747): Object 'BakedPar38_jPCT69' created using 1 polygons and 3 vertices.
11-27 08:55:16.636: I/jPCT-AE(747): Processing object from 3DS-file: BakedPar39
11-27 08:55:16.636: I/jPCT-AE(747): Object 'BakedPar39_jPCT70' created using 1 polygons and 3 vertices.
11-27 08:55:16.636: I/jPCT-AE(747): Processing object from 3DS-file: BakedPar40
11-27 08:55:16.648: I/jPCT-AE(747): Name in hierarchy found: BakedParti

here is my logout:
http://pastebin.com/4n2b7Hh0

I see that in example animated 3ds load frame by frame, but i don't know where i have a frame in my 3ds file. I have one animated file. My 3ds file have about 80kb size (this is only 40 animated triangle).

Please help me

Whatever, is antoher way to good snow/rain effect?

9
Support / normal maping for object with two texture.
« on: November 20, 2013, 01:11:54 am »
I have a class. This create the box with two textures. One of the textures is for "front" and other is for "back". Function reTexture repeat the texture. It's work great:

Now, i want add normal mapping to the texture, and i want "3d effect" of brick. I try make this very long time but the result is nothing.
my code :
Code: [Select]
public class Prostokat {

public Object3D createBox(final float width, final float depth,
final float height) {
final Object3D box = new Object3D(10);
final Object3D box1 = new Object3D(2);
Object3D box_suma;
final float x = width / 2;
final float y = depth / 2;
final float z = height / 2;

final int textureFactor = 512; //

final SimpleVector upperLeftFront = new SimpleVector(-x, -y, -z);
final SimpleVector upperRightFront = new SimpleVector(x, -y, -z);
final SimpleVector lowerLeftFront = new SimpleVector(-x, y, -z);
final SimpleVector lowerRightFront = new SimpleVector(x, y, -z);

final SimpleVector upperLeftBack = new SimpleVector(-x, -y, z);
final SimpleVector upperRightBack = new SimpleVector(x, -y, z);
final SimpleVector lowerLeftBack = new SimpleVector(-x, y, z);
final SimpleVector lowerRightBack = new SimpleVector(x, y, z);

int texIDw = TextureManager.getInstance().getTextureID("TexScianaW");
int texIDz = TextureManager.getInstance().getTextureID("TexScianaZ");
// front
box1.addTriangle(lowerLeftFront, x / textureFactor, 0, lowerRightFront,
0, 0, upperLeftFront, x / textureFactor, y / textureFactor); //zeby dobrze zorientowac normalne do mapowania tekstury musze o dobry kąt obrócić normalne , dlatego dziele przez texturefactor/ chyba ;/
box1.addTriangle(lowerRightFront, 0, 0, upperRightFront, 0, y
/ textureFactor, upperLeftFront, x / textureFactor, y
/ textureFactor);
box1.calcTextureWrapSpherical();
box1.build();
reTexture(box1, "TexScianaZ", 2f);

// back
box.addTriangle(upperLeftBack, x / textureFactor, 0, upperRightBack, 0,
0, lowerLeftBack, x / textureFactor, z / textureFactor,
texIDw);
box.addTriangle(upperRightBack, 0, 0, lowerRightBack, 0, z
/ textureFactor, lowerLeftBack, x / textureFactor, z
/ textureFactor, texIDw);

// upper
box.addTriangle(upperLeftFront, x / textureFactor, z / textureFactor,
upperRightBack, 0, 0, upperLeftBack, x / textureFactor, 0,
texIDz);
box.addTriangle(upperLeftFront, x / textureFactor, z / textureFactor,
upperRightFront, 0, z / textureFactor, upperRightBack, 0, 0,
texIDz);

// lower
box.addTriangle(lowerLeftBack, x / textureFactor, 0, lowerRightBack, 0,
0, lowerLeftFront, x / textureFactor, z / textureFactor,
texIDz);
box.addTriangle(lowerRightBack, 0, 0, lowerRightFront, 0, z
/ textureFactor, lowerLeftFront, x / textureFactor, z
/ textureFactor, texIDz);

// Left
box.addTriangle(lowerRightBack, y / textureFactor, 0, upperRightBack,
0, 0, lowerRightFront, y / textureFactor, z / textureFactor,
texIDz);
box.addTriangle(upperRightBack, 0, 0, upperRightFront, 0, z
/ textureFactor, lowerRightFront, y / textureFactor, z
/ textureFactor, texIDz);

// Right
box.addTriangle(upperLeftBack, y / textureFactor, 0, lowerLeftBack, 0,
0, upperLeftFront, y / textureFactor, z / textureFactor,
texIDz);
box.addTriangle(lowerLeftBack, 0, 0, lowerLeftFront, 0, z
/ textureFactor, upperLeftFront, y / textureFactor, z
/ textureFactor, texIDz);
box.calcTextureWrapSpherical();
box.build();
box_suma = Object3D.mergeObjects(box, box1);
box_suma.build();
return box_suma;
}
private void reTexture(Object3D obj, String t2, float tileFactor) {
Logger.log("ReTexturing...", Logger.MESSAGE);
PolygonManager pm=obj.getPolygonManager();
int t2Id=TextureManager.getInstance().getTextureID(t2);
int end=pm.getMaxPolygonID();
for (int i=0; i<end; i++) {
int t1=pm.getPolygonTexture(i);
SimpleVector uv0=pm.getTextureUV(i, 0);
SimpleVector uv1=pm.getTextureUV(i, 1);
SimpleVector uv2=pm.getTextureUV(i, 2);
TextureInfo ti=new TextureInfo(t1, uv0.x, uv0.y, uv1.x, uv1.y, uv2.x, uv2.y);

uv0.scalarMul(tileFactor);
uv1.scalarMul(tileFactor);
uv2.scalarMul(tileFactor);

ti.add(t2Id, uv0.x, uv0.y, uv1.x, uv1.y, uv2.x, uv2.y, TextureInfo.MODE_MODULATE);
pm.setPolygonTexture(i, ti);
}
Logger.log("ReTexturing...done!", Logger.MESSAGE);
}
}

I try connect this class with modyfied example "HelloShrader" but i can't.

Please help :)


Pages: [1]