Seite 202 von 342 ErsteErste ... 102 152 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 252 302 ... LetzteLetzte
Zeige Ergebnis 6.031 bis 6.060 von 10238

Lua Programming Help Thread

This is a discussion on Lua Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; I've been looking all over, but all I've been able to find are lists of the gu functions, with no ...

  
  1. #6031
    Developer
    Points: 4.205, Level: 41
    Level completed: 28%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    San Diego
    Beiträge
    177
    Points
    4.205
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard I found this very useful

    I've been looking all over, but all I've been able to find are lists of the gu functions, with no info on what each one does or how to use them.

    Can someone explain how this works, and what I would need to do to make it display a tile image instead of a red square?
    Check This Out



  2. #6032
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Thanks! I've read through that and now I understand a little bit about what the functions do, but unfortunately not enough to to what I want.

  3. #6033
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    what do you want to do ?

  4. #6034
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    I'm making a program to edit 2d tile maps. Right now, I've got it set up to use KleptoOne's image rotate function to rotate the tiles. However, since it uses the math 2d image functions, in order to keep it from slowing down the program I have to have it create the rotated version of the images and save them into an array as I load them. While this method works, it multiplies the amount of memory the tiles use by 4, which in turn puts a smaller limit on the number of images that can be loaded. Also, the rotated images have small errors in them - shapes get slightly distorted and sometimes one or more of the edges will have a row of blank pixels.

    What I'd like to to is change my graphics display setup so that it can use the 3d GU to display the tiles and rotate them on the fly, which will be faster and use less memory. It's the last thing I want to figure out before making my initial release for the editor. Also, when I get my map editor working, it will not only make it easer to make maps, but I'll also be able to use the code for the graphics display in a game engine.

    On evilmana, I found thread where Soulkiller posted his GU library

    http://forums.evilmana.com/index.php...sg5049#msg5049

    The draw2d function looks like it should be able to do what I want, but when I used it in a test program all I got was a black screen:

    Code:
    a = Image.load("1.png")
    p = {}
    p[1] = 50
    p[2] = 50
    p[3] = 0
    r = {}
    r[1] = 0
    r[2] = 0
    r[3] = 0
    
    function Gum.draw2d(pos,rot,image)
    	local white = Color.new(255,255,255)
    	local square = {
    		{0, 0, -1, -1,  0},  -- TOP LEFT
    		{1, 0, -1,  1,  0},  -- BOTTEM LEFT
    		{0, 1,  1, -1,  0},  -- BOTTEM RIGHT
    		{1, 1,  1,  1,  0},  -- TOP RIGHT
    	}
    	Gu.start3d()
    		Gum.matrixMode(Gu.PROJECTION)
    		Gum.loadIdentity()
    		Gum.perspective(5, 16/9, 0.5, 1000)
    	
    		Gum.matrixMode(Gu.VIEW)
    		Gum.loadIdentity()
    	
    		Gum.matrixMode(Gu.MODEL)
    		Gum.loadIdentity()
    		Gum.translate( pos[1], pos[2], pos[3])
    		Gum.rotateXYZ( rot[1]/57.295779513, rot[2]/57.295779513, rot[3]/57.295779513)
    		Gu.enable(Gu.TEXTURE_2D);
    
    		Gu.texImage(image)
    		Gu.texFunc(Gu.TFX_MODULATE, Gu.TCC_RGBA)
    		Gu.texFilter( Gu.NEAREST, Gu.NEAREST )
    
    		Gu.texScale(1, 1)
    		Gu.texOffset(0, 0)
    		Gum.drawArray(Gu.TRIANGLE_STRIP, Gu.TEXTURE_32BITF+Gu.VERTEX_32BITF+Gu.TRANSFORM_3D, square);
    	Gu.end3d();
    end
    
    
    while true do	
       screen:clear()
       
       Gum.draw2d(p,r,a)
    	screen.flip()	
    
    
       pad = Controls.read()
    
    	if pad:left() and pad ~= oldpad then
    		r[1] = r[1] + 90
    	end
    	
    	if pad:right() and pad ~= oldpad then
    		r[1] = r[1] - 90
    	end
    	
    	if Controls.read():start() then
    		break;
    	end
       oldpad = pad
    end

  5. #6035
    Developer
    Points: 4.205, Level: 41
    Level completed: 28%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    San Diego
    Beiträge
    177
    Points
    4.205
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard Hmm

    I can't seem to get your code to work, but I worked out simular code using the tutorial I showed you. Maybe you can play around with this and use it.
    Analog stick rotates image, circle, triangle zooms in and out. I also have some stuff in there for a racing game I'm woking on, x to accelerate, square to brake and reverse. (Not really relevant, but just in case you get confused)

    Code:
    white = Color.new(255,255,255)
    red = Color.new(255,0,0)
    dred = Color.new(125,0,0)
    blue = Color.new(0,0,255)
    green = Color.new(0,255,0)
    gray = Color.new(153, 153, 153)
    dgrey = Color.new(53, 53, 53)
    
    colors = {}
    colors[1] = white
    colors[2] = red
    colors[3] = blue
    colors[4] = green
    colors[5] = gray
    
    textureimg = Image.load("1.png")
    c = 1
    
    pitch = 0
    yaw = 0
    roll = 0
    x = 0
    y = 0
    z = -5
    r = 0
    newx = 0
    newy = 0
    
    while true do
    	block2 = {
    	{.5,.5,colors[c],0,0,0},
    	{0,0,colors[c],-1,1,0},
    	{1,0,colors[c],1,1,0},
    
    	{0.5,0.5,colors[c],0,0,0},
    	{1,0,colors[c],1,1,0},
    	{1,1,colors[c],1,-1,0},
    	
    	{0.5,0.5,colors[c],0,0,0},
    	{1,1,colors[c],1,-1,0},
    	{0,1,colors[c],-1,-1,0},
    
    	{0.5,0.5,colors[c],0,0,0},
    	{0,1,colors[c],-1,-1,0},
    	{0,0,colors[c],-1,1,0},
    	}
    
    	screen:clear()
    	pad = Controls.read()
    
    	Gu.start3d()
    
    	--clear everything out:
    
    	Gu.clearDepth(0);
    	Gu.clear(Gu.COLOR_BUFFER_BIT+Gu.DEPTH_BUFFER_BIT)
    
    	--setup viewing:
    
    	Gum.matrixMode(Gu.PROJECTION) -- camera mode
    	Gum.loadIdentity()
    	Gum.perspective(50, 16/9, 0.5, 1000) --Sets up the look perspective
    
    	Gum.matrixMode(Gu.VIEW) -- sets model mode
    	Gum.loadIdentity() --goes into model mode
    
    	Gum.matrixMode(Gu.MODEL)
    	Gum.loadIdentity()
    
    	Gu.enable(Gu.BLEND)
    	Gu.blendFunc(Gu.ADD, Gu.SRC_ALPHA, Gu.ONE_MINUS_SRC_ALPHA, 0, 0)
    	Gu.enable(Gu.TEXTURE_2D);
    
    	Gu.texImage(textureimg)
    
    	Gu.texFunc(Gu.TFX_MODULATE, Gu.TCC_RGBA)
    	Gu.texEnvColor(white)
    	Gu.texFilter(Gu.LINEAR, Gu.LINEAR)
    	Gu.texScale(1, 1)
    	Gu.texOffset(0, 0)
    	Gu.ambientColor(white)
    
    	Gum.matrixMode(Gu.MODEL)
    	Gum.loadIdentity()
    
    	Gum.translate(x, y, z);
    	Gum.rotateXYZ(pitch * (Gu.PI/180), yaw * (Gu.PI/180), roll * (Gu.PI/180))
    	Gum.drawArray(Gu.TRIANGLES, Gu.TEXTURE_32BITF+Gu.COLOR_8888+Gu.VERTEX_32BITF+Gu.TRANSFORM_3D, block2)
    
    	--end 3d:
    	Gu.end3d()
    
    	newx = math.ceil(r*math.cos((roll-90) * (Gu.PI/180)))
    	newy = math.ceil(r*math.sin((roll-90) * (Gu.PI/180)))
    	x = x + (newx/1000)
    	y = y + (newy/1000)
    
    	screen:print(10, 10, "x " .. x, white)
    	screen:print(10, 20, "y " .. y, white)
    	screen:print(10, 30, "z " .. z, white)
    	screen:print(10, 40, "pitch "..pitch, white)
    	screen:print(10, 50, "yaw " .. yaw, white)
    	screen:print(10, 60, "roll " .. roll, white)
    	screen:print(10, 70, "r " .. r, white)
    	screen.waitVblankStart(1)
    	screen.flip()
    	if pad:up() then
    		pitch = pitch + 1
    		if pitch > 359 then
    			pitch = 0
    		end
    	end
    	if pad:down() then
    		pitch = pitch - 1
    		if pitch < 0 then
    			pitch = 359
    		end
    	end
    	if pad:l() then
    		roll = roll + 4
    		if roll > 359 then
    			roll = 0
    		end
    	end
    	if pad:r() then
    		roll = roll - 4
    		if roll < 0 then
    			roll = 359
    		end
    	end
    	if pad:left() then
    		yaw = yaw - 1
    		if yaw < 0 then
    			yaw = 359
    		end
    	end
    	if pad:right() then
    		yaw = yaw + 1
    		if yaw > 359 then
    			yaw = 0
    		end
    	end
    	if pad:analogX() > 50 then
    		roll = roll - 4
    		if roll < 0 then
    			roll = 359
    		end
    	end
    	if pad:analogX() < -50 then
    		roll = roll + 4
    		if roll > 359 then
    			roll = 0
    		end
    	end
    	if pad:analogY() > 30 then
    	end
    	if pad:analogY() < -30 then
    	end
    	if pad:cross() then
    		r = r - 2
    	else
    		if r < 0 then
    			r = r + 2
    		end
    	end
    	if pad:triangle() then
    		z = z + .1
    	end
    	if pad:select() then
    		r = r + 1
    		screen.waitVblankStart(10)
    	end
    	if pad:square() then
    		if r >= 0 then
    			r = r + 1
    		elseif r < 0 then
    			r = r + 4
    		end
    	elseif r > 0 then
    		r = r - 2
    	end
    	if pad:circle() then
    		z = z - .1
    	end
    	if pad:start() then
    		while pad:start() do
    			pad = Controls.read()
    		end
    		screen:clear()
    		break
    	end
    end

  6. #6036
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Thanks, that's cool. It does a little more than I need atm, so I'll have to mess around with it a bit to see what I can take out

  7. #6037
    Developer
    Points: 4.205, Level: 41
    Level completed: 28%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    San Diego
    Beiträge
    177
    Points
    4.205
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard Kleptoone

    Yeah, I just copied the source as is for my project without trimming it up. But the function you were looking to create is in there so you should be able to put something together. Let me know if you have any questions.

  8. #6038
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    two questions:

    First, does it really need to have the colors codes in array for the model description?

    And second, although I've trimmed it down to use only the 1/4, 1/2, and 3/4 rotations I need, it resizes the tiles - smaller tiles become bigger, larger tiles become smaller. What do I need to do to display the tile in it's original size?
    Geändert von Merick (03-10-2007 um 04:51 PM Uhr) Grund: Automerged Doublepost

  9. #6039
    Developer
    Points: 4.205, Level: 41
    Level completed: 28%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    San Diego
    Beiträge
    177
    Points
    4.205
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    actually no, if you take that statement out then just make sure you change your draw command to:

    Code:
    Gum.drawArray(Gu.TRIANGLES, Gu.TEXTURE_32BITF+Gu.VERTEX_32BITF+Gu.TRANSFORM_3D, block2)
    edit
    Give me a few on the second question

  10. #6040
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    hmm.. I took the colors out and put in the new draw command, but it gives me the error "wrong number of vertex components"

    Code:
    white = Color.new(255,255,255)
    red = Color.new(255,0,0)
    dred = Color.new(125,0,0)
    blue = Color.new(0,0,255)
    green = Color.new(0,255,0)
    gray = Color.new(153, 153, 153)
    dgrey = Color.new(53, 53, 53)
    
    colors = {}
    colors[1] = white
    colors[2] = red
    colors[3] = blue
    colors[4] = green
    colors[5] = gray
    
    textureimg = Image.load("link.png")
    c = 1
    
    pitch = 0
    yaw = 0
    roll = 0
    x = 0
    y = 0
    z = -5
    r = 0
    newx = 0
    newy = 0
    
    block2 = {
    	{.5,.5,0,0,0},
    	{0,0,-1,1,0},
    	{1,0,1,1,0},
    
    	{0.5,0.5,0,0,0},
    	{1,0,1,1,0},
    	{1,1,1,-1,0},
    	
    	{0.5,0.5,0,0,0},
    	{1,1,-1,0},
    	{0,1,-1,-1,0},
    
    	{0.5,0.50,0,0},
    	{0,1,-1,-1,0},
    	{0,0,-1,1,0},
    	}
    
    
    while true do
    
    	screen:clear()
    	pad = Controls.read()
    
    	Gu.start3d()
    
    	--clear everything out:
    
    	Gu.clearDepth(0);
    	Gu.clear(Gu.COLOR_BUFFER_BIT+Gu.DEPTH_BUFFER_BIT)
    
    	--setup viewing:
    
    	Gum.matrixMode(Gu.PROJECTION) -- camera mode
    	Gum.loadIdentity()
    	Gum.perspective(50, 16/9, 0.5, 1000) --Sets up the look perspective
    
    	Gum.matrixMode(Gu.VIEW) -- sets model mode
    	Gum.loadIdentity() --goes into model mode
    
    	Gum.matrixMode(Gu.MODEL)
    	Gum.loadIdentity()
    
    	Gu.enable(Gu.BLEND)
    	Gu.blendFunc(Gu.ADD, Gu.SRC_ALPHA, Gu.ONE_MINUS_SRC_ALPHA, 0, 0)
    	Gu.enable(Gu.TEXTURE_2D);
    
    	Gu.texImage(textureimg)
    
    	Gu.texFunc(Gu.TFX_MODULATE, Gu.TCC_RGBA)
    	Gu.texEnvColor(white)
    	Gu.texFilter(Gu.LINEAR, Gu.LINEAR)
    	Gu.texScale(1, 1)
    	Gu.texOffset(0, 0)
    	Gu.ambientColor(white)
    
    	Gum.matrixMode(Gu.MODEL)
    	Gum.loadIdentity()
    
    	Gum.translate(x, y, z);
    	Gum.rotateXYZ(pitch * (Gu.PI/180), yaw * (Gu.PI/180), roll * (Gu.PI/180))
    --	Gum.drawArray(Gu.TRIANGLES, Gu.TEXTURE_32BITF+Gu.COLOR_8888+Gu.VERTEX_32BITF+Gu.TRANSFORM_3D, block2)
    -- Gum.drawArray(Gu.TRIANGLES, Gu.TEXTURE_32BITF+Gu.VERTEX_32BITF+Gu.TRANSFORM_3D, block2)
    
    	--end 3d:
    	Gu.end3d()
    
    	newx = math.ceil(r*math.cos((roll-90) * (Gu.PI/180)))
    	newy = math.ceil(r*math.sin((roll-90) * (Gu.PI/180)))
    	x = x + (newx/1000)
    	y = y + (newy/1000)
    
    	screen:print(10, 10, "rotation in deg " .. roll, white)
    	screen.waitVblankStart(1)
    	screen.flip()
    	if pad:left() and pad ~= oldpad then
    		roll = roll + 90
    		if roll > 270 then
    			roll = 0
    		end
    	end
    	if pad:right() and pad ~= oldpad then
    		roll = roll - 90
    		if roll < 0 then
    			roll = 270
    		end
    	end
    	if pad:start() then
    		while pad:start() do
    			pad = Controls.read()
    		end
    		screen:clear()
    		break
    	end
       oldpad = pad
    end

  11. #6041
    Developer
    Points: 4.205, Level: 41
    Level completed: 28%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    San Diego
    Beiträge
    177
    Points
    4.205
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    3rd triangle you deleted one of the points should be:
    Code:
    	{0.5,0.5,0,0,0},
    	{1,1,1,-1,0},
    	{0,1,-1,-1,0},
    as for the sizing, its tricky as the z will define your block size, but if you set it to -9.2 it should be the same size as the original.

  12. #6042
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Ahh, and I also deleted one out of the fourth block too. As for the Z, changing it to -9.5 only make the images smaller. I'll need to figure out some kind of algorithm to change the z based on the size of the image.

  13. #6043
    Developer
    Points: 4.205, Level: 41
    Level completed: 28%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    San Diego
    Beiträge
    177
    Points
    4.205
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    yeah i was eyeballing it, i'll see if I can work one out, if you beat me would you mind posting it?

  14. #6044
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    hmm.. In 3d mode, does the x,y position change to the center of the screen instead of the upper left corner like in 2d?

  15. #6045
    Developer
    Points: 4.205, Level: 41
    Level completed: 28%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    San Diego
    Beiträge
    177
    Points
    4.205
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    yeah, the coordinate system is completely different then 2d. I'm trying to find some good resources on the conversion.

  16. #6046
    QJ Gamer Blue
    Points: 5.034, Level: 45
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    243
    Points
    5.034
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    I'm having problems compiling the luaplayer 0.20 source.
    It compiles without errors (or even warnings) but the eboot just crashes my psp.
    if i could get it to compile, it would be a walk in the park to add ortho support.

  17. #6047
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Compiling LUA Player should be n the C/C++ help thread.

  18. #6048
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    eyece - I got it to compile fine. You may not be compiling correctly... First, make sure you have all the libraries needed installed. When i tried my first time, i needed to install freetype, lualib,lua, and mikmod (mikmodlib wouldnt install i think, so i installed libmikmod). Than, you need to:
    Code:
    make clean-all
    make
    If your getting ready for release, do make release10 or make release15

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  19. #6049
    QJ Gamer Blue
    Points: 5.034, Level: 45
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    243
    Points
    5.034
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    i think im going to have to reinstall cygwin, is the size of the elf/pbp 1,234KB when you guys compile it?

  20. #6050
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    eyece - Depends. My mod of luaplayer is like 1,389 kb or somethin...

    BTW - why do you want to compile lua player ;)

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  21. #6051
    QJ Gamer Blue
    Points: 5.034, Level: 45
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    243
    Points
    5.034
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    KleptoOne wanted to draw stuff in 2D, ortho would be the best option, but its not supported yet. i was going to add it.

  22. #6052
    QJ Gamer Blue
    Points: 4.241, Level: 41
    Level completed: 46%, Points required for next Level: 109
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Alabama
    Beiträge
    142
    Points
    4.241
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    You are adding it to Cools' mod or SG57's Cools' mod, right?

  23. #6053
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    btw whats ortho?

  24. #6054
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von KleptoOne
    yeah, the coordinate system is completely different then 2d. I'm trying to find some good resources on the conversion.
    http://www.youresam.com/tutorials/layout.PNG

  25. #6055
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    The coordinate system isn't all that different, nor hard to adjust to... Just an inverted Y axis. Plus, if you just scale your entire scene -1 on the y axis, youll have the same coordinate system as your used to.

    emerica - Short for orthogonal-projection. Mainly used to incorporate 2D into your program. This will draw your shape in a space that will not move when your 3D scene is rotated. This is perfect when implementing a display system into your game that displays health, ammo, etc.

    If you want, ill post a quick PSPGL example of how to start/stop an orthogonal projection. Theres GU equivalent functions, but youd have to search for em' ;)

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  26. #6056
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    thanks for the clarification, i don't care if you do that or not right now, because i know no 3-D yet anyway.

  27. #6057
    .info
    Points: 15.395, Level: 80
    Level completed: 9%, Points required for next Level: 455
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    ACT, Australia
    Beiträge
    1.674
    Points
    15.395
    Level
    80
    Downloads
    0
    Uploads
    0

    Standard

    I've seen it before, but i'm not sure how to do it; how can i get the filesize of something and return it as a string?

    http://www.yongobongo.com
    PSN - yongobongo

  28. #6058
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    files = System.listDirectory(directory name)
    fileInfo = {}
    count = 1
    for i = 3, table.getn(files)
       if files[i].directory == false then
          fileInfo[count] = {filename = files[i].name, filesize = files[i].size}
          count = count +1
       end
    end
    I haven't tested it, but this bit of code should set up fileInfo as a table with a file list for the specified directory. fileInfo[number].filename to get the filename, fileInfo[number].filesize to get the file size. Alternately, if you already know the exact filename that you are looking for, you can can set up your loop to scan the files array to look only for that filename, and then get the filesize for that file only:

    Code:
    for i = 3, table.getn(files)
      if files[i].name == "filename" then filesize = files[i].size
    end
    with either, I think that the file size that will be returned will be a number value, but you can use tostring to convert it to a string if you really need to
    Geändert von Merick (03-12-2007 um 02:38 AM Uhr)

  29. #6059
    .info
    Points: 15.395, Level: 80
    Level completed: 9%, Points required for next Level: 455
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    ACT, Australia
    Beiträge
    1.674
    Points
    15.395
    Level
    80
    Downloads
    0
    Uploads
    0

    Standard

    So basically if i get the directory listed in a table, and search the table for blah[blah].size, it should return the value?

    http://www.yongobongo.com
    PSN - yongobongo

  30. #6060
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Yeah, basically. There might be an even easier way, but if so I haven't found it yet.


 

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 07:53 AM Uhr.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © , Caputo Media, LLC. All Rights Reserved. Cluster .