I want to connect two moving models with a line.

70 views
Skip to first unread message

조현준

unread,
Oct 19, 2020, 7:12:35 AM10/19/20
to OpenSceneGraph Users
I didn't speak English well, so I used a translator to write it. Please understand if there is any awkwardness in the sentence.

I am moving two 3ds models using osg animationPath. And I want to connect two moving models with a line.

Moving the 3ds model to the specified time and path using AnimationPath was successful.

But I can't remember how to move the line connecting these two models using animationPath.

The two models travel with different paths and different speeds/times. What method should I use to connect and move the lines of these two models?

OpenSceneGraph Users

unread,
Oct 19, 2020, 9:51:37 AM10/19/20
to osg-...@lists.openscenegraph.org
Hi, you have to modify the geometry of the line.

You can do that either scaling and rotating it or by modifying the
coordinates of the vertices. In the latter case, be sure to deactivate
the display lists of the geometry, otherwise the line will not be
reflect any changes.

--
Alberto

_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

조현준

unread,
Oct 20, 2020, 3:01:05 AM10/20/20
to OpenSceneGraph Users
Hi, Alberto
I saw your answer well. However, there are parts that I still don't understand.

From what you answered, the way that works for me is to modify the coordinates of the two vertices of the line.

First, I need to set the coordinates and travel time with the values ​​below.


=======================================================
[model1]  
movePoint1) longitude:127.0,      latitude: 37.0,  moveTime: 10 second
movePoint2) longitude:127.005,   latitude: 37.0,  moveTime: 20 second
movePoint3) longitude:127.01,    latitude: 37.0,  moveTime: 30 second

[model2]  
movePoint1) longitude:128.0,      latitude: 37.0,  moveTime: 15 second
movePoint2) longitude:128.005,   latitude: 37.0,  moveTime: 20 second
movePoint3) longitude:128.01,    latitude: 37.0,  moveTime: 25 second

[model1 model2 connetion line]

movePoint1)  point1:   longitude:127.0,   latitude: 37.0,  moveTime: 10 second
                         point2:   longitude:128.0,   latitude: 37.0,  moveTime: 15 second

movePoint2)  point1:  longitude:127.005,  latitude: 37.0,  moveTime: 20 second
                        point2:   longitude:128.0,   latitude: 37.0,  moveTime: 15 second

movePoint3) point1:   longitude:127.01,   latitude: 37.0,  moveTime: 30 second
                       point2:  longitude:128.01,   latitude: 37.0,  moveTime: 25 second
======================================================================

 AnimationPath, you can set the center coordinate and movement time in the insert function.

And Since 3ds models are displayed with one coordinate, there is no problem using AnimationPath.

As you answered, you need to modify the two coordinates of the line, but AnimationPath could not find a function that moves while changing the coordinates of the model with more than two coordinates.

There is no problem when displaying in a static state, but it seems to be a problem when using animationPath.

Couldn't the model (line or polygon) displayed with two or more coordinates use the Animation effect by using AnimationPath?

2020년 10월 19일 월요일 오후 10시 51분 37초 UTC+9에 OpenSceneGraph Users님이 작성:

OpenSceneGraph Users

unread,
Oct 20, 2020, 7:32:38 AM10/20/20
to osg-...@lists.openscenegraph.org
Oh, I forgot you were using an animation path. Then I think the easiest
solution is not modifying the vertices but modelling an unit-long line
and then just rotating, scaling and translating it where you want it to
be.
Reply all
Reply to author
Forward
0 new messages