Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
H3D.org Feeds

Forum Index


Board index » All Posts (dauguste)




Re: Capture force exerted by user
#1
Not too shy to talk
Not too shy to talk


Thank you Markus, will check it out.

Posted on: 2018/10/17 17:11
Top


Re: Capture force exerted by user
#2
Not too shy to talk
Not too shy to talk


Thanks for your help Markus, I will try what you suggested.

I have another question.
I am writing a simple game so that when the user goes along a path they can collect tokens similar to an endless runner game. Do you have any suggestions on how I could go about this, any examples that I could look at?

I so far created 1 scene with one straight path it has tokens on the path however when the user touches the token only the first one disappears.

Posted on: 2018/10/16 23:03
Top


Capture force exerted by user
#3
Not too shy to talk
Not too shy to talk


Good Day,

Is there any way to capture the force the user exerts when using the haptic device...is there any function or node that stores the force the user exerts when using the haptic device."Phantom OMni"

Posted on: 2018/10/11 21:27
Top


Re: Remove Nodes from a Scene.
#4
Not too shy to talk
Not too shy to talk


Hi Guys,

Any help on the above will be greatly appreciated. I have gotten no where with it. The node keeps going to the origin when the scene is loaded when I have a set translation for it "-.1 .01 .0" . It still defaults to the origin. See last code above.

Regards,
Darcelle

Posted on: 2018/10/9 22:55
Top


Re: Remove Nodes from a Scene.
#5
Not too shy to talk
Not too shy to talk


Hi Everyone,

So I got the node to change position however, when i load the scene in x3d now instead of the node staying at its original location it is going to the default 0 0 0 and then when the mouse is over it... it changes the position. This is not what i want. I want to stay at the position i set it at originally and when the mouse is over it move to a new location.
Below is the working script let me know what i can change plzzzzzzz.. lol thanks.


<Scene>
<TouchSensor DEF='MS' description ='Touch this' enabled = 'true' />

<Transform DEF ="position" translation= "-.1 .01 .0"
rotation="-0.261806 0.363184 0.894178 3.087060" >
<Shape DEF = "Token" >
<Box DEF="PickUp" size=".20 .20 .20"/> <Appearance>
<Material DEF ='MAT' diffuseColor="0.5 0 0.5" transparency='0'/>
<FrictionalSurface stiffness="0.6"/>
</Appearance>
</Shape>
</Transform>

<PythonScript DEF ="PT" url="TestScript.py">
<Transform USE= "position" containerField = "references"/>
<Shape USE = "Token" containerField ="references"/>
</PythonScript>
<ROUTE fromNode='MS' fromField='isOver' toNode='PT' toField='PickToken'/>
<ROUTE fromNode='PT' fromField='PickToken' toNode='position' toField='translation'/>
</Scene>


#Test Script
from H3DInterface import *
#import TestDisappear
import sys

class TokenPickup (TypedField(SFVec3f, SFBool)):
def update(self,event):

#trans = references.getValue()[0]
#shape = references.getValue()[1]

#get whether it was touched or not
#shapetouched = shape.istouched.getValue();
a = event.getValue();
if(a == True):
return Vec3f(0.29, 0.18, 0);
PickToken =TokenPickup()

Posted on: 2018/10/5 18:59
Top


Remove Nodes from a Scene.
#6
Not too shy to talk
Not too shy to talk


Good Day,

I am trying to make nodes disappear when the touch sensor is activated and i am having an issue as it just does not work. Below is the x3d script

<TouchSensor DEF='MS' description ='Touch this' enabled = 'true' />

<Transform DEF ="position" translation= "-.1 .01 .0"
rotation="-0.261806 0.363184 0.894178 3.087060" >
<Shape >
<Box DEF="PickUp" size=".01 .01 .01"/> <Appearance>
<Material DEF ='MAT' diffuseColor="0.5 0 0.5" transparency='0'/>
<FrictionalSurface stiffness="0.6"/>
</Appearance>
</Shape>
</Transform>

<PythonScript DEF ="PT" url="C:\Users\dauguste\Desktop\Annancy'sRaceLevel1\PickUpBlocks.py"/>
<ROUTE fromNode='MS' fromField='isOver' toNode='PT' toField='PickToken'/>
<ROUTE fromNode='PT' fromField='PickToken' toNode='position' toField='translation'/>

this the python script

from H3DInterface import *

class Disappear(TypedField(SFVec3f, SFBool)) :
translation = "1 1 1";
def update(self,event) :
a = event.getValue();
if(a==True) :
return self.translation = "0 0 0";

PickToken = Disappear()


any assistance will be greatly appreciated.


Posted on: 2018/10/4 23:00
Top


Re: Remove a node from python
#7
Not too shy to talk
Not too shy to talk


Thank you so much

Posted on: 2018/8/9 19:12
Top


Re: Remove a node from python
#8
Not too shy to talk
Not too shy to talk


HI,

How do you clear the children field of the group?

Posted on: 2018/8/8 22:32
Top


Re: H3D Programmers! Introduce yourself
#9
Not too shy to talk
Not too shy to talk


Hi All,

My Name is Darcelle I live in the Caribbean. I am a bit new to H3D and i would like to know if anyone knows how to remove a node from a scene when it is touched.


Posted on: 2018/8/8 22:29
Top



TopTop






(C) 2012 SenseGraphics AB    ---    Powered by XOOPS