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

Pages: 1 2 3 [4] 5 6 ... 16
46
Support / Texture Coordinates
« on: June 16, 2016, 06:38:44 am »
I'm creating my very own JSON-serialized 3d format, for use with Bones. It will come straight out of 3ds max via a MaxScript I'm developing (Python script for Blender to follow). In point of fact, it's almost ready, save for the fact that I don't yet understand how to create a SkinData object (question to be posted on the Bones board and I do already have a SkeletonPose object filled) and the little texture issue that I'm having. I'm creating the Object3D's (non-skinned objects will also be supported in my format) texture coordinates with the following line. And the result is visible in the image that follows (mostly correct save for minor issues). I suspect it's a rounding issue. What do you think, Egon?

Code: [Select]
anObject.addTriangle(vector1, uv1.get(0), -(uv1.get(1)-1f), vector2, uv2.get(0), -(uv2.get(1)-1f), vector3, uv3.get(0), -(uv3.get(1)-1f));

47
Support / Texture Mapping
« on: April 06, 2016, 09:14:00 am »
This isn't a jpct-specific question. I can understand if you don't want to answer it, Egon. But here it goes, anyway: how do I texture map a triangle? Put differently, let's say that I have a sphere and a texture map. How do I figure out which part of the texture map goes with each triangle?

48
Feedback / What happened to the Bones Board?
« on: February 16, 2016, 06:02:51 pm »
That's all, folks.

49
Support / I think that you broke the Overlay Class Again
« on: December 20, 2015, 08:57:19 pm »
A while ago, I had a little trouble with the Overlay class. Whenever I spun my ship, the Overlay would struggle to keep up. In this latest version of jpct, my Overlay is on occasion getting covered by Object3Ds:


50
Bones / No OgreMax Means No "Don't Export Bones With No Influence"
« on: December 11, 2015, 07:47:52 pm »
Which, in turn, means that a lot of models won't work. I just spent an hour trying to export a character via EasyOgreExporter and OgreXMLTools. The model got exported, but it's extremely screwy. No way to use it without "Don't Export Bones With No Influence."

Is there no way we could get a MaxScript for Max>Bones? :- )

51
Support / Bug in compileAndStrip
« on: December 07, 2015, 04:29:53 am »
I'll elaborate tomorrow, probably, but the short version is that a part of my very large city model disappears altogether when I call compileAndStrip().

52
Support / HOB Loader
« on: November 23, 2015, 05:17:47 am »
Egon, would you be so kind as to write me a quick-and-dirty loader for a file format specified in the following description? I'd do it if I completely understood it. :- )

Quote
4B object count OF. 0 in empty files
4B simple offset to vertices/faces - doesn't work all the time. Probably useless...

OF * object header 116B
{
  16B name
  4B int facegroups offset
  4B int facegroup header offset
  4B int facegroup header 2 offset
  12B zero
  4B int ? 94, 0xD4
  4B int ? 98, 0x100
  4B int ? 9C, 0x104
  4B float ?:
      -bark_moon, cldcar: 1.0
      -sky, e_cor: 0.2
      -wmvwing: 1.25
  12B zero
  5x4B floats ?
  4B int offset before 0xFFFFFFFF header end marker
  6x 4B float ?
}

OF * facegroup header
{
  2B number of facegroups NOF
  2B NX ?
  NOF * facegroup/meshdef0 offset {
    4B int ?
    4B int facegroup/meshdef0 offset
  }
  2B NOF again
  2B NX ? 
  NX * offsets + zeros
  NOF * name {
    2B facegroup number
    8B char
  }

  4B 0xFFFFFFFF header end marker
}

NOF * facegroup/meshdef0 (fg/m0) 132B
{
  4B int offset to next fg/m0, 0 if there's no next, or in some other circumstances
  4B int offset to prev?
  4B int offset to beginning if this is not first fg/m0?
  4B int offset to end if offset to next = 0
  4B int offset to meshdef1 + 4
  8B zero
  48B 3 * {
    4B float 1.0
    12B zero
  }
  4B int
  3 * 4B float
  3 * 4B float 1.0
  28B zero
}

NOF * facegroup/meshdef1 96B
{
  4B int facedef end offset
  20B zero
  4B int vertices used
  4B int ?
  4B zero
  4B int face def offset
  4B int vertex def offset
  52B zero
}
 
NOF * face block
{
  8B zero
  4B int filepos + 4
  4B int face count FC
  FC * face
  {
    4B int face flags
        - bits 0, 1 unknown
        - if bit 2 is set, face has texture coordinates (uv-s)   
        - if bit 3 is set, the face is a quad, otherwise it's a triangle
        - if bit 4 is set, face has separate colors for each vertex
        - if bit 5 is set, face has color
        - if bit 6 is set, face has extra 8 bytes before vertex colors
        - bits 7-10 unknown. higher bits don't seem to be set
    1B int ? 46/49/4B
    1B int ? 51/71
    1B int ? 0C
    1B int face block size divided by 4
        - A = 40B, 9 = 36, etc.
    2B int zero
    2B int material index
    4x 2B vertex indices, relative to the face group. The last index is zero in triangle faces
    if (face has extra 8 bytes) {
        8B extra bytes
    }
    if (face has color) {
        if (face has vertex colors) {
            3/4 * 4B RGBA vertex color
        } else {   
            4B RGBA color
        }
    }
    if (face has texture coordinates) {
        3/4 * {
            2B int horizontal texture coord
            2B int vertical texture coord
        }
    }
  }
}

Vertices
{
  2B int X
  2B int Y
  2B int Z
  2B int ?
}


53
Support / JPCT's Future
« on: September 13, 2015, 11:05:42 am »
It's my impression that you're not releasing a new version of jpct because you can't decide what to do with lwjgl. Am I right? From what I gather, they fattened it up too much. I don't know about jogl. Is it still just a straight port of openGL? At any rate, what is the future of the hardware renderer? And is making a lwjgl-lite (using the latest lwjgl code and/or binaries) an option at all?

54
Support / Is this scale normal for a town this size?
« on: August 17, 2015, 06:22:09 pm »
Because I'm having trouble with very blocky shadows. And the shadow map size is already 8192x8192.
As printed by World.getBounds():
-264.87097, 276.26025
-11.555313, 104.79436
-304.63678, 247.57347


55
Support / Where to put blit(...)?
« on: June 11, 2015, 06:43:33 pm »
The docs make reference to a non-existent buffer.update(). Where do I put it in Android? Just after clear()?

56
Support / 2 Questions: Tiling and a Shader for Shadows
« on: January 28, 2015, 10:20:18 pm »
The following method (yours, but I was close to writing the same thing!) doesn't work at all on my ground. I think that something must have changed either in jpct or OpenGL in the years since you wrote it:

Code: [Select]
     public void tileTexture(Object3D obj, float tileFactor) {
PolygonManager pm = obj.getPolygonManager();
   
int end=pm.getMaxPolygonID();
for (int i=0; i<end; i++) {
     SimpleVector uv0=pm.getTextureUV(i,0);
     SimpleVector uv1=pm.getTextureUV(i,1);
     SimpleVector uv2=pm.getTextureUV(i,2);
     
     uv0.scalarMul(tileFactor);
     uv1.scalarMul(tileFactor);
     uv2.scalarMul(tileFactor);
     
     int id = pm.getPolygonTexture(i);
     
     TextureInfo ti=new TextureInfo(id, uv0.x, uv0.y, uv1.x, uv1.y, uv2.x, uv2.y);
     pm.setPolygonTexture(i, ti);
}
     }

And a good while ago you mentioned that you were considering a shader-based solution for shadow-casting from texture transparency (otherwise, my trees' shadows would all be rectangular). Have you started it? Has anyone else?

57
Support / Restricting the Mouse
« on: November 12, 2014, 07:12:02 pm »
I'm making a zombie-shooting game and trying to mimic some of the mechanics of The Last of Us, but with a mouse and keyboard. When the player presses S, the camera zooms over the character's shoulder and the mouse can then be used to target a zombie. For the most part, it works. Except that for the life of me I can't seem to restrict the camera's rotation. The following are my mouse event methods. The weird thing is that sometimes the vertical rotation behaves perfectly (and blocks at both ends), and, most of the times it doesn't.

Code: [Select]
     public void mouseMoved(MouseEvent e) {
if (initialX == 100101 && initialY == 100101) {
     initialX = e.getX();
     initialY = e.getY();
}
if (aiming) {
     float deltaX = e.getX()-initialX;
     float deltaY = e.getY()-initialY;
     float addX = deltaX-lastDeltaX;
     float addY = deltaY-lastDeltaY;
     if ((addX > 0.00f && cameraDisplacementY < Math.PI*.3) || (addX < 0.00f && cameraDisplacementY > -Math.PI*.3))
cameraDisplacementY += addX*.02f;//HORIZONTAL ROTATION
     if ((addY > 0.00f && cameraDisplacementX < Math.PI*.1) || (addY < 0.00f && cameraDisplacementX > -Math.PI*.1))
cameraDisplacementX += addY*.02f;//VERTICAL ROTATION
     lastDeltaX = deltaX;
     lastDeltaY = deltaY;

// if (cameraDisplacementY > 1f || cameraDisplacementY < -1f) {
     hero.getRoot().rotateY(cameraDisplacementY);
gun.rotateY(cameraDisplacementY);
heroSphere.rotateY(cameraDisplacementY);
     cameraDisplacementY = 0.00f;
// }
}
     }

     public void mouseDragged(MouseEvent e) {}
     public void mouseExited(MouseEvent e) {
robot.mouseMove(this.getWidth()/2, this.getHeight()/2);
initialX = e.getX();
initialY = e.getY();
     }

     public void mouseClicked(MouseEvent e) {
if (aiming)
     fireWeapon = true;
     }
     private void fire() {
if (bullet != null)
     theWorld.removeObject(bullet);
bullet = new Bullet(gun, theCamera);
bullet.build();
theWorld.addObject(bullet);
if (buffer.usesRenderer(IRenderer.RENDERER_OPENGL))
     bullet.compileAndStrip();
soundQueue = new SoundQueue();
soundQueue.add(new SoundAndTime(shotgunBlast, 0l));
soundQueue.add(new SoundAndTime(shotgunShellsFalling, 700l));
soundQueue.add(new SoundAndTime(shotgunReload, 1100l));
soundQueue.activateQueue();
fireWeapon = false;//JUST FIRED
     }

58
Support / ShadowHelper Bug?
« on: November 06, 2014, 07:02:15 pm »
I'm making a zombie-shooting game about which I'm very excited. I've just run into a problem, though: when I enable shadows and I press fire my shotgun, the following message immediately appears. The two casters so far are the hero and his shotgun. The only receiver is the ground. But when you fire, a bullet (which is a sphere as returned by Primitives.getSphere(...)) is spawned. Note: line 583 is sh.drawScene();

Quote
Exception in thread "main" java.lang.NullPointerException
        at com.threed.jpct.Object3D.setAdditionalColor(Object3D.java:2632)
        at com.threed.jpct.util.ShadowHelper.drawScene(ShadowHelper.java:401)
        at com.threed.jpct.util.ShadowHelper.drawScene(ShadowHelper.java:342)
        at RPG3D.doShadows(RPG3D.java:583)
        at RPG3D.draw(RPG3D.java:563)
        at RPG3D.gameLoop(RPG3D.java:522)
        at RPG3D.<init>(RPG3D.java:168)
        at RPG3D.main(RPG3D.java:928)

59
Bones / Animation All Over the Place
« on: October 16, 2014, 08:49:07 pm »
This animation is fixed in the exact same place in 3ds max. In jpct, it's all over the place. All other animations work perfectly with this model.
https://dl.dropboxusercontent.com/u/93826015/WallCrawl.avi

60
Bones / Joint.addChild(Object3D)
« on: October 01, 2014, 08:49:03 pm »
That would be beyond useful...

Pages: 1 2 3 [4] 5 6 ... 16