Textured Poly

Monkey Forums/Monkey Programming/Textured Poly

Grover(Posted 2011) [#1]
Hi all, I have been playing around with 3D, but in the meantime I have added a command "DrawPolyTextured" to a few of the platforms.

The command is:
DrawPolyTextured( img:Image, verts:float [], uvs:float [] )
img - an Image handle
verts - an array of vertices pairs (need at least 3 pairs - 6 floats)
uvs - an array of UV Texture coordinates to match to the verts.

I should point out that the function in most cases is just a copy of DrawPoly.

Supported Platforms:
Android, PC (GLFW), IOS (Untested), XNA (Untested)
<removed>

If you have any questions please post here.
Cheers,
Dave


MikeHart(Posted 2011) [#2]
Warning: If I am not totally wrong, you are not allowed to republish mojo!!!


Shinkiro1(Posted 2011) [#3]
Mojo is not free, therefore you can't publish modified files (it's explicitly written in readme file in the mojo directory).

Thanks for the DrawPoly Command.
Maybe it's time for an standardized way to add to the official commands? What I mean is to get access to all the gtkxSurface/App Classes ... importing the whole file seems not roght I think.


Grover(Posted 2011) [#4]
Soz.. will remove.

So how can the API be extended so people can benefit from simple changes? Resubmit back to Mark and hope changes go in? Or is there a way via modules? It seems a pity that such a simple/useful thing like textured polys cant be provided for all to make use of?

I just had a thought, would it be feasible to provide extended libraries in a module for each native platform? Although the same problem applies I guess since access to gfx contexts would be needed.


therevills(Posted 2011) [#5]
Post the code in forum and tell the user where to put it... either that are you would need to do some extern stuff.


Gerry Quinn(Posted 2011) [#6]
I think also any prospective addition to mojo should work on all platforms - things that work only on some platforms should go in other modules.


AdamRedwoods(Posted 2011) [#7]

I just had a thought, would it be feasible to provide extended libraries in a module for each native platform? Although the same problem applies I guess since access to gfx contexts would be needed.


Yeah, this is what I've been wrestling with, too, although on a more leisurely pace.

You can create modules with it's individual platform native code.

After looking at your DrawPolyTextured() you could put this into it's own module.

example from somewhere else:
#If TARGET="glfw"
Import "openb3d/src/entity.cpp"
#Endif
Import monkey
Import mojo



Extern

Class Entity = "Entity"
	Method PositionEntity:Void(x:Float,y:Float,z:Float,glob:Int=False)
	Method MoveEntity:Void(mx:Float,my:Float,mz:Float)
	Method TranslateEntity:Void(tx:Float,ty:Float,tz:Float,glob:Int=False)
	Method ScaleEntity:Void(x:Float,y:Float,z:Float,glob:Int=False)
	Method RotateEntity:Void(x:Float,y:Float,z:Float,glob:Int=False)
	Method TurnEntity:Void(x:Float,y:Float,z:Float,glob:Int=False)
	Method PointEntity:Void(target_ent:Entity, roll:Float=0.0)
End



The problem occurs with large libraries that are pre-compiled. There's no way to link stuff in with Trans.exe right now.


Qcat(Posted 2013) [#8]
any one still have this code around. wood love to take a look.


Gerry Quinn(Posted 2013) [#9]
Me too.