### 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 29, 2018, 07:49:09 am »
ClearRotation() doesn't do anything (and it shouldn't, since I interpolate the matrices of the lightsaber and the skeletal structure's hand in the loop). ClearTranslation fixed its initial position, thanks very much.

Now, I'm having a hard time keeping glow in the same place. I've tried every permutation of the following method of which I could think:

Code: [Select]
`     public void thicken(final float deltaTime) { SimpleVector[] vertices = this.getSourceMesh(); SimpleVector[] destination = this.getDestinationMesh(); final SimpleVector c = new SimpleVector(obj.getTransformedCenter()); float minX = Float.MAX_VALUE, minZ = Float.MAX_VALUE, maxX = Float.MIN_VALUE, maxZ = Float.MIN_VALUE; for (int i = 0; i < vertices.length; i++) {      SimpleVector v = new SimpleVector(vertices[i]);      v.x *= (1f+deltaTime);//      v.x -= deltaTime*.5f;      v.z *= (1f+deltaTime);//      v.z -= deltaTime*.5f;      destination[i] = v;      if (minX > v.x) minX = v.x;      if (maxX < v.x) maxX = v.x;      if (minZ > v.z) minZ = v.z;      if (maxZ < v.z) maxZ = v.z; } this.updateMesh(); SimpleVector d = new SimpleVector((minX-maxX), 0f, (minZ-maxZ)); obj.translate(d);// obj.clearTranslation();// obj.calcCenter();// Glow.moveTo(obj, c);// Glow.moveTo(obj, d.calcSub(c));     }`

17
##### Support / Re: Asymmetrical Scaling
« on: June 28, 2018, 06:38:11 pm »
The glow object is the child of blade (obj in Glow class).

18
##### Support / Re: Asymmetrical Scaling
« on: June 28, 2018, 10:05:23 am »
The original object, blade (obj in the Glow class) is an ExtendedPrimitive. Glow itself is a copy of blade (new Object3D(obj, false)).

19
##### Support / Re: Asymmetrical Scaling
« on: June 27, 2018, 07:04:58 pm »
It would've been crazy if they weren't in the same place.

Quote
0.18368883, 0.22368883
-1.0867921, -0.08679211
0.9159291, 0.95592904
******

******Glow Bounds:
0.18368883, 0.22368883
-1.0867921, -0.08679211
0.9159291, 0.95592904
******

20
##### Support / Re: Asymmetrical Scaling
« on: June 27, 2018, 04:25:34 am »
Have a look at this. The further ahead I move Luke, the further up the glow goes. I've tried, unsuccessfully, rotating getTransformedCenter() of the blade, but it's still wrong.

21
##### Support / Re: Asymmetrical Scaling
« on: June 26, 2018, 07:33:34 pm »

22
##### 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.

23
##### 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)

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

25
##### 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(...).

26
##### 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);`

27
##### 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.

28
##### 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();     }`

29
##### Support / Re: Is Animation.getKeyFrames().length always the exact size of the total number...
« on: June 17, 2018, 08:18:12 pm »
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.

30
##### Support / Re: Is Animation.getKeyFrames().length always the exact size of the total number...
« on: June 15, 2018, 08:41:55 pm »
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");      }`

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