GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 2007-10-09 12:54:00

Grand-High Gamer
Member
Registered: 2007-10-09
Posts: 18

Reworking 3D section

http://www.gmlscripts.com/gml/viewing_the_world
I'm gonna try and define the arguments for d3d_set_projection, so far I have (far from complete):

d3d_set_projection(xfrom,yfrom,zfrom,xto,yto,zto,xup,yup,zup)   Defines how to look in the world. You specify the point to look from, the point to look to and the up vector.

Xfrom, Yfrom, and Zfrom:
The x, y, and z coordinates of the viewing location, the camera.

Xto, Yto, and Zto:
The x, y, and z coordinates to point to, this might be the player object in a third person game. If you want it to point in a specific direction then you must calculate a point in that direction using sine/cosine or the lengthdir functions.

Expandeg. x+cos(direction*pi/180),y-sin(direction*pi/180)

xup, yup, and zup:
These are used to specify the up vector for the view.
Normally in GM 3D you will want to set zup to 1 (setting a positive z value as being up) and leave the rest as 0.
However if you want to use the same up as conventional modelling program and other such 3D stuff then set yup to 1 and leave zup at 0.

Hopefully someone else can help with the wording and such.

Reference:
http://66.102.9.104/search?q=cache:8LvV … cd=8&gl=uk

Last edited by Grand-High Gamer (2007-10-09 12:56:10)


sigimage1.png

Offline

#2 2007-10-10 18:12:32

xot
Administrator
Registered: 2007-08-18
Posts: 1,240

Re: Reworking 3D section

Good stuff. The whole 3D Graphics section of the Help File is entirely too vague. The link to Alvy Ray Smith's notes is a nice touch.


Abusing forum power since 1986.

Offline

#3 2007-10-12 20:40:36

Yourself
Member
Registered: 2007-10-09
Posts: 48

Re: Reworking 3D section

Someone should definitely mention the vertex limit for primitives as well (1024).

Offline

#4 2007-10-13 06:36:14

xot
Administrator
Registered: 2007-08-18
Posts: 1,240

Re: Reworking 3D section

For sure. The vertex limit has bitten so many people in the ass. I've started another topic to discuss primitives and quoted you in there.


Abusing forum power since 1986.

Offline

Board footer

Powered by FluxBB