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

Pages: 1 2 3 [4]
46
Support / Re: Cube Texture Problems
« on: June 18, 2011, 08:41:38 pm »
So, help me, how i can draw a diffrent texture for ecah face?
And why back textures like a mirror? should i have a direction for back faces?

47
Support / Re: Cube Texture Problems
« on: June 17, 2011, 09:33:14 am »
Yes, thank you, thats great. I understand.
At the back side of my cube textures look like in mirror, what should i need to change?
And i can use anly 1 texture for all faces? who can i make a texture for each face?
And also, can u give me an account to wiki.
Want to make some examples there, about you awesome engine.


48
Support / Re: Cube Texture Problems
« on: June 17, 2011, 09:00:17 am »
So, i made it like this:
public class TextureBox extends Object3D{
   
   int size = 1;
   
   public  TextureBox(int size){   
      
      super(size);
       SimpleVector upperLeftFront=new SimpleVector(-size,-size,-size);
       SimpleVector upperRightFront=new SimpleVector(size,-size,-size);
       SimpleVector lowerLeftFront=new SimpleVector(-size,size,-size);
       SimpleVector lowerRightFront=new SimpleVector(size,size,-size);
       
       SimpleVector upperLeftBack = new SimpleVector( -size, -size, size);
       SimpleVector upperRightBack = new SimpleVector(size, -size, size);
       SimpleVector lowerLeftBack = new SimpleVector( -size, size, size);
       SimpleVector lowerRightBack = new SimpleVector(size, size, size);
       
       // Front
       this.addTriangle(upperLeftFront,0,0, lowerLeftFront,0,size, upperRightFront,size,0);
       this.addTriangle(upperRightFront,size,0, lowerLeftFront,0,size, lowerRightFront,size,size);
       
       // Back
       this.addTriangle(upperLeftBack,0,0, upperRightBack,size,0, lowerLeftBack,0,size);
       this.addTriangle(upperRightBack,size,0, lowerRightBack,size,size, lowerLeftBack,0,size);
       
       // Upper
       this.addTriangle(upperLeftBack,0,0, upperLeftFront,0,size, upperRightBack,size,0);
       this.addTriangle(upperRightBack,size,0, upperLeftFront,0,size, upperRightFront,size,size);
       
       // Lower
       this.addTriangle(lowerLeftBack,0,0, lowerRightBack,size,0, lowerLeftFront,0,size);
       this.addTriangle(lowerRightBack,size,0, lowerRightFront,size,size, lowerLeftFront,0,size);
       
       // Left
       this.addTriangle(upperLeftFront,0,0, upperLeftBack,size,0, lowerLeftFront,0,size);
       this.addTriangle(upperLeftBack,size,0, lowerLeftBack,size,size, lowerLeftFront,0,size);
       
       // Right
       this.addTriangle(upperRightFront,0,0, lowerRightFront,0,size, upperRightBack,size,0);
       this.addTriangle(upperRightBack,size,0, lowerRightFront, 0,size, lowerRightBack,size,size);
       this.build();
   }

}



But when i'm use it like this:
cube = new TextureBox( 12);
cube.setTexture("texture");
I see 12x12 textures per face, and i cant understand why...
What should i do for see 1 texture per 1 face?

49
Support / Re: Cube Texture Problems
« on: June 16, 2011, 11:28:41 pm »
You could, but it's worth the hassle. Objects created by the Primitives class are meant to be used as simple place holder objects to try things out. They are not meant to be used for "real" applications unless you can live with the fact that they have no textures assigned.

To scale in that code simply by using other values than -+1

"Texture must be a triangle?"...i don't get that question. What do you mean with that?
Ok, i understood, what i can scale by use another values.
About texture, i mean what in this application will be a lot of cubes, and i'll need to apply it to cube by the air.
So, in code example, which you show me, i add faces, like triangles, and texture also must be triangle or square, for example 64x64?

50
Support / Re: Cube Texture Problems
« on: June 16, 2011, 08:53:19 pm »
A simple cube can also be done in code pretty easily. The objects generated by the Primitives class don't have any uv-mapping. See this thread: http://www.jpct.net/forum2/index.php/topic,393.0.html. It also contains some code at the end to create a cube with proper uv-mapping.
So, with primitives i can't cover all cube by the different textures?
And what about size of object, for example i use Primitives.getCube(12), how can i use scale in this code?
Texture must be a triangle?
Object3D box=new Object3D(12);
   
    SimpleVector upperLeftFront=new SimpleVector(-1,-1,-1);
    SimpleVector upperRightFront=new SimpleVector(1,-1,-1);
    SimpleVector lowerLeftFront=new SimpleVector(-1,1,-1);
    SimpleVector lowerRightFront=new SimpleVector(1,1,-1);
   
    SimpleVector upperLeftBack = new SimpleVector( -1, -1, 1);
    SimpleVector upperRightBack = new SimpleVector(1, -1, 1);
    SimpleVector lowerLeftBack = new SimpleVector( -1, 1, 1);
    SimpleVector lowerRightBack = new SimpleVector(1, 1, 1);

51
Support / Re: Cube Texture Problems
« on: June 16, 2011, 07:32:35 pm »
You can use UV mapping
Can you make a little example?

52
Support / Re: Cube Texture Promblems
« on: June 16, 2011, 03:55:00 pm »
I think i need smth like skyBox, but with cube functionality, is it possible in jpct android engine?
it wold be great for having a constructor for cube like:
public SkyBox(java.lang.String left,
              java.lang.String front,
              java.lang.String right,
              java.lang.String back,
              java.lang.String up,
              java.lang.String down,
              float size)

53
Support / Cube Texture Problems
« on: June 16, 2011, 03:48:59 pm »
Hi!
I'm just started with your engine, and it's great.
But a have some problem.
Cant assign a texture for each face of cube. I have 8 png files 64x64.
How can i assign this?
If a doing it like in demo example in one file, they are wraping spherical, and it looks not so good)
Tried like this one:
cube.getPolygonManager().setPolygonTexture(iterator, TextureManager.getInstance().getTextureID("texture"));
It doesnt work also.
I downloaded Alien game, but i didn't find how testure setting at the wal.
Thanks a lot!
      

Pages: 1 2 3 [4]