PHP: swf_lookat - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

swf_modifyobject swf_labelframe

Last updated: Fri, 26 Jan 2007

view this page in

# swf_lookat

(PHP 4, PECL)

swf_lookat -- Define a viewing transformation

## Description

void swf_lookat ( float view_x, float view_y, float view_z, float reference_x, float reference_y, float reference_z, float twist )

The swf_lookat() function defines a viewing transformation by giving the viewing position (the parameters `view_x`, `view_y`, and `view_z`) and the coordinates of a reference point in the scene, the reference point is defined by the `reference_x`, `reference_y` , and `reference_z` parameters. The `twist` controls the rotation along with viewer's z axis.

add a note User Contributed Notes
swf_lookat
hotkey at hehe dot com
03-May-2001 08:34
`You can really do stunning 3D effects using swf_lookat() [and swf_ortho, of course].
Here is a little example of doing a simple 3D-rotation around a text.
The Text is split up into 2 parts, because Flash does not (yet?) support perspective-skewing, only rotation, 2D-skew and scaling. But if you split your 3D-object up into several parts, each part is transformed seperately and you can trick around that loss of perspective-skew.
Have a lot of fun experimenting with that piece of code!
regards
HotKey ^ http://www.SPR.AT
- - - - - - >8 - cut here - - - - -
<?php
Header("Content-type: application/x-shockwave-flash");
swf_openfile("php://stdout", 320, 200, 25, 1, 1, 1);
swf_ortho (-100, 100, -100, 100, -100, 100); #create 3D coordinates
swf_definefont (0, "Pix3");
swf_addcolor (0, 0, 0, 1);
swf_fontsize (10);
swf_fonttracking(0.2);
for ($i=0; $i<628; $i+=8) {
$j = $i / 100;
swf_pushmatrix ();
swf_translate(0,0,0);
swf_perspective(100,1,0,10);
swf_lookat(sin($j)*60,50,cos($j)*60, 0,00,0, 0);
swf_definetext (1, "HotKey@", 0);
swf_translate(-50,0,0);
swf_placeobject(1,10);
swf_definetext (2, "hehe.com", 0);
swf_translate (55,0,0);
swf_placeobject(2,11);
swf_showframe();
swf_removeobject (10);
swf_removeobject (11);
swf_popmatrix();
}
swf_closefile ();
?>
- - - - - - - - 8< - - - - - - - -
*EOF*`
add a note
swf_modifyobject swf_labelframe

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST