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

Pages: [1] 2 3 ... 107
1
Support / Re: Asymmetrical Scaling
« on: June 24, 2018, 09:27:10 pm »
There's nothing. This is how glow is created. I even added the setRotationMatrix() call to see if that would help, but nothing changed.

Code: [Select]
if (deltaGrowth > 1.00f) {
     obj.removeChild(glow);
     theWorld.removeObject(glow);
     glow = new Object3D(obj, false);
     glow.setTexture("Glow");
     glow.setTransparencyMode(Object3D.TRANSPARENCY_MODE_ADD);
     glow.build();
     glow.setRotationMatrix(obj.getRotationMatrix());
     moveTo(glow, obj.getTransformedCenter());
     glow.setTransparency(100);
     deltaGrowth = 0.00f;
     obj.addChild(glow);
     theWorld.addObject(glow);
     vController = new VertexController(glow);
}

2
Support / Re: Asymmetrical Scaling
« on: June 22, 2018, 10:11:29 am »
Then why doesn't that snippet place the glow over the glower? Can you think of a possible solution?

Edit: I should mention that the original object was created with ExtendedPrimitives.createCylinder(...).

3
Support / Re: Asymmetrical Scaling
« on: June 21, 2018, 10:06:48 pm »
That's weird. I actually have two different, possibly related, problems. The second one is that the glow object, though both parallel and near the original object, is not in the exact same space as the original object. Yet I initialize it like so:

Code: [Select]
glow = new Object3D(obj, false);

Do you have to call build() on the glow object? Also, does getTransformedCenter() always consider the translations of all parents? Because I can't place the glow over the glower even with:

Code: [Select]
SimpleVector to = obj.getTransformedCenter();
SimpleVector o = glow.getTransformedCenter();
glow.translate(to.x-o.x, to.y-o.y, to.z-o.z);

4
Support / Re: Asymmetrical Scaling
« on: June 21, 2018, 06:04:45 pm »
Obviously, that it's scaling in the wrong axis. But only in my real-world use. The test in which I didn't rotate the object worked fine.

5
Support / Asymmetrical Scaling
« on: June 21, 2018, 06:24:00 am »
I'm trying to create a flickering glow. To that end, I wrote the following thickening method in a vertex controller. The problem happens when the base object, from which the glow object is created, is rotated because the glow appears to be modified in worldspace as opposed to in objectspace. What should I do to calculate the x/z distortion in objectspace?

Code: [Select]
     public void thicken(final float deltaTime) {
SimpleVector[] vertices = this.getSourceMesh();
SimpleVector[] destination = this.getDestinationMesh();
for (int i = 0; i < vertices.length; i++) {
     SimpleVector v = vertices[i];
     v.x *= (1f+deltaTime);
     v.z *= (1f+deltaTime);
     destination[i] = v;
}
this.updateMesh();
     }

6
 Since I've already solved it, there's no problem. But what I did there was a splitter: the MD2 exporter exports all animations as a single stream. My program splits them and saves a serialized copy.

7
Some things use the 0, some don't. This print works. The above parsing had but one problem: it was always restarting the keyframes (I just added a delta at the end of the inner loop).

Code: [Select]
     private void printAnimations() {
System.out.println("****************Animations****************");
Animation animation = model.getAnimationSequence();
animationNames = new String[animation.getSequenceCount()];
for (int i = 0; i < animationNames.length; i++) {
     animationNames[i] = animation.getName(i+1);//i+1
     int[] borders = animation.getSequenceBorders(animation.getSequence(animationNames[i]));
     System.out.println("Animation: "+animationNames[i] +", start: "+borders[0] +" end: "+borders[1]);
}
System.out.println("****************Animations****************\n");
      }

8
OK, but if it's by design that the animation in slot 0, as printed by the following code, is "complete," then my problem is that the last animation sub-sequence isn't being created. But there are no complaints about the amount of frames and my method prints a message after finishing its parsing.

Code: [Select]
     private void print() {
Animation animation = model.getAnimationSequence();
String[] animationNames = new String[animation.getSequenceCount()];
for (int i = 0; i < animationNames.length; i++) {
     animationNames[i] = animation.getName(i);
     System.out.println("Animation: "+animationNames[i] +", start: "+animation.getSequenceBorders(i+1)[0] +" end: "+animation.getSequenceBorders(i+1)[1]);
}
     }

9
This is an animation splitter. The following code, instead of naming the first clip the first animation's name, names the second animation that. The second gets the first one's name, the third the second's, and so forth. The first clip seems to get an automatic name of "complete:"

Code: [Select]
     Mesh[] keyFrames = singleStream.getKeyFrames();
     Animation animations = new Animation(keyFrames.length);
     int numberOfAnimations, totalFramesInMax = 0;
     for (numberOfAnimations = 0; numberOfAnimations < nameFields.length && nameFields[numberOfAnimations].getText().trim().length() > 0; numberOfAnimations++)
totalFramesInMax += Integer.parseInt(numberOfFramesFields[numberOfAnimations].getText().trim());
     double divider = (double)totalFramesInMax/(double)keyFrames.length;
     System.out.println("Total Frames in Max: "+totalFramesInMax +" Divider: "+divider +" Number of KeyFrames: "+keyFrames.length);
     for (int i = 0; i < numberOfAnimations; i++) {
final int animationFrames = Integer.parseInt(numberOfFramesFields[i].getText().trim());
final int totalFrames = keyFrames.length;
animations.createSubSequence(nameFields[i].getText().trim());
for (int kf = 0; kf < animationFrames/divider; kf++)
     animations.addKeyFrame(keyFrames[kf]);
System.out.println("Finished for: "+nameFields[i].getText());
     }
     model.setAnimationSequence(animations);

Is this a jpct bug?

10
...of keyframes? You should put that in the docs.

For now, I'm going to assume that it is. ; )

11
Support / Re: Merging OBJ Frames
« on: June 04, 2018, 09:05:14 pm »
Maybe the OBJ exporter sorts them differently relative to their poses. All the same, I was ableto export a character this way that I otherwise would not. The project has been posted.

12
Projects / 3ds Max OBJ Animation
« on: June 04, 2018, 06:43:14 pm »
I called this MergeAndSerialize because it first exports each frame of your character's animation as an OBJ (I did not write the included MaxScript), then it creates a single serialized file with a jpct animation. Hope it helps someone else: https://www.dropbox.com/s/1aumqalafjmietb/MergeAndSerialize.rar?dl=0

13
Support / Re: Merging OBJ Frames
« on: June 03, 2018, 07:39:51 am »
By testing the triangle, instead of the vertex, count I was able to create my file. It's kind of huge, and only 78 of the 345 frames went in. There are a couple of artifacts, like triangles that shouldn't be there appearing in front of the character, but in general it works. I will pack it with the MaxScript that I found and post it in projects.

14
Support / Re: Merging OBJ Frames
« on: June 02, 2018, 06:59:14 pm »
Down to explorer's granularity they look identical at 5170 kb each. Anyway, I added the following block and am still getting that error message:

Code: [Select]
     if (mesh.getVertexCount() == vertexCount) {
animation.addKeyFrame(mesh);
usedFrames++;
     }

And the number of usedFrames is equal to the total number of frames.

15
Support / Re: Merging OBJ Frames
« on: June 02, 2018, 06:28:34 am »
All of the OBJs have the exact same file size. The following is the output for the first few frames:

Quote
Loading file Catwoman000.mtl
Text file Catwoman000.mtl loaded...386 bytes
Processing new material CatSuit!
Texture named CatAtlas.png added to TextureManager!
Loading file Catwoman000.obj
Text file Catwoman000.obj loaded...5293896 bytes
Processing object from OBJ-file: CC_Base_Body
Processing object from OBJ-file: CC_Base_Body
Object 'CC_Base_Body_jPCT-2' created using 15500 polygons and 8068 vertices.
Processing object from OBJ-file: CC_Base_Tongue
Processing object from OBJ-file: CC_Base_Tongue
Object 'CC_Base_Tongue_jPCT-1' created using 592 polygons and 309 vertices.
Processing object from OBJ-file: CC_Base_Eye
Processing object from OBJ-file: CC_Base_Eye
Object 'CC_Base_Eye_jPCT0' created using 1088 polygons and 580 vertices.
Processing object from OBJ-file: CC_Base_Teeth
Processing object from OBJ-file: CC_Base_Teeth
Object 'CC_Base_Teeth_jPCT1' created using 4822 polygons and 2632 vertices.
Processing object from OBJ-file: Cat_Suit
Processing object from OBJ-file: Cat_Suit
Object 'Cat_Suit_jPCT2' created using 8647 polygons and 4407 vertices.
Processing object from OBJ-file: Bunny_Female
Processing object from OBJ-file: Bunny_Female
Object 'Bunny_Female_jPCT3' created using 1540 polygons and 819 vertices.
Processing object from OBJ-file: Fingerless_gloves
Processing object from OBJ-file: Fingerless_gloves
Object 'Fingerless_gloves_jPCT4' created using 2908 polygons and 1510 vertices.
Processing object from OBJ-file: Female_knee_boots
Processing object from OBJ-file: Female_knee_boots
Object 'Female_knee_boots_jPCT5' created using 2416 polygons and 1228 vertices.
Processing object from OBJ-file: RL_G6_Hair
Processing object from OBJ-file: RL_G6_Hair
Object 'RL_G6_Hair_jPCT6' created using 1266 polygons and 947 vertices.
Processing object from OBJ-file: RL_Face002
Processing object from OBJ-file: RL_Face002
Object 'RL_Face002_jPCT7' created using 12470 polygons and 6429 vertices.



Frames length: 345
I: 1
Loading file Catwoman001.mtl
Text file Catwoman001.mtl loaded...386 bytes
Processing new material CatSuit!
Loading file Catwoman001.obj
Text file Catwoman001.obj loaded...5294012 bytes
Processing object from OBJ-file: CC_Base_Body
Processing object from OBJ-file: CC_Base_Body
Object 'CC_Base_Body_jPCT9' created using 15500 polygons and 8068 vertices.
Processing object from OBJ-file: CC_Base_Tongue
Processing object from OBJ-file: CC_Base_Tongue
Object 'CC_Base_Tongue_jPCT10' created using 592 polygons and 309 vertices.
Processing object from OBJ-file: CC_Base_Eye
Processing object from OBJ-file: CC_Base_Eye
Object 'CC_Base_Eye_jPCT11' created using 1088 polygons and 580 vertices.
Processing object from OBJ-file: CC_Base_Teeth
Processing object from OBJ-file: CC_Base_Teeth
Object 'CC_Base_Teeth_jPCT12' created using 4822 polygons and 2632 vertices.
Processing object from OBJ-file: Cat_Suit
Processing object from OBJ-file: Cat_Suit
Object 'Cat_Suit_jPCT13' created using 8647 polygons and 4407 vertices.
Processing object from OBJ-file: Bunny_Female
Processing object from OBJ-file: Bunny_Female
Object 'Bunny_Female_jPCT14' created using 1540 polygons and 819 vertices.
Processing object from OBJ-file: Fingerless_gloves
Processing object from OBJ-file: Fingerless_gloves
Object 'Fingerless_gloves_jPCT15' created using 2908 polygons and 1510 vertices.
Processing object from OBJ-file: Female_knee_boots
Processing object from OBJ-file: Female_knee_boots
Object 'Female_knee_boots_jPCT16' created using 2416 polygons and 1228 vertices.
Processing object from OBJ-file: RL_G6_Hair
Processing object from OBJ-file: RL_G6_Hair
Object 'RL_G6_Hair_jPCT17' created using 1266 polygons and 947 vertices.
Processing object from OBJ-file: RL_Face002
Processing object from OBJ-file: RL_Face002
Object 'RL_Face002_jPCT18' created using 12471 polygons and 6430 vertices.
I: 2
Loading file Catwoman002.mtl
Text file Catwoman002.mtl loaded...386 bytes
Processing new material CatSuit!
Loading file Catwoman002.obj
Text file Catwoman002.obj loaded...5294007 bytes
Processing object from OBJ-file: CC_Base_Body
Processing object from OBJ-file: CC_Base_Body
Object 'CC_Base_Body_jPCT20' created using 15500 polygons and 8068 vertices.
Processing object from OBJ-file: CC_Base_Tongue
Processing object from OBJ-file: CC_Base_Tongue
Object 'CC_Base_Tongue_jPCT21' created using 592 polygons and 309 vertices.
Processing object from OBJ-file: CC_Base_Eye
Processing object from OBJ-file: CC_Base_Eye
Object 'CC_Base_Eye_jPCT22' created using 1088 polygons and 580 vertices.
Processing object from OBJ-file: CC_Base_Teeth
Processing object from OBJ-file: CC_Base_Teeth
Object 'CC_Base_Teeth_jPCT23' created using 4822 polygons and 2632 vertices.
Processing object from OBJ-file: Cat_Suit
Processing object from OBJ-file: Cat_Suit
Object 'Cat_Suit_jPCT24' created using 8647 polygons and 4407 vertices.
Processing object from OBJ-file: Bunny_Female
Processing object from OBJ-file: Bunny_Female
Object 'Bunny_Female_jPCT25' created using 1540 polygons and 819 vertices.
Processing object from OBJ-file: Fingerless_gloves
Processing object from OBJ-file: Fingerless_gloves
Object 'Fingerless_gloves_jPCT26' created using 2908 polygons and 1510 vertices.
Processing object from OBJ-file: Female_knee_boots
Processing object from OBJ-file: Female_knee_boots
Object 'Female_knee_boots_jPCT27' created using 2416 polygons and 1228 vertices.
Processing object from OBJ-file: RL_G6_Hair
Processing object from OBJ-file: RL_G6_Hair
Object 'RL_G6_Hair_jPCT28' created using 1266 polygons and 947 vertices.
Processing object from OBJ-file: RL_Face002
Processing object from OBJ-file: RL_Face002
Object 'RL_Face002_jPCT29' created using 12469 polygons and 6428 vertices.

Pages: [1] 2 3 ... 107