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 4 ... 108
16
Support / Re: Asymmetrical Scaling
« on: June 26, 2018, 09:21:29 am »
No, that was my failed attempt to solve the problem. It doesn't work with or without it.

17
Support / Re: Asymmetrical Scaling
« on: June 25, 2018, 08:32:46 pm »
This is what I get:

Quote
Glow before build(): (0.20492004,0.06320784,0.28592888)
Glow after build(): (0.20492004,0.06320784,0.28592888)
Glow after translation: (0.31077987,0.6419327,1.6769919) blade: (0.31077987,0.6419327,1.6769919)

18
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);
}

19
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(...).

20
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);

21
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.

22
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();
     }

23
 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.

24
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");
      }

25
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]);
}
     }

26
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?

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

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

28
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.

29
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

30
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.

Pages: 1 [2] 3 4 ... 108