WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-17-2003, 03:08 PM
adimov adimov is offline
Member
 
Join Date: Sep 2003
Location: Santa Barbara, CA
Posts: 11
2D graphic problems

There is a disparity in the way OPENGL graphics look in 2.11 and 2.12. When moving objects that have been passed layers, for example:
viz.startlayer(viz.QUADS)
viz.vertexcolor(1, 1, 1)
viz.vertex(0,0,0)
viz.vertex(0.05,0,0)
viz.vertex(0.05,0.05,0)
viz.vertex(0,0.05,0)
trace = viz.endlayer()

all my objects are moving together, not just the one I am actually moving. The objects are a part of a class with many instances and when I move one instance all of them are moving together. Furthermore, the scale of the objects in not the same as in 2.11
Also, the colors of different objects switch sometimes...
I can send the code if you want me to, or maybe you already know what the problem is,
Thanks,
Alex
Reply With Quote
  #2  
Old 11-17-2003, 03:29 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi Alex,

I'm not clear on what your problem is. Are you saying that when you translate one object, all of the objects are being translated? You also mentioned that the scale is different, are the objects bigger or smaller? Could you send me your code so that I could compare it between the two different versions here? If you don't want to post your code on the forum you can send it to lashkari@worldviz.com. Thanks.
Reply With Quote
  #3  
Old 11-17-2003, 03:47 PM
adimov adimov is offline
Member
 
Join Date: Sep 2003
Location: Santa Barbara, CA
Posts: 11
I've just sent you the code via e-mail,
Thanks,
Alex
Reply With Quote
  #4  
Old 11-17-2003, 04:37 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi Alex,

I believe I found the solution to your problem. You need to have the import viz and viz.go() statements at the very top of your script. You must always put these two lines before any other viz commands. There was a mistake in the previous versions that allowed you to bypass this, but it was corrected in 2.12

On a side note, I'm not sure if you are aware, but you can add layer objects to the screen by doing the following:
Code:
viz.startlayer(viz.LINES)
.
.
.
indicator = viz.endlayer(viz.SCREEN)
Then you can use screen coordinates to move the object. For instance if the mouse is at [0.2,0.3], then you would simply do:
Code:
indicator.translate(0.2,0.3)
and it would show up underneath the mouse pointer. I'm only saying this because I noticed that all the objects are always in front of the screen, and its usually easier to perform 2d calculations than 3d calculations. Hope this helps!
Reply With Quote
  #5  
Old 11-17-2003, 04:40 PM
adimov adimov is offline
Member
 
Join Date: Sep 2003
Location: Santa Barbara, CA
Posts: 11
Thumbs up

Thank you very much, and I will take advantage of the hint.
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 07:35 AM.


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