WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1  
Old 05-23-2005, 01:12 AM
jargon jargon is offline
Member
 
Join Date: May 2005
Location: Es Bee
Posts: 9
Question 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
__________________
:-$
Reply With Quote
  #2  
Old 05-23-2005, 11:23 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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)
Screen coordinates are in the range [0,1], where [0,0] is the lower left corner and [1,1] is the upper right corner.

Do you want the object to be occluded by all objects or just some?
Reply With Quote
  #3  
Old 05-23-2005, 12:03 PM
jargon jargon is offline
Member
 
Join Date: May 2005
Location: Es Bee
Posts: 9
Nice that worked.
I want the ball to be occluded by only 1 object and only some of the time. Is this possible?
__________________
:-$
Reply With Quote
  #4  
Old 05-23-2005, 12:41 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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?
Reply With Quote
  #5  
Old 05-23-2005, 08:48 PM
jargon jargon is offline
Member
 
Join Date: May 2005
Location: Es Bee
Posts: 9
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
__________________
:-$
Reply With Quote
  #6  
Old 05-24-2005, 10:59 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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)
Note: the net object must be separate from the ground object. When you want the ball to appear in front of the net do the following:
Code:
#Ball front net
net.enable(viz.DEPTH_TEST)
net.draworder(16)
ball.draworder(17)
Like I said earlier, this method breaks down if you have other objects in the scene that need to be in front of the net.

Out of curiosity, why do you want the ball to be attached to the screen?
Reply With Quote
  #7  
Old 05-24-2005, 11:25 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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.
Reply With Quote
  #8  
Old 05-24-2005, 11:31 AM
jargon jargon is offline
Member
 
Join Date: May 2005
Location: Es Bee
Posts: 9
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
__________________
:-$
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:47 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC