POV-Ray : Newsgroups : povray.advanced-users : Pixel position from 3D coordinates : Re: Pixel position from 3D coordinates Server Time
3 Jul 2024 05:18:39 EDT (-0400)
  Re: Pixel position from 3D coordinates  
From: Mike Williams
Date: 24 Sep 2008 02:10:02
Message: <Yk+ZuGG0md2IFw6S@econym.demon.co.uk>
Wasn't it Slagheap who wrote:
>I'm using Povray to render graphical elements to be used in a computer game.
>It's a board game, so I have a camera looking at a board (at a nice perspective
>angle), and I have game pieces on the board.
>
>For the game board, it's easy... I render the full image with no pieces.  Done.
>
>To generate the game piece graphics, I generate full-board images with subsets
>of pieces in situ on the board, but with the board set as no_image, and the
>background pixels transparent.  I can then load several of these full images
>into my game program, and manually select slices of them for a given piece.  I
>can have several game pieces in each image (as long as they have a
>non-overlapping rectangle bounding box.
>
>I also considered generating individual bounded images for the pieces (rendered
>at all the various positions).  This essentially amounts to crops of the images
>in option 1.  That options seems to only complicate everything below...  so I
>think the first option is better, but I'm open to suggestions.

You could use "screen.inc" to place the object wherever you want on the 
screen. You know where it is because you put it there.

See the scenes/incdemo/screen.pov example file that comes with the 
POVRay distribution.

Doing it that way, the second option is probably easier because there's 
no danger of overlap.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.