3D rotation in canvas possible?

BlitzMax Forums/BlitzMax GUI Programming/3D rotation in canvas possible?

Hi all!

In my app I'm using a small canvas to display my software logo. I was wondering if it is possible to rotate/turn the logo itself (not the text) slowly in true 3D?

Is it possible to do under DX as well as opengl.
Or is it wise just to take one road?

There is a 3D bmx cube example, but I have no idea how to adopt it according to my needs.

I'm a complete newbie in terms of 3D coding, so don't laugh at me... ;))))

Image:


Basic Code:
SuperStrict 

Global AboutWindow:TGadget=CreateWindow(" Info", (GadgetWidth (Desktop ())-393)/2,(GadgetHeight(Desktop ())-273)/2,393,273,Null,WINDOW_TITLEBAR | WINDOW_CLIENTCOORDS)
Global AboutCanvas:TGadget=CreateCanvas(3,3,200,267,AboutWindow)
Global MutantIMG:TImage=LoadImage("mutant.jpg")

Global ScrollTimer :TTimer=CreateTimer(27)   ' Timer for animation speed
Redraw_Logo()

While True
	WaitEvent() 
 	
	Select EventID()

    Case EVENT_TIMERTICK

    Select EventSource()
           Case ScrollTimer
                Redraw_Logo()
    End Select 


	Case EVENT_WINDOWCLOSE
			End
	End Select
Wend

Function Redraw_Logo()
	SetGraphics CanvasGraphics (AboutCanvas) 
	SetColor 0,0,0
	Cls
	SetColor 255,255,255
	DrawImage MutantIMG, 0,0
	Flip 0
End Function 


Grisu

Just put SetRotation in there before you DrawImage. You can do anything that Max2D can do, on the canvas.

That's not real 3D. ;)

I want to put the logo on a domino cube and turn it sideways.
So that u only see a "|" when it's in the middle of the animation.

I think you need some 'basic' 3d engine, it's no so easy. Maybe (for OpenGL only) you can check the ne-he tutorial, there should be something that you can use.
I'm sorry, but I dont' know too much about 3d-math&co

isnt there a rotating 3dgl teapot demo?

There is even MiniB3D basing on OpenGL which lets you do all this basic Blitz3D stuff without the need to reinvent the wheel :)

set the matrix to the modelview matrix and set the rotation
in gl or dx

AngelDaniel, are you speaking of MiniB3D?

He is speaking of plain API.
Just transform the sprite accordingly (ie change the modelview matrix) so it changes in 3D instead of 2D only (which is all Max2D supports as it is 2D :) )

Plain API, urgs.

Cross platform would be nice and this is impossible with windows API instructions.