From: John K. <joh...@ho...> - 2003-02-14 18:17:59
|
Bruce, Thanks for the reply on opacity. It was helpful, but it opens up new questions for me. <<These problems can be solved for triangles, but the solution involves things like clipping. Solving it for entire Visual primitives seems impractical, so we would have to do something like: 1. Render all opaque objects 2. Break all transparent objects into triangles, and store the triangles 3. Find any pairs of triangles not separated by a plane and split them 4. Sort the triangles (using separating planes) 5. Render the triangles If you want to do some research on the topic, you will usually see it referred to as "Painter's algorithm" or "depth sorting". >> It sounds like the real difficulty with implementing transparency is intersecting objects. But isn't this also a difficulty for completely opaque objects as well? How does VPython get around that difficulty for opaque objects? How is this solution different from that for transparent objects? While we're on a similar subject, I'm guessing it would be simple to implement objects whose display color doesn't depend on the scene lighting. I was trying to produce the Sun in a gravity demo I'm writing, but then I realized that it would look silly for the Sun to have a shaded side. Is there perhaps an option for this already? (I'm guessing that having light actually coming from a point inside the scene instead of off-stage from infinity would be difficult to realize.) Also, it is possible to have a wall-paper background at infinity, or at least to put objects of finite angular size at infinity? I wanted to implement a star-field in my gravity demo, so that there'd actually be some semi-realistic way to "see" a black hole against the star-field (plus also to give a sense of orientation to movement through the vacuum of space). Thanks, John Keck _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus |
From: Bruce S. <bas...@un...> - 2003-02-14 20:03:18
|
I emphasize that I myself know no more about the transparency issue than you or anyone else who read David Scherer's analysis! So I can't address questions on that. Concerning a backdrop a long ways away, the only thing you can do is put very large objects a very long ways away. Just like in real life! Here's a little program that shows the Earth going around the Sun, with the Sun shining uniformly brightly and the Earth always lit only on the side facing the Sun. It's based on a note from Dave Scherer a while back that if you deliberately set a color to have components greater than 1, you happen to get a behavior rather like what you want. The only other thing that's needed is to continually move the light. This won't work if you want to show the whole Solar System, because the single faraway light source can continually point at only one of the planets. from visual import * from __future__ import division scene.lights = [vector(-1,0,0)] G = 6.7e-11 # gravitational constant L = 1.5e11 # distance from Sun to Earth # For the Sun, deliberately set color intensity much larger than 1: Sun = sphere(pos=(0,0,0), radius=L/10, color=(10,10,0)) Earth = sphere(pos=(L,0,0), radius=L/20, color=color.cyan) Sun.mass = 2e30 Earth.mass = 6e24 Earth.p = Earth.mass*vector(0,3e4,0) # initial momentum dt = 24*60*60 # time step of one day while 1: rate(100) r = Sun.pos-Earth.pos scene.lights = [norm(r)] F = (G*Sun.mass*Earth.mass/mag(r)**2)*norm(r) Earth.p += F*dt Earth.pos += (Earth.p/Earth.mass)*dt Bruce Sherwood For the other questions, ----- Original Message ----- From: "John Keck" <joh...@ho...> To: <vis...@li...> Sent: Friday, February 14, 2003 1:17 PM Subject: [Visualpython-users] transparency, no-shadow objects, r --> infinity > Bruce, > > Thanks for the reply on opacity. It was helpful, but it opens up new > questions for me. > > <<These problems can be solved for triangles, but the solution involves > things > like clipping. Solving it for entire Visual primitives seems impractical, > so we would have to do something like: > > 1. Render all opaque objects > 2. Break all transparent objects into triangles, and store the triangles > 3. Find any pairs of triangles not separated by a plane and split them > 4. Sort the triangles (using separating planes) > 5. Render the triangles > > If you want to do some research on the topic, you will usually see it > referred to as "Painter's algorithm" or "depth sorting". > >> > > It sounds like the real difficulty with implementing transparency is > intersecting objects. But isn't this also a difficulty for completely > opaque objects as well? How does VPython get around that difficulty for > opaque objects? How is this solution different from that for transparent > objects? > > While we're on a similar subject, I'm guessing it would be simple to > implement objects whose display color doesn't depend on the scene lighting. > I was trying to produce the Sun in a gravity demo I'm writing, but then I > realized that it would look silly for the Sun to have a shaded side. Is > there perhaps an option for this already? (I'm guessing that having light > actually coming from a point inside the scene instead of off-stage from > infinity would be difficult to realize.) > > Also, it is possible to have a wall-paper background at infinity, or at > least to put objects of finite angular size at infinity? I wanted to > implement a star-field in my gravity demo, so that there'd actually be some > semi-realistic way to "see" a black hole against the star-field (plus also > to give a sense of orientation to movement through the vacuum of space). > > Thanks, > > John Keck > > > _________________________________________________________________ > MSN 8 with e-mail virus protection service: 2 months FREE* > http://join.msn.com/?page=features/virus > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: FREE SSL Guide from Thawte > are you planning your Web Server Security? Click here to get a FREE > Thawte SSL guide and find the answers to all your SSL security issues. > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > |
From: Tom M. <mun...@st...> - 2003-02-15 17:31:20
|
I have just stumbled on the Adobe Atmosphere 3D world environment at http://www.adobe.com/products/atmosphere Quite impressive world builder, Javascript API, etc. It has transparency, fog, and lots of navigational stuff, chat rooms, etc. still in beta. What would be the possibility of integrating Vpython into this environment |
From: Bruce S. <bas...@un...> - 2003-02-16 17:35:43
|
Seems very unlikely, since Atmosphere seems to be a proprietary development and presumably not open to grafting in some completely different program. I don't even know what it would mean to "integrate VPython into this environment." Bruce Sherwood ----- Original Message ----- From: "Tom Munnecke" <mun...@st...> To: <vis...@li...> Sent: Saturday, February 15, 2003 12:31 PM Subject: [Visualpython-users] Connecting VPython to Adobe Atmosphere? > I have just stumbled on the Adobe Atmosphere 3D world environment at > http://www.adobe.com/products/atmosphere > > Quite impressive world builder, Javascript API, etc. It has > transparency, fog, and lots of navigational stuff, chat rooms, etc. > still in beta. > > What would be the possibility of integrating Vpython into this > environment > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > |