www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: gamenewer on November 20, 2014, 09:58:28 am

Title: The question about the model location
Post by: gamenewer 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.
Title: Re: The question about the model location
Post by: EgonOlsen on November 20, 2014, 02:57:36 pm
By translating it to the correct position in your code?
Title: Re: The question about the model location
Post by: gamenewer on November 21, 2014, 01:29:56 am
Yes , translating tunnel to the correct position in my code
Title: Re: The question about the model location
Post by: EgonOlsen 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...
Title: Re: The question about the model location
Post by: dutch_delight 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.
Title: Re: The question about the model location
Post by: gamenewer 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 ;)
Title: Re: The question about the model location
Post by: EgonOlsen 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).
Title: Re: The question about the model location
Post by: gamenewer 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 !
Title: Re: The question about the model location
Post by: gamenewer on November 25, 2014, 12:38:26 pm
Maybe I find the problem, before the roate ,see attached picture
Title: Re: The question about the model location
Post by: gamenewer on November 25, 2014, 12:43:11 pm
and I wanted rotate effect is attached picture
Title: Re: The question about the model location
Post by: gamenewer on November 25, 2014, 12:44:29 pm
but the jpct act rotate  is attached picture
Title: Re: The question about the model location
Post by: gamenewer on November 25, 2014, 12:46:36 pm
So the last result is like attached picture , sorry for attached so many picture (64K limit )
Title: Re: The question about the model location
Post by: gamenewer 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 !