Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
H3D.org Feeds

Forum Index


Board index » All Posts (Markus)




Re: Remove Nodes from a Scene.
#1
Webmaster
Webmaster


Hello,

This is terribly embarrassing but I have not seen this post. My deepest apologies I thought I had notifications on, will see if I can turn it on again.

Here is a modification of your python script which you can play with.

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

class TokenPickup (TypedField(SFVec3fSFBool)):
  
def __init__(selfdefault_positiontarget_position):
    
TypedField(SFVec3fSFBool).__init__(self)
    
self.target_position target_position
    self
.default_position default_position
    
# Do this to set the initial value of the field. If you do not do this then PickToken.getValue() will return 0,0,0. 
    
self.setValuedefault_position )

  
def update(self,event):

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

    #get whether it was touched or not 
    #shapetouched = shape.istouched.getValue();
    
event.getValue();
    if(
== True):
      return 
self.target_position
    
return self.default_position # To get rid of any warnings about not returning a value in all cases. If you skip this then I think that 0,0,0 will be returned.
PickToken =TokenPickupVec3f(0.290.10), Vec3f(0.290.180))

Posted on: 2018/11/15 10:43
Top


Re: Capture force exerted by user
#2
Webmaster
Webmaster


Hello,

You could take a look at the tutorials section in the wiki.
http://www.h3dapi.org/modules/mediawiki/index.php/H3DAPI_Tutorials
I was thinking about the light a bomb with a match tutorial.
From there we also (apparently) have a link that I forgot about to an external site with tutorials. On that site they do have a "block maze" tutorial. So that is probably the closest to a simple game you could find.

https://sites.google.com/site/h3dtutorials/
https://sites.google.com/site/h3dtutorials/blockmaze

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


Re: Capture force exerted by user
#3
Webmaster
Webmaster


Hello,

Exactly what do you mean with "the force the user exerts"? I assume this is not the same force as the force that is rendered on the haptics device. If that is what you want then the DeviceLog class might be useful to you.

If you set it up so that you only have passive forces which reacts to the users input then you could probably fake a direct mapping. Such as using a SpringEffect to measure the force the user inputs. You still would have to account for things like gravity perhaps to get a better measurement though.

Posted on: 2018/10/12 9:44
Top


Re: H3D Programmers! Introduce yourself
#4
Webmaster
Webmaster


Much welcome to the forum.

Posted on: 2018/8/9 7:39
Top


Re: Remove a node from python
#5
Webmaster
Webmaster


Hello,

If you have a reference to the group node in python and that reference is named g then simply do:
g.children.clear()

Posted on: 2018/8/9 7:38
Top


Privacy Policy
#6
Webmaster
Webmaster


Dear Forum users,

We are updating our Privacy Policy for you to understand what information we collect and why we collect it.

If you have added your Real Name to your profile on the H3DAPI.org website, please be aware that we have removed it. If you add it back into your profile, it means that you consent to it being shared with other users on the website. Please see the link to our privacy policy below for how your personal data that you may enter will be used. You can also find this policy on our website at: http://www.h3dapi.org/modules/gdpr/privacy_policy.php.

If you have any questions or concerns about this privacy policy, please don’t hesitate to contact us at support@sensegraphics.com.

Posted on: 2018/5/24 14:56
Top


Re: Running H3D window on second screen
#7
Webmaster
Webmaster


In H3DViewer it is implemented in H3DViewerApp.cpp in the
MyApp::OnInit function.

Also double check H3DLoad command lines so I am not completely out of the blue, but I can't find anything in the code regarding this.

Posted on: 2018/5/24 7:42
Top


Re: Running H3D window on second screen
#8
Webmaster
Webmaster


We have a task in our backlog (not the public one) about unifying the command line options for H3DLoad/H3DViewer.
For H3DViewer you can set the position/size (at least if you build the latest trunk).
For H3DLoad I am afraid it looks like only size can be set. If you are not opposed to modifying this yourself you could just add a similar option to your H3DLoad as the one that is in H3DViewer.

Posted on: 2018/5/22 9:09
Top


Re: RuntimeError: UnableToCreatePythonField: fieldAsPythonObject()
#9
Webmaster
Webmaster


It looks like you are mixing concepts a bit.

traverseSG is using the update function of the class Trial which kind of looks like an class that should inherit from the field types in H3DInterface and should be using the routing system.

Whichever system you are using ( traverseSG or the other setup with fields and routes) does not really matter but it was a bit confusing to me at first.

If this code is correct, then the first time traverseSG will be called the cylinder will change to the new color. Which color are you actually seeing when you start the program (maybe it changes so fast that you do not notice).

And finally, this really looks like some kind of recursive issue.
If your x3d file is called Trials.x3d then you can see that it includes the python script file Trials.py which then loads Trials.x3d which then loads Trials.py and I really do not know what to expect in this case (the module should only load once, but it is still quite weird).
You can either use the references field to give the node you are interested in to python or use getNamedNode() function in python.

Posted on: 2018/5/14 9:10
Top


Re: How can I update SmoothSurface stiffness with python?
#10
Webmaster
Webmaster


UpdateStiffness is a wrapper name. Look at the base class for this particular field and you can see that it inherits from SFFloat. The field itself is inputOutput so you can treat it as an SFFloat field just fine.

The purpose of this particular field is to properly transfer the value it is set to into the haptic loop at some point.

Posted on: 2018/5/2 8:15
Top



TopTop
(1) 2 3 4 ... 249 »






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