comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » 3d graphics
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: 3d graphics [message #34162 is a reply to message #2845] Mon, 24 February 2003 10:14 Go to previous messageGo to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
"Dan Madeira" wrote in message ...



> We have drawn four globes representing the Earth, moon, mars and the sun
> using the `orb` procedure, and then used a for loop to translate the
globes
> according to a specified orbit, redrawing the view in both the right view
> and left view widgets each time. However this results in a large lag
between
> each update, which ruins the steroscopic effect. Has anyone got any ideas
of
> a faster technique?


Your biggest problem may be with the orb object (which IMO it was written
poorly). The orb object recalculates it's vertices for every SetProperty
call. If you are moving your orbs directly you are paying this price. You
have two options, you can place your orbs in another model and manipulate
that model or you can "fix" the orb (you may want/need to copy orb__define
to a local directory before you fix it and you will want to make sure that
the fixed orb__define get's called and not the old one). Here is the simple
fix:

PRO orb::SetProperty, POS=pos, RADIUS=radius, DENSITY=density, _EXTRA=e

rebuild = 0B

; Pass along extraneous keywords to the superclass and/or to the
; polygon used to represent the orb.
self->IDLgrModel::SetProperty, _EXTRA=e
self.oPoly->SetProperty, _EXTRA=e

IF (N_ELEMENTS(pos) EQ 3) THEN BEGIN
self.pos = pos
rebuild = 1B
ENDIF

IF (N_ELEMENTS(radius) EQ 1) THEN BEGIN
self.radius = radius
rebuild = 1B
ENDIF

IF (N_ELEMENTS(density) EQ 1) THEN BEGIN
self.density = density
rebuild = 1B
ENDIF

; Rebuild the polygon according to keyword settings.
IF (rebuild) THEN self->BuildPoly
END


If this isn't your problem other possibilities could be bad code or bad
hardware. Make sure you aren't doing more than you need to when it comes to
drawing your scene. Object graphics requires a decent graphics adapter to
render all but the simplest of scenes quickly so if you are stuck on an slow
machine reduce the complexity of your models as much as possible (use the
orb's DENSITY keyword).


You may also want to take a look at my camera object. Spice up that project
by moving the viewer thru the solar system. It probably would simplify the
creation of the stereographic views too. I have been wanting to try this
with a couple of LCD projectors with polarized glasses and lenses for a long
time but haven't gotten around to it. Maybe you can put your classmates to
shame by presenting your project in this way. Just get back to me and let
me know how it went :)

http://www.acoustics.washington.edu/~towler/



> Also, we would like to have a globe, which is internally lit, representing
> the sun. However when we placed a light source inside the orb, its surface
> remained unlit though the other objects were properly lit. Is there any
> simple way of solving this?

Lights don't illuminate the back sides of polygons which is why your sun is
dark whilst your planets are illuminated. Just position another light so
that it illuminates your sun. David's suggestion of a directional light
oriented towards the sun is good. If you use my camera object you can query
it for the viewing vector and use that to orient your light. Easy, if you
can get away with a "headlight" setup where the light is positioned the same
place as the viewer. If a planet passes between the viewer and the sun you
won't be able to do this because the headlight will shine on the dark side
of the planet so you'll need to do some extra math to place the light on the
view vector inside the smallest orbit.

Do keep your lights to a minimum. Depending on your hardware they can be
costly additions.

-Rick
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Upgrade the 'double' accuracy in IDL 5.5
Next Topic: Reading a table of data quickly

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:53:13 PDT 2025

Total time taken to generate the page: 0.00362 seconds