This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > VRML > December 2004 > Interpolator around sphere?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Interpolator around sphere?
Chris Flynn

2004-12-20, 7:19 pm

Hi,
I want to move objects (boats) around a sphere (the Earth) e.g. with radius
3, from point 0 0 3 to -3 0 0. Is there a way to achieve this so that the
boats sail across the Earth nicely, without cutting through it? E.g. not
from A to B, but taking account of the Earth!


Thanks,
Chris


Joerg Scheurich aka MUFTI

2004-12-20, 7:19 pm

> I want to move objects (boats) around a sphere (the Earth)

The earth is not a sphere - really 8-)

> e.g. with radius
> 3, from point 0 0 3 to -3 0 0. Is there a way to achieve this so that the
> boats sail across the Earth nicely, without cutting through it? E.g. not
> from A to B, but taking account of the Earth!


Your task is not definite, there is more than one way to move from two
points along a sphere. Do you want to use the shortest way ?

Simply use a orbit movement with 2 Transforms, something like

#VRML V2.0 utf8

Transform
{
children
[
Shape
{
appearance Appearance
{
material Material
{
}
}
geometry Sphere
{
radius 3
}
}
]
}

DEF Transform1 Transform
{
children
[
Transform
{
children
[
Shape
{
appearance Appearance
{
material Material
{
}
}
geometry Cone
{
height 1
}
}
]
rotation 0 0 1 1.57
translation 3.5 0 0
}
]
}

DEF TimeSensor1 TimeSensor
{
cycleInterval 10
loop TRUE
}

DEF OrientationInterpolator1 OrientationInterpolator
{
key
[
0
1
]
keyValue
[
0 1 0 0
0 1 0 -1.57
]
}

ROUTE TimeSensor1.fraction_changed TO OrientationInterpolator1.set_fraction
ROUTE OrientationInterpolator1.value_changed TO Transform1.set_rotation



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews