Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Graal's Image Zooming Problem (https://forums.graalonline.com/forums/showthread.php?t=86709)

wild8900 07-05-2009 02:42 AM

Graal's Image Zooming Problem
 
I am working on a psuedo 3d engine and its going really really good. You can "walk" around several objects and it scales and moves their image around based on your direction and location (The basics). Only problem is the way graal zooms its images. Its hard to explain but as it is now, graal seems like its trying to zoom it from the center of the image. How would I work around that and make it zoom from the bottom center? Ive tried alot of formulas to tweak its draw y location based on its zoom to make it look like its zooming from its bottom center. No luck at all.

Galdor 07-05-2009 03:13 AM

just nag on stefan to give you a 3d server xD

wild8900 07-05-2009 03:31 AM

LOL too much work. I'm making a mario kart type event :3

Galdor 07-05-2009 03:37 AM

Quote:

Originally Posted by wild8900 (Post 1504273)
LOL too much work. I'm making a mario kart type event :3

sounds awesome =D

fowlplay4 07-05-2009 03:40 AM

Is this the effect you're looking for..?

PHP Code:

//#CLIENTSIDE

function onCreated() {
  
with (findimg(200)) {
    
image "block.png";
    
player.x;
    
player.y;
    
this.origx x;
    
this.origy y;
  } 
  
setTimer(0.05);
}

function 
onTimeout() {
  
onAdjustZoom();
  
setTimer(0.05);
}

function 
onAdjustZoom() {
  
with (findimg(200)) {
    
zoom cos(thiso.angle) * 0.5;
    
this.origy - (getimgheight(image) / (layer >= 32)) * zoom;
  }
  
this.angle += pi 32;


I just used the cos to zoom the image in and out to test it.

wild8900 07-05-2009 03:47 AM

I've never even heard of stretchx and stretchy lmao. What are they?

wild8900 07-05-2009 04:01 AM

Yeah that's the effect I want to achieve but your example seems kind of hard to incorporate with the rest of my script. Ill keep testing.

fowlplay4 07-05-2009 04:04 AM

Quote:

Originally Posted by wild8900 (Post 1504279)
Yeah that's the effect I want to achieve but your example seems kind of hard to incorporate with the rest of my script. Ill keep testing.

Glad I could help, good luck.

Matt 07-05-2009 04:27 AM

Can't wait to play the finished product. ^^

wild8900 07-05-2009 12:30 PM

1 Attachment(s)
Fixed it! I made a work around. Instead of adjusting it for different height images, I made all images the same height! 128 pixels high. Perfect. I also made textured walls :3 Doesn't lag clientside at all. It also shows other players with their text and nickname.

Crow 07-05-2009 12:50 PM

Good job, looks awesome :)

Galdor 07-05-2009 01:52 PM

wow! thats awesome make an oldschool FPS like doom or wolfenstein 3d lol xD

wild8900 07-05-2009 02:40 PM

Ahaha. "WolfenGraal 3D".
Im kinda nervous to keep it uploaded to the server I'm making it on. Some of my fellow staff are really untrustworthy... (On npulse)

xXziroXx 07-05-2009 04:14 PM

Quote:

Originally Posted by wild8900 (Post 1504354)
Ahaha. "WolfenGraal 3D".
Im kinda nervous to keep it uploaded to the server I'm making it on. Some of my fellow staff are really untrustworthy... (On npulse)

If you don't find Testbed Server any better, I could provide you with an RC.

DustyPorViva 07-05-2009 06:35 PM

How the hell do you resize your polygons like that for the walls? When I do that, it divides the polygon into to triangles and distorts the texture -_-


All times are GMT +2. The time now is 11:09 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.