Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Render ¶
func Render(inputFile, outputFile string, options RenderOptions, viewAngle ...ViewAngle) error
Render loads an OBJ file and renders it to a PNG file. An optional ViewAngle can be provided to control the camera angle. If not provided, the default view angle from options.Eye is used. The light position is automatically placed relative to the camera to ensure consistent illumination across all view angles.
Types ¶
type RenderOptions ¶
type RenderOptions struct {
Width int
Height int
Scale int
Fovy float64
Near float64
Far float64
Eye fauxgl.Vector
Center fauxgl.Vector
Up fauxgl.Vector
Light fauxgl.Vector
}
RenderOptions defines the options for the Render function
func DefaultRenderOptions ¶
func DefaultRenderOptions() RenderOptions
DefaultRenderOptions returns the default options for rendering
type ViewAngle ¶
type ViewAngle int
ViewAngle represents a named camera angle for rendering.
const ( // ViewFrontRight is the default view angle, looking from the front-right at elevation. // This matches the original camera position of (3, 3, 3). ViewFrontRight ViewAngle = iota // ViewFrontLeft looks from the front-left at elevation. ViewFrontLeft // ViewFront looks from directly in front at elevation. ViewFront // ViewRight looks from the right side at elevation. ViewRight // ViewLeft looks from the left side at elevation. ViewLeft // ViewBackRight looks from the back-right at elevation. ViewBackRight // ViewBackLeft looks from the back-left at elevation. ViewBackLeft // ViewBack looks from directly behind at elevation. ViewBack // ViewTop looks from directly above. ViewTop )
func (ViewAngle) EyePosition ¶
EyePosition returns the camera eye position for this view angle.
Click to show internal directories.
Click to hide internal directories.