Ok, everything works great so far. The only problem is that I am getting some kind of traceback error.
Code:
Traceback (most recent call last): Code:
def mytimer(num): Code:
def shootBullet(): |
Hi,
That means you are trying to index into the avatar list with a value greater than the size of the list. Are you deleting items from the avatar list after you create it? If so then you need to change the way you increment to the next avatar: Code:
nextAvatar = (nextAvatar + 1) % len(avatars) |
I'm still getting the same error. I'm not sure what is causing it. When a bullet "hits" or intersects an avatar, the following code is called:
Code:
if info.intersected: Code:
def RemoveAvatar(avatar): I also tried: Code:
if len(avatars) != NUM_AVATARS: |
New question, similar problem. I have now been told that the avatars must appear with different faces, based on an input. Here is what I have done so far:
Code:
#define a choice variable Here is the code for removing the avatars once shot: Code:
#Check if bullet intersected with anything Thanks |
Try incrementing the to the next avatar before you access it:
Code:
nextAvatar = (nextAvatar + 1) % len(avatars) |
Earilier in this forum, when we discussed the crosshair, you mentioned that we shouldn't be using objects that are attached to the screen when using stereo. I spoke to Mattias this weekend at the VR conference in Alexandria, VA and he mentioned that if we use a 3d object, we would probably be able to fix the problem of the bullets (mentioned in above posts) without having to change the IPD. Is this the case. Is there some way of making a "3d crosshair" that will accurately point to where the bullet would go? If so, do you have any ideas on how this can be implemented? I was thinking of making a vector that would match the vector of the bullet and place an icon (crosshair) at some point on the vector, in 3d, to show an aiming point. How does this idea sound? Can it be done? Please help.
Below is the code I have for the bullet so far. Code:
def shootBullet(): |
Yes, this is how most people implement crosshairs for stereo viewing. Here is a sample script that will place a crosshair 0.1 meters in front of the user.
Code:
import viz |
1 Attachment(s)
Ok, I implemented the crosshair as you said, however I'm still getting an offset between the bullet and the crosshair. Is there anyway to correct this now that I am using the "3d" version of the crosshair? I've attached a copy of the code.
|
I tried your script but I didn't see any bullet. I've modified my previous code so that it shoots a bullet from the center of the viewpoint towards the direction of the crosshair. There will always be an apparent offset between the crosshair and the bullet due to binocular vision.
Code:
import viz |
1 Attachment(s)
I apologize. I think I sent you something I was working on earlier but I corrected it. I still get the same behavior. Would you mind taking a look at this one and let me know if there is something wrong? Thanks
|
In both calls to viz.screentoworld you are adding an offset to the x position. You don't need to do this when using a 3D cursor. Also, after adding the cursor you should disable collisions on it so the bullet does not hit it.
Code:
crosshair.disable(viz.COLLISION) |
All times are GMT -7. The time now is 05:54 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC