Skip to content

Instantly share code, notes, and snippets.

@varun19299
Created December 12, 2020 15:50
Show Gist options
  • Save varun19299/d585f2b29667d8d6274535e802104ddc to your computer and use it in GitHub Desktop.
Save varun19299/d585f2b29667d8d6274535e802104ddc to your computer and use it in GitHub Desktop.
Debugging LookAt vs CoordSysTransform "camera"
# eye
# look at point
LookAt 4 0 0 # eye
0 0 0 # look
0 0 1 # up
# up vector
Camera "perspective"
"float fov" [ 60 ]
Sampler "halton"
"integer pixelsamples" [ 128 ]
Integrator "volpath"
Film "rgb"
"integer yresolution" [ 600 ]
"integer xresolution" [ 600 ]
"string filename" [ "output.exr" ]
Scale -1 1 1
WorldBegin
# approximate the sun
LightSource "distant"
"float scale" [1.5]
"blackbody L" [ 3000 ]
"point3 from" [ -30 40 100 ]
AttributeBegin
#CoordSysTransform "camera"
LookAt 4 0 0 # eye
0 0 0 # look
0 0 1 # up
#Rotate 90 0 1 0
LightSource "projection"
"float fov" [ 45 ]
"string filename" [ "patterns/ConventionalGray/12.exr" ]
"float scale" [ 20 ]
AttributeEnd
AttributeBegin
Material "diffuse"
"rgb reflectance" [ 0.3 0.3 0.3 ]
Shape "sphere"
"float radius" [ 1 ]
AttributeEnd
AttributeBegin
Texture "checks" "spectrum" "checkerboard"
"rgb tex2" [ 0.8 0.8 0.8 ]
"rgb tex1" [ 0.1 0.1 0.1 ]
"float vscale" [ 8 ]
"float uscale" [ 8 ]
Material "diffuse"
"texture reflectance" [ "checks" ]
Translate 0 0 -1
Shape "trianglemesh"
"point2 uv" [ 0 0 1 0 1 1 0 1
]
"point3 P" [ -20 -20 0 20 -20 0 20 20 0 -20 20 0 ]
"integer indices" [ 0 1 2 0 2 3 ]
AttributeEnd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment