The question about the model location

Started by gamenewer, November 20, 2014, 09:58:28 AM

Previous topic - Next topic

gamenewer

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.

EgonOlsen

By translating it to the correct position in your code?

gamenewer

Yes , translating tunnel to the correct position in my code

EgonOlsen

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

dutch_delight

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.

gamenewer

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

EgonOlsen

No idea. I would just place it in code based on visuals (i.e. fiddle around with the position until it fits).

gamenewer

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 !

gamenewer

Maybe I find the problem, before the roate ,see attached picture

gamenewer

and I wanted rotate effect is attached picture

gamenewer

but the jpct act rotate  is attached picture

gamenewer

So the last result is like attached picture , sorry for attached so many picture (64K limit )

gamenewer

#12
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 !