Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
3Dmember.image

3Dmember.image

2004-02-11       - By Lucas Meijer

 Back
Reply:     1     2     3     4     5     6     7     8     9     10     >>  

Found the code I've used in the bathroom design app to render a highres
3d. I think all those updatestage's are there from some testing and
might have never been taken out, not sure if you actually need 4.
This assumes you have a 800x600 viewport

on renderHighres3d(tW3D,tRect)
  tBackupStageRect=(the stage).rect.duplicate()
  tBackupDrawRect=(the stage).drawRect
  --  (the stage).rect=rect(0,0,800,600)
  (the stage).drawrect=rect(0,0,800,600)
  the stagecolor=the stagecolor


  tBackupFrame=the frame
  mach8_go("printscreen")

tSprite=script("sprite").new([#name:"printsprite",#range:["printscreen"]])

  tSprite.setMember(tW3D)
  tStageWidth=(the stage).rect.width
  tStageHeight=(the stage).rect.height

  tSprite.setWidth(tRect.width)
  tSprite.setHeight(tRect.height)

  tBackupRegpoint=tW3D.regpoint
  tW3D.regpoint=point(0,0)
  tSprite.setLoc(point(0,0))

  tOldDTS=tW3D.directToStage
  tW3D.directToStage=0


  tImage=image(tRect.width,tRect.height,16)

  tStageRect=rect(0,0,tStageWidth,tStageHeight)


  if the shiftdown then
    tDebug=1
  end if

  repeat while 1=1
    repeat while 1=1

      if tDebug then
        tRandom=rgb(random(255),random(255),random(255))
        repeat with i=1 to tW3D.shader.count
          tW3d.shader[i].ambient=rgb(0,0,0)
          tW3d.shader[i].diffuse=rgb(0,0,0)
          tW3d.shader[i].specular=rgb(0,0,0)
          tW3d.shader[i].emissive=tRandom
        end repeat
      end if

        -- for some reason need to do 3 in order for reflections etc to
setup correctly.
      updatestage
      updatestage
      updatestage
      updatestage

      if tDebug then
        repeat while the shiftdown=0
        end repeat
        repeat while the shiftdown=1
        end repeat
      end if

      tSnapRect=tSprite.getRect().intersect(tStageRect)
      t=-tSprite.getLoc()
      tImage.copyPixels((the
stage).image,tSnapRect.offset(t[1],t[2]),tSnapRect,[#ink:36,#bgcolor:rgb(0,0
,102)])

      if tSprite.getRight()<=tStageWidth then
        tSprite.setLocH(0)
        exit repeat
      end if
      tSprite.setLocH(tSprite.getLocH()-tStageWidth)

    end repeat
    if tSprite.getBottom()<=tStageHeight then exit repeat
    tSprite.setLocV(tSprite.getLocV()-tStageHeight)
  end repeat


  tSprite=tSprite.destroy()
  tW3D.directToStage=tOldDTS

  (the stage).rect=tBackupStageRect
  (the stage).drawRect=tBackupDrawRect



  --rob 1.0.1 21012003 printbug some users, uncommented next line

  --getRendererServices().renderer=tBackup



  tW3D.regpoint=tBackupRegpoint

  mach8_go(tBackupFrame)
  return tImage
end
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
Dir3d-l mailing list
Dir3d-l@(protected)
http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l