#1
|
|||
|
|||
putting objects on the screen
dear Farshizzo,
I was wondering if there's a way to place an object at the display screen- I specifically have a ball that I want create the illusion of distance with by scaling it manually- thus overriding Vizard's ball scaling. I tried to use object= viz.add('object.wrl', viz.SCREEN) but to no avail (I couldn't see the object- it dissappeared). Maybe you have some ideas? My other question is assuming that there is a way to place the object at the screen-- is there a way to have other objects that are behind it in the Vizard world occlude it as to make it seem like those objects are in front of my original object. THis would allow me to put this object on the screen, scale it my own way and yet have it seem like it's z position is greater than other object's (ie: it's further away from the user). If these questions make no sense to you I'll attempt to clarify. Thanks, Jargon
__________________
:-$ |
#2
|
|||
|
|||
Hi,
When an object is attached to the screen its initial position is in the lower left corner. Try translating it to the center of the screen: Code:
object.translate(0.5,0.5) Do you want the object to be occluded by all objects or just some? |
#3
|
|||
|
|||
Nice that worked.
I want the ball to be occluded by only 1 object and only some of the time. Is this possible?
__________________
:-$ |
#4
|
|||
|
|||
Hi,
This is somewhat tricky to do and it really depends on how many objects you are using and what kind of objects they are. Are you only going to have these two objects? What kind of objects are these? |
#5
|
|||
|
|||
farshizzo-
I guess I only have 1 object- it's a tennis court - but really it's just the net that I want to obstruct the ball. And only some of the time (when it's on my side of the court I want the ball to appear in front of the net; however on my opponent's side I want the ball to appear behind the net). If it's impossible I'll formulate another strategy thx, jargon
__________________
:-$ |
#6
|
|||
|
|||
Hi,
When you want the ball to appear behind the net you would do the following: Code:
#Ball behind net net.disable(viz.DEPTH_TEST) net.draworder(16) ball.draworder(15) Code:
#Ball front net net.enable(viz.DEPTH_TEST) net.draworder(16) ball.draworder(17) Out of curiosity, why do you want the ball to be attached to the screen? |
#7
|
|||
|
|||
Hi,
I just realized that you can have other objects in front of the net. Just set their draw order to a value higher than the net's draw order. I'm pretty sure that should work. |
#8
|
|||
|
|||
Farshizzo,
thanks for the method; The reason I was thinking of attaching the ball to the screen was to possibly scale the ball manually to create a sense of the ball travelling in the +z (scale down) or -z (scale up) direction. Right now I'm using a frustum with a locked near value- this allows for left and right navigation but disallows the confusing display effects of how near or far a person is to the screen. However, the scaling is wrong based on person position and furthermore the person's position from the screen does not equal the person's virtual court position. If this all seems confusing it kind of is. Disallowing Vizard's scaling I would be able to solve this problem; However I now have a new problem- even if I can get the ball behind the net I can never really get the ball to bounce on a specific portion of the court without taking into consideration the percieved slant of the court (ie: the ball would have to bounce at varying heights depending on how far along the court in +z it was bouncing). Eh this description is terrible. Thanks for your help, Jargon
__________________
:-$ |
|
|