3d space to 2d space

Started by
1 comment, last by BlueGrass 23 years, 3 months ago
I need to project a triangle from 3d space onto its 2d plane so that i only have 2 coordinates instead of 3 for each point. My question is, how do i do this? If anyone''s interested, i''m using this to texture my models evenly so there is no stretching. I kinda flatten all the triangles onto one plane and place a texture over it so that it fits nicely. of course, I''ll have to try and keep the flattened mesh as rectangularly shaped as possible to use as little memory as possible. thanks BlueGrass
Advertisement
Most modeling packages support this already. It is called UVW unwrap in 3D Studio MAX and simply UV mapping in Blender (which is free, by the way: www.blender.nl).



Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Take your 3d vector:
vold = <x,y,z,w>
and do the following:
vnew = <x/z * viewing distance, y/z * viewing distance, 1>
to get the new projected vector. To calculate viewing distance, you do the following calculation:
viewing distance = (viewport width/2)/tan(horizontal field of view/2)


Just because you're outnumbered doesn't mean you're wrong.


sharewaregames.20m.com

Edited by - furby100 on January 16, 2001 1:26:06 PM

This topic is closed to new replies.

Advertisement