[futurebasic] Re: [FB] 3D Object Rendering with Materials

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2001 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Wed, 31 Oct 2001 01:33:11 -0500
>>You will need to UV map the sphere model with Texture coordinates, and use
>>these to guide drawing in the color from a texture map. OpenGL  or
>>QuickDraw 3D can aid with this. Lot of setup to do. Look at the OpenGL Cube
>>demo on the CD.
>>
>>
>>For any X,Y,Z vertex on the Sphere, you would need to have a UV coordinate
>>to match.
>>
>>UV coordinates are just normalized coordinates, that is they go from 0 to 1.0
>>
>>If you have a maximum X of 400, and a maximum Y of 400, then the UV
>>equivalent of X = 200, Y = 200  will be .5,.5
>>
>>To get that just use U = X/400, V = Y/400 or whatever the maximum of either
>>valus is.
>>
>>Then say you have a Spherical point that is 100,100 ... 100/ 400 = .25
>>
>>If the Y is the same, thus the V, you will find whatever pixel lies on your
>>texture map at .25,.25
>>
>>If your Texture map is 200 X 400, you will want the pixel at   50,100
>>
>>This is derived from X = U*200, Y = V*400
>>
>>
>>Complicated. Then there is a need for anti-aliasing when scaling the model,
>>etc.
>>
>>Best to use OpenGL for this if you don't know the fundamentals. It will
>>automate a lot of it, and the headers are already done thankfully. Tricks
>>of the Game Programming Guru's also has info on this, and with Quickdraw
>>3D, which is not longer supported. Quesa 3D is the pickup where that left
>>off.
>
>
>Thanks Robert but isn't there a simpler way of doing it?

There may be .  :) Let me know what you come up with.

>I don't need this feature at the moment but it would look better than the
>wireframe 3 circle model that I am using at the moment.

>I'll give it some more thought and do some more research, I think I may
>have a problem with this in the way that I do the rotation.

Another alternative is to have such a cloud of proper colored points, that
when they are drawn in a scaled down fashion, you get the same effect as
rendering facets.

I wish I didn't know the "proper" way of doing things on occasion as it can
sometimes limit future thought options and creation of new approaches.
Beginner's Mind is a marvelous thing.

RC