Web Design Web Design Forum
Registration is free! Here you can view your subscribed threads, work with private messages and edit your profile and preferences Calendar Find other members Frequently Asked Questions Search
Home Web Design

Convenient web based access to our favorite web design Usenet groups

web design reviews

This is Interesting: Free Magazines for Graphics designers and webmasters  





  Last Thread  Next Thread
Author
Thread Post New Thread   

A problem with CylinderSensor
 

Marc




quote this post edit post

IP Loged report this post

Old Post  12-11-03 - 02:34 AM  
I am having a  problem getting the most basic CylinderSensor example to work
correctly.  The goal is to constrain the rotation of a stack two blocks as
if they are on top of a turntable or "Lazy Susan".  The blocks are stacked
vertically along the Z axis, the same as the axis of rotation.

Could anyone tell me what I'm doing wrong?
I have the feeling I don't have the transformation/rotation implemented
correctly.  When I click on the turntable the blocks fall over then rotate.

Suggestions welcomed. Thanks in advance.
Marc

-----------------snip snip snip ----------------------
#VRML V2.0 utf8
# The goal is to stack two blocks in the Z axis on top of a
# circular disk that will act as a turntable or "Lazy Susan".

Transform {

#The turntable
rotation 1 0 0 1.57
children [
DEF TURNTABLE CylinderSensor {
enabled TRUE
diskAngle 0.01
}
Shape { geometry Cylinder { radius 3 height .5 } }

#The blocks on top of the turntable
DEF BLOCKS Transform {
#rotate the coordinate frame back
rotation 1 0 0 -1.57
children [
Transform {
translation 0 0 1
children[  Shape{   geometry Box{  size 2 2 2  } }]
}
Transform {
translation 0 0 2.5
children[ Shape{ geometry Box{ size 1 1 1} }]
}
]
}
]
}

ROUTE TURNTABLE.rotation_changed TO BLOCKS.rotation





Post Follow-Up to this message ]
Re: A problem with CylinderSensor
 

Joerg Scheurich aka MUFTI




quote this post edit post

IP Loged report this post

Old Post  12-11-03 - 03:18 AM  
> correctly.  When I click on the turntable the blocks fall over then rotate.
quote:
> DEF BLOCKS Transform { > #rotate the coordinate frame back > rotation 1 0 0 -1.57
quote:
> ROUTE TURNTABLE.rotation_changed TO BLOCKS.rotation
When the sensor is used, the initial rotation value is overwritten by the value from the sensor (which is near angle 0 at first moment). You should use a Transform with no rotation set as a target of your ROUTE. so long MUFTI -- Wenn Sie das Bearbeiten des Bildes beenden, koennen Sie die Ballabwehrfuehrung benutzen. (aus einem Softwarehandbuch, Sinn "Ballabwehrfuehrung" unklar (Trackball ?))


Post Follow-Up to this message ]
Re: A problem with CylinderSensor
 

Marc




quote this post edit post

IP Loged report this post

Old Post  12-12-03 - 01:26 AM  

Mufti's suggestion is a good one but I don't think it is the problem.
Implementing the change he suggests changes the orentation of the objects.
The intent is to stack the blocks in the Z direction.

When the mouse is clicked on any of the objects the orientation of both
blocks with respect the turntable changes.  I've updated the file to include
some color to make the objects easier to see what is going on.

I've have had trouble finding a basic example of the correct use of a
CylinderSensor.  Suggestions welcomed.

Marc

------------------------snip snip snip -------------------------------------
#VRML V2.0 utf8
# The goal is to stack two blocks in the Z axis on top of a
# circular disk that will act as a turntable or "Lazy Susan".

Transform {

#The turntable
rotation 1 0 0 1.57
children [
DEF TURNTABLE CylinderSensor {
enabled TRUE
diskAngle 0.01
}
Shape{
appearance Appearance{ material Material { diffuseColor 1 0 0 }}
geometry Cylinder { radius 3 height .5 }
}

#The blocks on top of the turntable
DEF BLOCKS Transform {
#rotate the coordinate frame back so that the blocks stack in
the Z
rotation 1 0 0 -1.57
children [
Transform {
translation 0 0 1
children[  Shape{
appearance Appearance{ material  Material {
diffuseColor 0 1 0 }}
geometry Box{  size 2 2 2  } }]
}
Transform {
translation 0 0 2.5
children[ Shape{
appearance Appearance{material Material {
diffuseColor 0 0 1}}
geometry Box{ size 1 1 1} }]
}
]
}
]
}

ROUTE TURNTABLE.rotation_changed TO BLOCKS.rotation



"Joerg Scheurich aka MUFTI" <rusmufti@helpdesk.rus.uni-stuttgart.de> wrote
in message news:br1kdv$2mn$2@news.uni-stuttgart.de...
quote:
rotate.[QUOTE] > > > When the sensor is used, the initial rotation value is overwritten > by the value from the sensor (which is near angle 0 at first moment). > > You should use a Transform with no rotation set as a target of your > ROUTE. > > so long > MUFTI > -- > Wenn Sie das Bearbeiten des Bildes beenden, koennen Sie die > Ballabwehrfuehrung benutzen. > (aus einem Softwarehandbuch, Sinn "Ballabwehrfuehrung" unklar
(Trackball ?))


Post Follow-Up to this message ]
Sponsored Links
 





All times are GMT. The time now is 10:04 PM. Post New Thread   
  Previous Last Thread   Next Thread next
VRML archive | Show Printable Version | Email this Page | Subscribe to this Thread

Popular forums

Adobe Photoshop forum Macromedia Flash Web Site Design
Dreamweaver FrontPage forum
JavaScript Forum XML forum
Style Sheets VRML
Forum Jump:
Rate This Thread:

 

XML RSS Feed web design latest articles Syndicate our forum via XML or simple JavaScript

Web Design archive  Database administration help  


Top Home  -  Register  -  Control Panel   -  Memberlist  -  Calendar  -  Faq  -  Search Top