Author Topic: Rotation of asymmetrical 3ds object problem  (Read 2664 times)

Offline Cowbox

  • int
  • **
  • Posts: 58
  • >:D
    • View Profile
    • Soharix
Re: Rotation of asymmetrical 3ds object problem
« Reply #15 on: February 08, 2012, 11:48:32 am »
Well I can't be setting it on clones for this object.

I made sure of that by only using wall1 for this purpose; the rest of the engine is being handled elsewhere and isn't being touched.

That's the complete code up there for wall1^, and I'm definitely calling build. :S

I've also tried loads of combinations of build before and after setting the pivot, not building at all, rebuilding, unbuilding.

Nothing's making any difference, the pivot still comes out at 5,0,5 regardless. :S

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11775
    • View Profile
    • http://www.jpct.net
Re: Rotation of asymmetrical 3ds object problem
« Reply #16 on: February 08, 2012, 12:44:02 pm »
(5, 0, 5) isn't the pivot that build() calculates...that would be (-4.757353, 1.4024623E-7, 4.757353). If you still get (5, 0, 5), you are setting this somewhere in your code after setting it to (0,0,0) and before calling getRotationPivot(). Just check for references in your code to setRotationPivot() and you should find it somewhere, long lost and forgotten.

Offline Cowbox

  • int
  • **
  • Posts: 58
  • >:D
    • View Profile
    • Soharix
Re: Rotation of asymmetrical 3ds object problem
« Reply #17 on: February 08, 2012, 01:08:32 pm »
Lol my code's really not that long at all...

I've already pasted everything I'm doing to wall1 in this thread.

I wasn't using setRotationPivot until before you started telling me to, so the only places it's going to be are either on the engine related props (which I'm pretty sure I subsequently removed) or on the 4 walls I've used to show this problem.

Here's a big paste of the entire code if it makes any headway on this. xD
http://slexy.org/raw/s2mXZOlk3r

There's only one other source file and that's for handling sound. (I haven't managed to make the engine any more streamlined because of problems like this getting in my way every 10 lines xD)

Extra:
Just realised I've left the pivots set to -6,0,-6 in that but I can assure you, the console output is still reading 5,0,5 regardless of whatever I put in there... xD

And here's a picture showing just that:
« Last Edit: February 08, 2012, 01:13:20 pm by Cowbox »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11775
    • View Profile
    • http://www.jpct.net
Re: Rotation of asymmetrical 3ds object problem
« Reply #18 on: February 08, 2012, 01:20:27 pm »
Remove (or relocate) this call: 

Code: [Select]
world.buildAllObjects();
It calls build() on all objects...again. And that resets the pivot.

Offline Cowbox

  • int
  • **
  • Posts: 58
  • >:D
    • View Profile
    • Soharix
Re: Rotation of asymmetrical 3ds object problem
« Reply #19 on: February 08, 2012, 01:24:30 pm »
Aha! xD

Finally, we've found the problem.

I knew it'd be something derpy like that. :D

Thanx, now I can go make stuff :D:D:D:D