Author Topic: The question about the model location  (Read 4514 times)

Offline gamenewer

  • long
  • ***
  • Posts: 171
    • View Profile
The question about the model location
« on: November 20, 2014, 09:58:28 am »
Hello,  I made a tunnel  on Bézier curve(this curve is my road way, I will use Bézier curve generate the race road by program), if I import the  tunnel model in jpct-ae , How can I location the tunnel position on Bézier curve  at right postion ( I means put the tunel on desized position , the position the same as  in blender tool)?  thanks very much.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: The question about the model location
« Reply #1 on: November 20, 2014, 02:57:36 pm »
By translating it to the correct position in your code?

Offline gamenewer

  • long
  • ***
  • Posts: 171
    • View Profile
Re: The question about the model location
« Reply #2 on: November 21, 2014, 01:29:56 am »
Yes , translating tunnel to the correct position in my code

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: The question about the model location
« Reply #3 on: November 21, 2014, 08:51:16 pm »
Well...what's the problem with just doing it? I'm not sure if i get the question. There's no magic way to place an object on some random point of a bezier curve, if that's what you mean. I would go for a trial-and-error approach here...

Offline dutch_delight

  • int
  • **
  • Posts: 58
    • View Profile
Re: The question about the model location
« Reply #4 on: November 21, 2014, 11:57:33 pm »
If you're exporting a lofted object you probably need to convert it to a mesh. It sounds like you can't see your model because the loft data gets lost when importing into jpct.
Don't know about blender but in 3dsmax I would collapse the mesh then reset the xform and centre the object at world zero.

Offline gamenewer

  • long
  • ***
  • Posts: 171
    • View Profile
Re: The question about the model location
« Reply #5 on: November 24, 2014, 01:43:37 pm »
I'm sorry for reply later,  I   make the tunnel model in blender,  the tunnel position  is fixed (as the picture I show),  not random, now I  export the
bezier curve and tunnel model  , I use bezier curve data to create an race way , and place the tunnel model at right postion as  designed in blender.   My question is  should I do some special translate  for  locate the tunnel model  at desinged position ?  I hope you can see my mean.

I 'm so sorry for my poor english ;)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: The question about the model location
« Reply #6 on: November 25, 2014, 08:17:41 am »
No idea. I would just place it in code based on visuals (i.e. fiddle around with the position until it fits).

Offline gamenewer

  • long
  • ***
  • Posts: 171
    • View Profile
Re: The question about the model location
« Reply #7 on: November 25, 2014, 10:22:39 am »
Hello   Egon, If i  don't rotate the  tunnel model   and  bezier curve , the  tunnel model position is ok (see attached picture), but when I rotate the model tunnel.rotateX((float)Math.PI);    and  mirror the  bezier curve point by  x-coordinate, the position is not ok, I think maybe mirror the bezier curve point is wrong ,  I don't know how to rotate point ,  I use code like this:

mywaypoint = new SimpleVector((float)curvepoint[k++],(float)curvepoint[k++], -1 * (float)curvepoint[k++]);


please help me  to check  where is wrong ,  Thanks !

Offline gamenewer

  • long
  • ***
  • Posts: 171
    • View Profile
Re: The question about the model location
« Reply #8 on: November 25, 2014, 12:38:26 pm »
Maybe I find the problem, before the roate ,see attached picture

Offline gamenewer

  • long
  • ***
  • Posts: 171
    • View Profile
Re: The question about the model location
« Reply #9 on: November 25, 2014, 12:43:11 pm »
and I wanted rotate effect is attached picture

Offline gamenewer

  • long
  • ***
  • Posts: 171
    • View Profile
Re: The question about the model location
« Reply #10 on: November 25, 2014, 12:44:29 pm »
but the jpct act rotate  is attached picture

Offline gamenewer

  • long
  • ***
  • Posts: 171
    • View Profile
Re: The question about the model location
« Reply #11 on: November 25, 2014, 12:46:36 pm »
So the last result is like attached picture , sorry for attached so many picture (64K limit )

Offline gamenewer

  • long
  • ***
  • Posts: 171
    • View Profile
Re: The question about the model location
« Reply #12 on: November 25, 2014, 12:49:20 pm »
Well , if I 'm right,  maybe have some way let model rotate by world origin (0,0,0)  . :)

MM, setRotationPivot can do this !  thanks very much !
« Last Edit: November 25, 2014, 01:15:52 pm by gamenewer »